slow WiFi connect

GKCS

Member
Licensed User
Longtime User
I just run into a wired issue with one WiFi router TL-WR702N

There is one WiFi router, one LED display connected via cable LAN and fixed IP
Android device is connected to this router via WiFi, IP is set via DHCP

The Android WiFi-connect to the WiFi by SSID works without problems at normal speed

Now using the Network Library 1.21, connecting to the LED display via

LED.Initialize("LED")
LED.Connect(IP,port_tmp, 500) ' IP=192.168.0.50 Port=1000

takes around 12 sec. to fire the corresponding

Sub LED_Connected (Successful As Boolean)


Using a normal Windows based Netbook (instead of the Android) to connect via WiFi, all works as expected without delay.

Using Android with another WiFi Router from Netgear with same configuration and same code, all works like a charm and the event is fired immediately.


What can cause this long delay with one specific Android / WiFi Router combination?

Maybe somebody has some ideas about?

Thanks a lot for any help

Gerry
 

GKCS

Member
Licensed User
Longtime User
Log File

Hi Erel,

Connect to NetGear Router, all works as expected

B4X:
GC_EXPLICIT freed 113K, 55% free 2554K/5575K, external 716K/1038K, paused 40ms
GC_EXPLICIT freed 175K, 52% free 2857K/5831K, external 716K/1038K, paused 55ms
GC_CONCURRENT freed 666K, 56% free 2678K/5959K, external 818K/1038K, paused 0ms+5ms
>>>>> Initialize Connection
GC_CONCURRENT freed 519K, 56% free 2641K/5959K, external 767K/1038K, paused 0ms+0ms
>>>>> Connection established
GC_EXPLICIT freed 263K, 52% free 2807K/5767K, external 716K/1038K, paused 45ms
GC_CONCURRENT freed 475K, 56% free 2664K/5959K, external 767K/1038K, paused 0ms+5ms
>>>>> Initialize Connection
>>>>> Connection established
GC_CONCURRENT freed 478K, 56% free 2652K/5959K, external 767K/1038K, paused 0ms+10ms


Connect to a TP-Link Router, I have the delay of around 12 sec. between the
>>>>> Initialize Connection
and
>>>>> Connection established
and as I can see in the LOG, there happens much more between ....
The code is absolutely identical, I only changed the WiFi Router ....
After the 12 sec. delay, data are send out as expected without any error

B4X:
Displayed gkcs.led/.main: +1s260ms
java.net.UnknownHostException: time.windows.com
   at java.net.InetAddress.lookupHostByName(InetAddress.java:506)
   at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
   at java.net.InetAddress.getByName(InetAddress.java:325)
   at com.android.settings.AutotimeService.getLocalClockOffset(AutotimeService.java:108)
   at com.android.settings.AutotimeService.access$200(AutotimeService.java:16)
   at com.android.settings.AutotimeService$1.run(AutotimeService.java:50)
   at java.lang.Thread.run(Thread.java:1019)
GC_EXPLICIT freed 86K, 52% free 2626K/5379K, external 716K/1038K, paused 40ms
GC_CONCURRENT freed 561K, 55% free 2706K/5959K, external 767K/1038K, paused 0ms+0ms
>>>>> Initialize Connection
--->in for getLocalClockOffset times:1
java.net.UnknownHostException: time.windows.com
   at java.net.InetAddress.lookupHostByName(InetAddress.java:497)
   at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
   at java.net.InetAddress.getByName(InetAddress.java:325)
   at com.android.settings.AutotimeService.getLocalClockOffset(AutotimeService.java:108)
   at com.android.settings.AutotimeService.access$200(AutotimeService.java:16)
   at com.android.settings.AutotimeService$1.run(AutotimeService.java:50)
   at java.lang.Thread.run(Thread.java:1019)
GC_EXPLICIT freed 70K, 54% free 2661K/5703K, external 716K/1038K, paused 50ms
--->in for getLocalClockOffset times:2
java.net.UnknownHostException: time.windows.com
   at java.net.InetAddress.lookupHostByName(InetAddress.java:497)
   at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
   at java.net.InetAddress.getByName(InetAddress.java:325)
   at com.android.settings.AutotimeService.getLocalClockOffset(AutotimeService.java:108)
   at com.android.settings.AutotimeService.access$200(AutotimeService.java:16)
   at com.android.settings.AutotimeService$1.run(AutotimeService.java:50)
   at java.lang.Thread.run(Thread.java:1019)
GC_EXPLICIT freed 74K, 52% free 2809K/5831K, external 716K/1038K, paused 55ms
>>>>> Connection established
--->in for getLocalClockOffset times:3
GC_CONCURRENT freed 429K, 56% free 2668K/5959K, external 767K/1038K, paused 0ms+5ms

Ok, I see the "java.net.UnknownHostException: time.windows.com", but honestly, it don't tell me a lot about the real issue. What does this exactly mean and what is the reason for this?

The configuration of both WiFi Routers is the same. When I use a normal Windows based Netbook and run my software there, all works perfect ....


Thanks a lot for your help

Gerry
 
Upvote 0

GKCS

Member
Licensed User
Longtime User
WiFi

Hello Erel,

yes, I think you are right. Anyway, it seems to be a very special hardware issue. All tested WiFi routers BESIDES this single one work perfect. So I assume the problem is based on the reouter itself.
BTW. I just found a very small WiFi to RS233 device server hardware. Works perfect with your lib .... and a great'n easy way to add real RS232 functionallity to any Android device.

Many thanks for your time

Gerry
 
Upvote 0
Top