WX ESP8266 Module Name and Simple IDE Discovery
Shawna
Posts: 508
I can't seem to change the WX modules name from the settings page and have it retained after a power cycle. I have tried this on 2 different modules with 2 different versions of firmware. I am selecting the "Save to Flash" button after I change the name. The Device will show up in SimpleIDE with the new name, but when I cycle the power the name defaults back to its factory name. Is this a known bug or am I missing something?
Also, is there a way to disable the wx module from showing up in the SimpleIDE port selection drop-down menu? I thought I had read about this in another thread, but I can't seem to find it. We have 3 of these in the house and I have many more little projects I would like to add them too. But accidentally programming the wrong propeller would cause headaches. Especially when I'm not the only one in the house using SimpleIDE.
Thanks
Shawn A.
Also, is there a way to disable the wx module from showing up in the SimpleIDE port selection drop-down menu? I thought I had read about this in another thread, but I can't seem to find it. We have 3 of these in the house and I have many more little projects I would like to add them too. But accidentally programming the wrong propeller would cause headaches. Especially when I'm not the only one in the house using SimpleIDE.
Thanks
Shawn A.
Comments
I have written updated firmware code that will hide this device so you don't see it. Several times I have grabbed the wrong device and wiped out a working unit in action.
I guess if I would have changed the name that might not have happened.
I also have code that will allow the WX module to send out UDP packets for applications that just want to pickup so information being sent out.
Mike
Mike,
I would be interested in hearing how you modified the code to do that. Did you modify files in the Parallax-ESP folder?
Shawn
The hard part was upgrading the ESP8266 SDK library from 2.0.0 to 2.2.1. This is not a necessary step but I like using the current SDK.
The files I changed where:
html/settings.html
html/wifi/wifi.html
parallax/sscp-settings.c
parallax/sscp-tcp.c
parallax/sscp.c
parallax/sscp.h
parallax/user_main.c
I created a new program to except the udp functions:
parallax/sscp-udp.c
The sscp program parses all the commands and routes them to the correct program for processing.
The problem with hiding the device is if you don't know what IP it's at you can't bring up the web page to change it back. If you have access to the router or you know what IP it was at when you disabled it that's not a big problem.
I can give you the OTA file that you could load on the WiFi-WX board. You should however have the current OTA file to change it back if you need to.
Mike
Could I get the OTA file and the SDK files before they are compiled. I would like to look through the files and learn how you changed them. I have modified the ESP8266 that I use with password protected config pages. I would like to take your version and add password protection. I don't really care what the module name is as long as I can shut off its discovery. The version that I use is older, I used Clock Loops thread to recompile the SDK files after I modified them. I couldn't figure out how to modify anything but the HTML pages.
https://forums.parallax.com/discussion/169250/parallaxwx-esp8266-raspberrypi-debian-esp-open-sdk-simpleide-openspin-proploader-devel/p1
It would be nice if Parallax would update their firmware for the module. I personally think that device discovery, udp and the ability to change the ports would be huge and make the device more functional. I also think that password protection for the config pages would be nice, I realize that code space is limited and it would be hard to implement a full fledged version with password protection.
Thanks
Shawn
user_main.c is changed to not call initDiscovery();
A parameter was added to flashConfig to check whether to call it or not.
The config parameter I added was cmd-loader.
In Parallax change:
user_main.c
sscp-settings.c
In esp-link-stuff
config.c
config.h
In html/wifi
wifi.html
Mike
I also added IP address support so you can program what IP address, Subnet, DNS, and gateway you want the WiFi module to use.
I also coded some Arduino code that will emulate some of the basic functions of the WiFi module except for an HTTP server and file system. It will however connect to a remote host and send and receive data so you can build your code and then slip in a $3.00 ESP-01 module in its place.
Mike
Hey I am starting to try and dig into this, are you sure the discover enable/disable is in the wifi.html code, I don't seem to see it there? I could be totally missing it though, or did you put it in the settings.html code?
Thanks
Shawn
Here is the settings page.
Mike
The WX Module not remembering its name, is a bug that Clock Loop mentioned in the thread I posted above. He also mentions how to hard code the name into the module.
Mike, I would like to try your code but I'm not sure if the software I use to make the builds is compatible with what you use. I don't want to brick the module.
When I follow the tutorial Clock Loop wrote it creates a folder called ESP8266_NONOS_SDK-2.1.0-18-g61248.
I think it uses xtensa-lx106-elf to compile or build or make the ota file. Forgive me for my ignorance, I know enough about this to break stuff. Correct me if that is not how it works.
Anyways you said above..............
So my version of the SDK falls between those 2 you mentioned.
This makes me think I should be able to just swap files and build away and it shouldn't turn into the smallest brick in my house?
Is that enough info and do you think I'm good to try building it?
Thanks
Shawn
Thanks
Shawn
I replaced this section of code from you sscp-setting file.
And replaced it with this code which I copied out of the sscp-setting file Build from the original Parallax Firmware
I ran a make clean and make command and it built with no errors and created an .ota file.
I am tempted to flash the ESP after supper with the new file.
Thanks
Shawn
Mike
I don't need it ............ but that is a nice feature!
So I flashed the OTA file and everything worked as expected. Now I won't be blasting my sons devices, and he won't be blasting mine.
I might also add that the the device needs to be rebooted for the "Hide from Loader" setting to take place. Which isn't a big deal, but if you don't know it, one might think its not working.
Very Nice!!!!!
Thanks Mike
I will probably go back and see if I can make your original file work, I would like to be able to make the IP Address Static. Right now I just reserve an ip address in my router with the MAC address of the ESP8266 module, which works fine.
UDP is pretty cool, I don't fully know how to use it. I do have a wiznet running as a WOL server. I originally wanted to do this with the ESP8266 module, but then found out you cannot do WOL over wifi.
The next holy grail for me is being able to change the HTTP/TCP port. Port 80 is fine but it would be nice to be able to change it. Awhile back I tried to find where the port was set in the code, but was unsuccessful. I might have found it though when I was looking through the files you modified.
Thanks
Shawn
You could change that line and rebuild the code otherwise a parameter could be added to the web page to have it's value.
The problem is that the automatic DNS server used when you connect with your phone the first time as STA, it will return just HTTP://esp.nonet. The port number is not part of the return request information.
Mike
Ok, so you kind of lost me after your last post. I've finally had a little time to do some investigating.
Should that say AP instead of STA?
I tried following the "httpdInit()" function from file to file and it looks like it does change the port number.
So then I did a search for "esp.nonet" and I found it in this file "captdns.c".
This is the description at the top of the"captdns.c" file.
From your previous post and what I could understand in the program, it does look like changing the port would work, as long as AP mode is not being used.
Is that a correct statement?
When I re-flash my ESP module and it reboots, it retains the wifi network and password. So I'm thinking that after the initial wifi network is setup in AP mode, I should be able to set the module to STA mode. Then I should be able to reflash the module with the new port number and everything should be good.
Does that sound right, or am I going to brick it?
Once I have changed the port number, if I want to change the network that the wifi module is connected too, it may need to be flashed back to port 80 before changing networks.
Any thoughts?
Thanks
Shawn
Because you are changing the port number to something other than 80 they will not see the home page and instead will see page not found request from there browser. To fix that they would have to use HTTP:8080//esp.nonet where 8080 is the new port number you used for your device. Not a big deal since you are hiding it anyway.
Mike
Thanks Mike
I have found the answer through trial and error.
If the module is in STA mode, and the modules name is changed from the settings page, it will not retain the name after a power cycle even if you click on the "save to flash" button.
If the module is in STA+AP or AP mode, changing the name and clicking the "save to flash" button will save it to flash. When the power is cycled, it will boot back up with the expected name.
The OTA file I was using was downloaded today from the product page for the WX ESP8266.
Shawn
1) Retain modules name after power cycle.
This is easy, put the device into either AP or STA+AP mode from the Network page.
Then goto the Settings page and change the name of the Module at the top of the page and click "Save to Flash". When the module is power cycled, it should have the new name.
2) Hide Module from SimpleIDE.
This one is a little trickier, it requires modifying files in the Parallax-ESP folder and then re-compiling the folder to create a new OTA firmware file.
Mike was kind enough to include the files necessary for adding the discovery mode to the Parallax-ESP build. The files and locations that need to be added to the Parallax-ESP folder are as follows.
In Parallax change:
user_main.c
sscp-settings.c
In esp-link-stuff:
config.c
config.h
In html:
settings.html
Once these files have been added/modified, it is time to re-compile the Parallax-ESP folder.
There are a couple of ways to do this, I used Clock Loop's guide to recompile the Parallax-ESP folder.
https://forums.parallax.com/discussion/169250/parallaxwx-esp8266-raspberrypi-debian-esp-open-sdk-simpleide-openspin-proploader-devel/p1
Mike mentioned the use of Azure to recompile the folder.
Also there is a guide on the Parallax-ESP Github site.
https://github.com/parallaxinc/Parallax-ESP
Once the new firmware has been re-compiled and flashed into the module, navigate to the settings.html page, there should be a setting labeled "Hide from Loader:". Change this setting to Yes and click the "Save to Flash" button, this will hide the module from SimpleIDE. The module does need to be reset in-order for the change to take place.
Attached are the files needed to hide the module. I modified the sscp-setting.c file because I was getting compile errors using Clock Loop's guide.
@iseries
Mike, thanks again for taking the time to add the "Hide from Loader" setting to the WX Module, and sharing the files with the rest of us.
Shawn