Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Board doesn't connect with network on my router.
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Board doesn't connect with network on my router.

by Kitkate on Sun Jun 07, 2020 6:28 pm

Hi guys, i am using an esp32 on arduino ide to get data from feed using Adafruit IO library (Not the MQTT library). The program gets stuck in the while(io.status() < AIO_CONNECTED) loop. Upon adding Serial.print(io.statusTest()) in the the loop instead of the usual dot/full stop . It repeatedly displays Network Disconnected, after 2-3 minutes or so it changes to "Idle..Waiting for connect to take place" (something like that) and gets stuck there. This happens when i give the network credentials of my router. but if i test with my mobile's hotspot, then it works almost instantaneously. Any reason for that?

Kitkate
 
Posts: 4
Joined: Sun Jun 07, 2020 1:25 pm

Re: Board doesn't connect with network on my router.

by brubell on Mon Jun 08, 2020 10:54 am

If it works with your mobile hotspot but not your router, there's likely an issue with your network configuration. Do you have a proxy or firewall on your network?

brubell
 
Posts: 946
Joined: Fri Jul 17, 2015 10:33 pm

Re: Board doesn't connect with network on my router.

by Kitkate on Mon Jun 08, 2020 11:18 am

Not that I know of, and let me clarify that i was sharing my mobile data through the Hotspot. (and not the wifi from my home router).

Kitkate
 
Posts: 4
Joined: Sun Jun 07, 2020 1:25 pm

Re: Board doesn't connect with network on my router.

by brubell on Wed Jun 10, 2020 11:05 am

Are the libraries (Adafruit IO Arduino, Adafruit MQTT) on your arduino ide updated to the latest version?

brubell
 
Posts: 946
Joined: Fri Jul 17, 2015 10:33 pm

Re: Board doesn't connect with network on my router.

by Kitkate on Wed Jun 10, 2020 11:16 am

Yes, I recently downloaded them (about a week ago). Is there any wifi setting that may block the network, adafruit connection of my esp32. The irony is that wifi in itself works on my esp32. I have used another iot platform(blynk) through wifi.

Kitkate
 
Posts: 4
Joined: Sun Jun 07, 2020 1:25 pm

Re: Board doesn't connect with network on my router.

by Kitkate on Wed Jun 10, 2020 6:06 pm

Ok, so for some reason my arduino ide crashed on start up. But after debugging and reinstalling all my preferences, then adding wifi library and wifi station mode. It started to work all of a sudden. One more thing I did was to remove the config file and add the settings directly into the code.
The thing is that now it works almost 40% of the time, when it doesn't work it throws the error "idle, waiting for connect to be called".

Kitkate
 
Posts: 4
Joined: Sun Jun 07, 2020 1:25 pm

Re: Board doesn't connect with network on my router.

by Systembolaget on Sun Jun 14, 2020 9:55 am

Several ESP32 based boards have problems (re-)connecting reliably to WiFi routers. Often, the router is the problem according to GitHub ESP32 discussions. Also use of a powerline WiFi extender and mesh boxes cause all sorts of interferences, which is why first testing with "router-only" is essential. There are always three distinctive cases to handle in code:

1. The WiFi network is up and the Internet (for exemple Adafruit IO) can be reached
set-up <-> router UP + router <-> Internet UP

2. The WiFi network is up and the Internet cannot be reached (or not yet be reached)
set-up <-> router UP + router <-> Internet DOWN (for example, router reset/restart/uplug-replug means WiFi is spawned by the router near instantly, while the router may take up to three minutes to also connect to the ISP and thus Internet)

3. The WiFi network is down (and thus the Internet cannot be reached)
set-up <-> router DOWN + router <-> Internet DOWN

Systembolaget
 
Posts: 251
Joined: Wed Mar 08, 2017 1:01 pm

Please be positive and constructive with your questions and comments.