Go Down

Topic: Client connection issue (Read 914 times) previous topic - next topic

newhobby

I'm using the standard example code SimpleWebServerWifi.
The board does connect to my wifi and I can use my browser to connect the the board to confirm that it is working fine.
This is the serial monitor response:
Code: [Select]

new client
GET / HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Accept-Language: en-US
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Accept-Encoding: gzip, deflate
Host: 192.168.1.76
Connection: Keep-Alive

client disonnected

The problem I'm having is when I try to connect with my Android browser. It works a couple times, but most of the times it doesn't work.
I have a Galaxy 6 Edge+.
This is what I get when connecting with my phone:
Code: [Select]

new client


So, something is going on with the connection and to troubleshoot, I implemented a connection timeout.
Code: [Select]

      if (millis()-client_timeout>2000) client.stop();

Now, my connection gets disconnected instead of kept waiting from data.
Code: [Select]

new client
client disonnected

So, I went ahead and checked for client.available() and that's where I'm having the issue.
It is always 0 when the issue happens.
Does anyone have any insight on why this could happen?



newhobby

Some more troubleshooting.
Connection seems to be really stable and good if I use my browser.
No connection problems at all.
I tried different ports and nothing makes connection from my phone any stable.
So, I tried switching to 4G and setup port forwarding on my router.
Connection is very good now and no problems at all.
Does anyone know why the connection just seems to hang if my phone is on the same wifi as the MKR1000?

Go Up