← Back to blog
TROUBLESHOOT nodetonet.com

Android agent troubleshooting — when the phone won't stay paired

N Nodetonet Team
April 27, 2026 8 min read

The Nodetonet Android agent is a thin WebSocket client — it dials out to an edge server, holds that connection open, and forwards proxy traffic over it. When something breaks, the root cause is almost never the agent itself. It is Android's aggressive background-process management, a carrier filtering certain ports, or Doze mode suspending network activity. Four symptom patterns cover the vast majority of support tickets, and each has a concrete fix you can apply in a minute or two.

If you have not yet paired your first device, start with Your first token and Android pairing — this post assumes you already have a token created and the app installed and running.

Quick-reference symptom table

What you seeLikely causeFix
Spinner stuck on "Connecting…" indefinitelyBattery optimisation killing network socketsSet battery to Unrestricted; see Section 1
Token ONLINE, but proxy returns 502 / ECONNRESETCarrier blocking outbound destination portsWi-Fi test to confirm; switch protocols; see Section 2
ONLINE → OFFLINE loop every 6–15 minAndroid Doze suspending background networkingRequest battery whitelist in-app; see Section 3
IP changes every 10–12 min automaticallyRotating sticky TTL or airplane-mode cycleCheck token group settings; see Section 4

1 · "Connecting…" forever, never flips to Connected

You paste the token, the app shows the spinner, and nothing happens — no error banner, no timeout, just an indefinite "Connecting…" state. Open the panel; the token row is still OFFLINE.

This is almost always Android battery optimisation closing the app's network sockets the instant the screen turns off — sometimes even before. Samsung's One UI is the worst offender, but Xiaomi MIUI, Oppo ColorOS, and even stock Android on some devices can behave the same way. The agent opens a socket, Android closes it, the agent retries, Android closes it again — a loop you cannot see from the panel.

Fix — set the app to Unrestricted:

  1. Open Settings → Apps → Nodetonet → Battery (exact path varies by manufacturer).
  2. Choose Unrestricted (Samsung One UI) or Don't optimise (Pixel / stock Android).
  3. On Xiaomi / MIUI: also enable Autostart under Settings → Apps → Autostart, and long-press the app in the recents list to lock it.
  4. On Oppo / ColorOS: go to Settings → Battery → Energy Saver → find Nodetonet → set to None.
  5. Force-stop the app, re-open it, and paste the token again.

After these steps the app should flip to Connected within two or three seconds. Lock the phone, wait ten minutes, come back — it should still read Connected. You can also watch the ONLINE / OFFLINE heartbeat in the panel to confirm the keepalives are arriving continuously.

2 · Token says ONLINE but proxy connections refuse

This one is sneakier. The token row in your panel is green, the device model shows correctly, but when you actually try to use the proxy you get connection refused, ECONNRESET, or a 502 error.

The WebSocket the phone opens to our edge servers is outbound — the phone dials out to us, so it works fine behind even very aggressive carrier NAT. The problem is what happens next: when a request arrives through the proxy, the edge has to push data back to the phone over that same WebSocket, and the phone then opens a new outbound connection to the target site. If the carrier blocks specific destination ports — many European MVNOs throttle anything that is not port 80 or 443 — that second hop fails silently, and you see a refusal even though the device shows ONLINE.

The one-minute carrier test: switch the phone to a normal Wi-Fi network, wait five seconds for the agent to reconnect, then retry the same proxy request. If it works on Wi-Fi but fails on mobile data, the carrier is the problem — not the agent or the panel.

Fix options:

3 · Connection drops every few minutes

The token cycles ONLINE → OFFLINE → ONLINE on a roughly 6–15 minute schedule. The agent reconnects on its own, but every drop kills in-flight requests through the proxy and breaks any sticky session that was pinned to that device.

This is Android Doze mode. Once a device has been screen-off and stationary for a short period, the OS aggressively suspends background network activity. The agent's WebSocket keepalives stop arriving, our edge times the connection out (the default grace window is 90 seconds), the token flips to OFFLINE. Eventually the phone wakes briefly on a maintenance window, the agent reconnects, and the cycle repeats.

Doze is intentional behaviour — Android does it to extend battery life — so you have to explicitly opt the app out.

Fix — request the battery whitelist from inside the app:

  1. Open the Nodetonet app and go to Settings → Run in background.
  2. Tap Request battery whitelist.
  3. Android will show a system dialog: "Allow Nodetonet to always run in the background?" — tap Allow.
  4. This must be done by a human; no app can bypass the system prompt silently.

Once the whitelist is granted, Doze leaves the agent's process alone. Verify by watching the Last seen column in /tokens after the phone has sat idle for an hour — it should still read "just now" rather than showing a stale timestamp.

4 · IP changes automatically every 10–12 minutes

You are getting traffic through the device, but the public IP rotates on its own every ten to twelve minutes — even though you have not asked for it. This surfaces as broken sticky sessions, unexpected geo shifts, or clients complaining that their session keeps invalidating.

Two sub-causes are common:

For rotating use cases this behaviour is desirable — see when to use rotating mobile proxies. For sticky use cases, pin a session by appending -session-XXXX to the proxy username and ensure the token group TTL is longer than your session's expected lifetime.

Advanced diagnostics

Reading the agent log on-device

The Nodetonet app writes a brief in-app log accessible from Settings → Logs. Connection attempts, keepalive failures, and reconnect events all appear there. If you see rapid-fire reconnect cycles (connect → close → connect repeating every few seconds), battery optimisation is the culprit. If you see successful connects followed by a long silence and then a reconnect, Doze is the culprit.

Checking the panel's device status

The panel's /tokens page shows the device model, last-seen timestamp, and current IP. If the last-seen timestamp is jumping by roughly 90 seconds every time the agent reconnects, the edge is timing out the WebSocket — that means keepalives are not getting through (Doze or battery kill). If last-seen is stable but proxy requests still fail, the issue is carrier-side port filtering (Section 2).

Geo / carrier mismatch

If you are using geo-targeting username modifiers (for example targeting a specific carrier like Turkcell or a city like Istanbul) but the device does not match those criteria, your request will fail to route. Make sure the device's SIM card actually belongs to the carrier or country you are requesting, or remove the modifier to let the platform pick any available device.

When to contact support

If you have worked through all four sections above and the device still misbehaves, collect the following before reaching out — it will make diagnosis much faster:

Reach us at support@nodetonet.com, on Discord at discord.gg/nodetonet, or on X at x.com/nodetonet. If you prefer to read first, our support flow guide explains how tickets are triaged and what speeds resolution up.

What to explore next

Frequently asked questions

Why does the Android agent keep disconnecting?
The most common cause is Android Doze mode or battery optimisation closing the app's background network activity when the screen is off. Grant the app the battery whitelist permission (Settings → Run in background → Request battery whitelist) and set battery usage to Unrestricted in the Android app settings. See Section 1 and Section 3 of this guide for manufacturer-specific paths.
The token shows ONLINE but proxy requests fail — what is wrong?
An ONLINE token means the WebSocket from the phone to our edge is alive, but the second hop — the phone connecting to the target site — may be blocked by your carrier on that port. Run the Wi-Fi test: if the same proxy works on Wi-Fi but not on mobile data, the carrier is filtering the port. Switch to HTTP/HTTPS on port 80 or 443, or contact support to be moved to an unfiltered edge port.
How do I stop the Android agent from being killed by the OS?
Three settings cover most devices: (1) set battery to Unrestricted in Android app settings, (2) enable Autostart on Xiaomi/MIUI, and (3) request the battery whitelist from inside the Nodetonet app under Settings → Run in background. On Samsung, also lock the app in the recent-apps list. These together prevent both battery optimisation and Doze mode from killing the agent.
Why does the proxy IP keep changing every 10–12 minutes?
This is almost always a rotating sticky TTL configured on the token group. When the TTL (often 600–720 seconds) expires, the group picks a new device and IP. Open the token group settings in the panel and increase the TTL, or append -session-XXXX to your proxy username to pin a sticky session independently. See our guide on token groups for configuration details.
My phone model shows wrong in the panel — is the agent broken?
No. The device model is sent by the agent at connection time and cached in the panel. If the model field is empty or shows a placeholder, it usually means the agent connected before the panel had the latest version of the device-info lookup. Force-stopping and reopening the agent triggers a fresh model announcement. If the token still shows a wrong model after that, contact support with the token slug.
Does the Android agent work on Chinese-brand phones like Xiaomi, Oppo or Huawei?
Yes, but these manufacturers apply the most aggressive battery optimisations and background kill policies. On Xiaomi/MIUI you must enable Autostart and lock the app in the recent-apps list in addition to the standard battery whitelist. On Huawei/EMUI, check Settings → Battery → Launch for Nodetonet and set it to Manage manually with all toggles on. The in-app log under Settings → Logs will confirm once the agent is staying connected through screen-off periods.
N

Nodetonet Team

Building Nodetonet — a prepaid proxy + tunneling platform that replaces ngrok, Cloudflared and a residential proxy provider with a single panel.

Related posts