Hi all,
I'm trying to use smart config to initialise my ESP32 based IoT devices and I'm hitting some strange problems. We have three wireless networks in the house - the main one is delivered through a TP-Link Archer C9 dual band router. This is supplemented by one delivered through a TP-Link MR3020 single band access point and there is a third sometimes turned on which is delivered through an old Netgear single band access point. They are on different SSIDs and all connected to the same LAN. Signal strength is good from all three in the place where I usually work.
The Archer C9 WLAN is my primary network - it is a modern device with beam-forming technology and delivers the best signal throughout the house. When I first started experimenting with smart config, I was working on that network and it simply didn't work at all - it hung at " sc: SC_STATUS_FINDING_CHANNEL" as others have reported here. Since there has been so many reports of this problem here, I simply gave up on smart config and started experimenting with one of the alternative solutions that relies on setting the ESP32 into AP mode.
Over the weekend, I was working on our boat and decided to have another go at smart config - it worked perfectly! This was on a network delivered through a TP-Link MR200 3G router. When I got back home, I tried it again on the primary house network - it failed again. I then switched my phone to the MR3020 based network and it worked perfectly. I switched the phone back to the Archer C9 based network, reset the ESP32 - and this time it worked fine. I have conducted many trial runs now and the pattern is this:
1) If the ESP32 has been powered down for more than a few minutes, smart config always fails on the Archer C9
2) Smart config always works on both the MR3020 and Netgear based WLANs
3) If smart config has been run successfully at least once on the MR3020 or Netgear, it will then work repeatedly on the TP-Link C9 with resets of the ESP32 in between
4) If smart config has been run successfully at least once on the MR3020 or Netgear, then the ESP32 can be powered down for several minutes and will still successfully run smart config to the C9 after it is powered up...
So, any suggestions? It is a much more elegant solution than dropping the ESP32 into AP mode and running a web service on it, but this is a product that I'm working on and I need a reliable solution!
TIA
Martin
Smart Config issues...
Re: Smart Config issues...
Your problem is really not new and at the same time very new.
Android and IOS will both try to get the fastest connection when connecting to WiFi AP.
Both in a multi-Band will connect to the fastest.
That said;
When close to an AP the 5Gig Hz will be faster/stronger and the Smart phone or tablet will connect to it at 5Gig Hz.
If you go a large distance from the AP the 2.4 will become the stronger of the two and they will connect to the 2.4Gig Hz.
The ESP32 will easily connect with hard coded AP credentials, because it has them already and can use the 2.4Gig band just fine.
SmartConfig is fairly simple.
The ESP32 goes into Promiscuous mode allowing it to look at any packet without being connected to any AP yet.
It watches for a specially formed UDP packet with the AP credentials, sent by the App on your phone/tablet.
Once received the connection is made.
Now for the problem.
Since the Smart Phone/tablet is on the wrong band the UDP packet is being transmitted on the 5Gig band and the ESP32 can't see it.
Until very recently, Android and IOS would let you select the band of choice. - Not anymore. -
Android dropped it in 7.0 and i'm not sure when IOS did it.
If you still have an earlier Android version;
in "settings"=>"wifi"=>"Advanced Settings"=>"Wi-Fi frequency band" simply select 2.4GHz instead of "Automatic" and the SmartConfig App will work on a mult-band router.
If your Android install is 7.0 you may be in a bit of a pickle.
There are only a few choices I have found so far myself;
It's really hard to sell a device that will give the user problems setting it up.
Option 4 may be our only possibility.
Really hoping Espressif comes up with it.
Android and IOS will both try to get the fastest connection when connecting to WiFi AP.
Both in a multi-Band will connect to the fastest.
That said;
When close to an AP the 5Gig Hz will be faster/stronger and the Smart phone or tablet will connect to it at 5Gig Hz.
If you go a large distance from the AP the 2.4 will become the stronger of the two and they will connect to the 2.4Gig Hz.
The ESP32 will easily connect with hard coded AP credentials, because it has them already and can use the 2.4Gig band just fine.
SmartConfig is fairly simple.
The ESP32 goes into Promiscuous mode allowing it to look at any packet without being connected to any AP yet.
It watches for a specially formed UDP packet with the AP credentials, sent by the App on your phone/tablet.
Once received the connection is made.
Now for the problem.
Since the Smart Phone/tablet is on the wrong band the UDP packet is being transmitted on the 5Gig band and the ESP32 can't see it.
Until very recently, Android and IOS would let you select the band of choice. - Not anymore. -
Android dropped it in 7.0 and i'm not sure when IOS did it.
If you still have an earlier Android version;
in "settings"=>"wifi"=>"Advanced Settings"=>"Wi-Fi frequency band" simply select 2.4GHz instead of "Automatic" and the SmartConfig App will work on a mult-band router.
If your Android install is 7.0 you may be in a bit of a pickle.
There are only a few choices I have found so far myself;
- 1 Some routers can be made to repeat everything they see on one band and repeat on the other. If your's allows this, its your fix.
2 Turn the 5Gig off on the AP and it will be forced to send the UDP on the 2.4 Gig band.
3 Find an App that will let you change bands before running the SmartConfig App on your phone/tablet.
4 Find a SDK function that performs option 3 and rewrite the SmartConfig App to do it automatically.
5 Write a sketch on another ESP32 that will act like the SmartConfig App on you phone/tablet and use it to configure WiFi.
6 Find an old tablet that only has 2.4G Hz and use it
It's really hard to sell a device that will give the user problems setting it up.
Option 4 may be our only possibility.
Really hoping Espressif comes up with it.
-
- Posts: 1
- Joined: Tue Apr 24, 2018 8:10 pm
Re: Smart Config issues...
Hi, I am also providing a production environment for smartconfig and have the exact same problem, can anyone at espressif advise if they are intending to develop smartconfig further and in particular resolve this issue with support for 5Gig Band WiFi?
Re: Smart Config issues...
ESP32 do not support to receive packets on 5GHz band. That means if router is 5GHz only, smartconfig will never succeed. If smart phone connects to 5G, Smart config works if the following conditions are satisfied:
1. The SSIDs of 2.4G and 5G are the same.
2. Update IDF to v3.2 which will be released later. The update will also be available later on IDF master branch. Please keep attention.
3. Update Android or IOS APP to v0.3.6.2 on the smart phone. And choose 'broadcast' on APP.
4. Make sure that the router allows to forward broadcast UDP packets.
5. For some routers, there should be another WiFi device which connects to 2.4G of the router.
6. Before the update of IDF is available, please disable 5G of the router and use 2.4G.
Hope it is useful for you.
1. The SSIDs of 2.4G and 5G are the same.
2. Update IDF to v3.2 which will be released later. The update will also be available later on IDF master branch. Please keep attention.
3. Update Android or IOS APP to v0.3.6.2 on the smart phone. And choose 'broadcast' on APP.
4. Make sure that the router allows to forward broadcast UDP packets.
5. For some routers, there should be another WiFi device which connects to 2.4G of the router.
6. Before the update of IDF is available, please disable 5G of the router and use 2.4G.
Hope it is useful for you.
Who is online
Users browsing this forum: Bing [Bot] and 81 guests