Bug? B4A Bridge WiFi connection error

Alessandro71

Well-Known Member
Licensed User
Longtime User
I don't think it's a B4A Bridge bug, but I haven't yet tracked down the root cause.
Every now and then (looks like after some time of inactivity), the WiFi connection fails, as if the Bridge is not listening, while it really is.
The connection succeed again after turning off and back on the WiFi on the phone.
The IP is not changed.
The phone is a Samsung model which I use only for development, with no other apps installaed, no antivirus or personal firewall either.
Just writing here to track the issue and see if someone else has met the same behavior.
 

agraham

Expert
Licensed User
Longtime User
It won't be a B4A Bridge bug. What are the exact symtons - " the WiFi connection fails" is not helpful.
Is B4A Bridge connected to the IDE when the failure occurs?
Does B4A Bridge say it is "waiting for connections" when the failure occurs?
If connected to the IDE what does the status bar at the bottom left say when the failure occurs?

Perhaps your phone is doing some battery saving tricks after a period of inactivity.
 

Alessandro71

Well-Known Member
Licensed User
Longtime User
I agree it's not a B4A Bridge bug, and you're right I was scarce in details.
By "the WiFi connection fails" I mean "I press F2 in the IDE and the connection fails with after a timeout with "The IP address is most probably incorrect" error"
The IP is correct and it's the same shown on B4A Bridge.
Bridge status is "Waiting for connections"
Since it's not connected to the IDE, there is a "B4A Bridge: Disconnected" message in the status bar.
A toggle of the WiFi widget on the phone and a new F2 keypress restores ordinary working conditions.

That "battery saving tricks" hint may be something to investigate upon.
 

agraham

Expert
Licensed User
Longtime User
So the B4A Bridge wasn't connected to the IDE before you pressed F2 to connect.

Once the B4A Bridge is connected does it stay connected? It should as B4A Bridge has a heartbeat (top right on the device screen) which should keep it connected. If it does stay connected then it looks like some power saving on the device is kicking in while it is idle and there is no network activity.

I have a Remdi Note 9 Pro and on occasion, even though the B4A Bridge icon is shown in the notification area, it doesn't connect until I bring B4A Bridge to the foreground which I attribute to power saving measures. Some Xaoimi and Redmi devices are renowned for their aggressive power saving activities by killing apparently inactive processes. Thisparticular device used to kill B4A Bridge entirely removing the icon fom the notification area after a period of inactivity but after an update it seems that is still disables B4A Bridge but now leaves the icon in the notification area which I guess is a bug that the update introduced. The trouble is that it is hard to see what the devices are doing on occasion as the background workings are pretty opaque to the user on Android and differ from manufacturer to manufacturer,
 
Top