-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SmartConfig fails connection - appears not saving SSID #1100
Comments
UPDATE I renamed the esp32 folder and did full clone. It's working now |
Hi Mickey how are your doing? I am testing SmartConfig on ESP32 but have the problem you reported here. thanks in advance |
for it to reconnect automatically on boot, you have to read in the stored WiFi settings and this should offer a complete SmartConfig / WiFi skeleton i used WS8212 LEDs for the flasher and makes for too much code here. My approach to the flasher was to leave the ticker running and set a variable true or false to start and stop the LED.
|
hi Mickey, thanks for your code and your fast response, a little more complex, I have a question about *.h sources and another for variables in code. please have a look on them.
the part of code is:
Regards. DH |
1 the .h files are part of the espressif clone you did to setup arduino 2 put UpCount at top of your code near int WFstatus int UpCount = 0; |
sorry about that. I put that skeleton together fairly fast from other code. So Preferences preferences; declares the object "preferences" put this in top section of code below the .h declarations and before setup()
|
Thanks Mickey.
great code.!!👏
…On Mon, May 28, 2018 at 1:09 PM, Mickey ***@***.***> wrote:
sorry about that. I put that skeleton together fairly fast.
any time you see an . it's part of a Class.
ie preferences.getString(...);
So Preferences preferences; declares the object "preferences"
put this in top section of code
**```
// SSID storage
Preferences preferences; // declare class object
// END SSID storage
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1100 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Al18tlPigZ03xBPOlsq5_deVYyOcw5KFks5t3EtwgaJpZM4SBrcp>
.
|
Hi all, thank you again |
vinot You want to see what it can do? While it is running unplug your router and watch. Plug it back in and in about 40 seconds it will reconnect automatically and be back on line. |
hi Mickey definetly I'm going to spend the necessary time to understand all your code. We are developing a simple hardware (virtual feet) for VR and esp32 seems to be a good way, even it's more complex than others mcu, but also more powerful. thank you again |
not seeing your code, esp_system.h has got to be missing just add it to the top of your code in global space; ========== if you don't have wifi connected before a call to esp_read_mac() it will fail and the compiler will catch it. have wifi.mode set before esp_read_mac() and it should work if WiFi services are not setup several data areas are not accessible. SSID, PASS, MAC, INDEX etc... |
Hi Dr.mickeypop , I've used your code and it's really working fine but the problem now that sometimes in the code the ESP32 stuck in that message: DROWNPIN FIRED |
"DROWNPIN FIRED" is not in any of my code and just did a search of the SDK with no results. a couple of questions;
if you can, send it to; mickey ( user domain seperator ) (my domain)(the little point) com I'll give it a look if you want. Not having your code I am going to make a big assumption;
ESP8266 and ESP32 have very high impedance on their pins. One of two approaches fall here;
INPUT_PULLUP will turn on an internal pullup and stop the floating. |
Hi Dr.Mickeypop , |
sorry i forgot a way to call up mapping to a different AP after the initial setup. It started SmartConfig Mode if the credentials had not been set yet. Wifi was mapped using initSmartConfig(); just call that function any way you want, button press, condition etc... Once in SmartConfig mode just connect to an AP as before. Just remember the smartphone/tablet needs to be connected to the AP you are mapping it to. |
@mickeypop |
glad it helps |
@mickeypop Could you please create a pull request with your code? this is VERY helpful, but hard to find, this will help more people the same way that helped me too =) Thanks anyway |
@copercini if i could find out WHO to contact i would send it to be added to the examples |
@mickeypop |
theoretically yes but you would have to write your own library and sending software. SmartConfig was invented in 1993 by Texas Instruments to send a specially formatted packet by UDP to a network. Any device in promiscuous mode that recognizes the packet structure can be configured. This technique could be used for just about anything if the sending and receiving software was written. |
Well, Unfortunately I'm not good at programming. So, I will looking for another method. |
There are many examples on the web of using UDP to turn on LEDs, relays etc.... It's just that the SmartConfig was written with one purpose in mind though the method can be used elsewhere just not that library. Keep in mind; UDP sends by the MAC address of a device not the IP. Can you post more complete info on what you are tying to do? Would a simple blind web URL on the device work as well?
|
Thanks for Your Responses. Well, I want to make a "pairing/configuring" task on ESP32 with my smartphone. But not only configure SSID and PASWORD of WiFi but also some custom data and save it to ESP32. So, i dont have to "hardcoded" my program. So, my data will be like this:
I've done configuring SSID and PASSWORD using Your SmartConfig's Program. But what about the Custom data? But, for now I use another method, using database -> Google Firebase. So my program will be like this:
But, if someone know another robust method, I gladly to know that |
Wifimanager is a library that does that, look here : https://github.com/tzapu/WiFiManager#custom-parameters |
Hi Mickey NODEMCU:2:24: error: esp_system.h: No such file or directory #include "esp_system.h"
compilation terminated. exit status 1 Can you help me out |
the skeleton i posted is not ESP8266 friendly unfortunately. #include "esp_system.h" is specific to RTOS wrapper Arduino on the ESP8266 does not use the RTOS like the 32 does. If you look at the structure of the skeleton code an ESP8266 rewrite would require rewrite all preferences code to say SPIFFS and JSON also every ESP32 specific code would need replaced or removed. The wifi library is good however, i do several calls outside of the library to RTOS directly, bypassing the wifi library.
in order to test stored from changed credentials, i needed to read the credentials before re-storing over the same to save the life of the flash. It should be noted you can only re-write flash around 10,000 times before it trashes the flash permanently trashing the MCU. |
Hi Mickey |
Dexter-SSE in wifiInit(), i set WiFi.mode(WIFI_AP_STA); to read NVR before WiFi.begin(). Once you know wifi is up execute WiFi.mode(WIFI_STA); to disable AP mode. That should stop it and still leave the station connected. |
Hi Mickey |
Hi Mickey |
@sharmashrey48 simple check during boot |
@mickeypop sorry my bad, I missed that. It worked. Thank you so much for the code and thanks again for helping me out. Have a nice day :) |
Hello @mickeypop, I tried your sketch about SmartConfig (#1100 (comment)), as the one provided in the Arduino ESP 1.0.4 does not work on my network. The sketch compile is OK, but the connection does not occurs. I'm using the app provided by Espressif (Esptouch) on my iPhone to send the SSID/Pass to the ESP but I only got is:
I tried different method on Do you have any clue about what could be wrong?
I also notice that the sketch provided as
It is not the same error, but both seems related to Thanks! |
@christophepersoz Either your compile environment or your code have a conflict. One issue; the PATH to the library is not a typical arduino setup path for espressif RTOS. Go to https://github.com/me-no-dev/EspExceptionDecoder and install the EspExceptionDecoder in the tools folder as shown. Then cut and paste the BackTrace from the terminal output and it will show where your code has a conflict. It looks thru your ELF file to find what is going on. It has saved my bacon several times. |
Please don't hijack issues. Your problem is not the same as the OP. Open a new issue and follow the issue template. You MUST include a decoded backtrace. If you cannot get the exception decoder working, please open an issue in that repository. |
My apologies, I open a new issue here #3711 |
@mickeypop sorry to ask this so long after this was closed, but I'm trying to find the preferences file, where can I find it? You mention the espressif clone, which one? I'm looking at the arduino-esp32 repo and can't find it. |
Preferences is an arduino-esp32 included library. |
@johnwargo when you clone ESP32 from espressif the preferences library is included hope it helps |
@mickeypop thanks. |
hi @mickeypop how to expand smartconfig response? like some random string with mac and ip address. |
@Huzaifa-Ahmad55 if it is connected the leds change green for a few seconds then out, if failed red. in setup wifiInit() is called right before IPinfo() either way you get the IP and many other parameters or the failure notice |
Hardware:
Board: ESP32 Core Dev Module, Generic Modules, and ESP32-VROOM
Core Installation/update date: I do git update weekly, this update 2/10/18
IDE name: Arduino IDE, 1.8.5
Flash Frequency: 80Mhz
Upload Speed: 921600
Description:
I may have found what is failing, but not sure how to fix this.
Note the print statements between "SmartConfig done." and "Waiting for WiFi".
Verbose Log shows SSID: myplace was passed but appears not to be saving. This is reproduced on 4 different boards.
Reading NVR the password is stored correctly but SSID does not seem to be saved, more so its blank.
This seems to be the fault resulting in connection failure.
Like others; the "Waiting for WiFi" loop never exits with AUTH_FAIL.
Note i added 2 extra log statements to the _smartConfigCallback() for better info
BASIC demo sketch with just a few prints added (indented)
=== Verbose Log ==============
My modified WiFiSTAClass::_smartConfigCallback( )
The text was updated successfully, but these errors were encountered: