wifi settings on esp8266

Posted on
  • Hi, please forgive me for my bad english.

    I have several esp8266 running with espruino. All of them are running very well. But I'd like to permit to change the wifi settings over HTTP. I have one page (/) wher eI can put some fields like "ssid name", "ssid password". But I don't know how I can save these values in my program. I think that I have to change my program to get these value in memory, but I don't know if there is the good solution.

    Is someone have an idea ?

    Thanks.

  • For clarification, are you inquiring on how to dynamically save the 'ssid' and 'password' to memory after program start, and 'save()' from the WebIDE command line won't suffice?

    r/w the SD card perhaps? http://www.espruino.com/Internet#line=20­,20,39,46,67,79,91,108

  • Yes it is exactly that. But I don't have any sdcard connected to the esp. The link provided explain how to save data to an sdcard. I just want to save 4 parameters on memory:

    1 - default ssid in ad-hoc mod
    2 - default password
    3 - user ssid
    4 - user password

    If I use the code in link provided, is there a way to save the file in json format in memory of the esp ?

  • ESP8266_WifiUsage - wifi.save() - Wifi.save() (reference) may be the answer for you.

  • Hi @azer,

    something like this ?

    https://github.com/MaBecker/esp8266/blob­/master/Espruino/JoinWifi.js

    just as a starting point and don't expect to much .....

  • After receiving the 'new' wifi connection configuration information, reset the ESP8266, connect with the new configuration, and when it successfully connected, then execute the Wifi.save(), otherwise re-connect with the 'old' info and perform defined number of retries - all programmatically in js (AT commands, etc).

  • Thanks for all of that. I'll try it this week :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

wifi settings on esp8266

Posted by Avatar for azer @azer

Actions