ParallaxESP WX8266 programming help.
Clock Loop
Posts: 2,069
I am in the process of documenting modern updated info on the ParallaxWX-8266 device.
I want to help others program it and even program ANY esp8266 with parallax's firmware...
It will be included in my other thread about it and compiling various parallax tools.
I am using the Parallax-Esp data at the github site:
https://github.com/parallaxinc/Parallax-ESP
And the problem I am having is the flash scripts in the release directory don't work.
The new version of the python programming program doesn't work with it.
And I do not know what version I SHOULD use.
So I downloaded the compiled result of the Parallax-Esp directory, and booted windows.
I used the esp8266 tool to do the programming, but it didn't work.
When I connect putty to the serial output of the 8266 module, it shows this output at baud: 74880
The script that is old and dosen't work anymore is:
I modified it to work with the new python programmer code, but it still dosen't work.
I tried another tool.. same result.
I want to help others program it and even program ANY esp8266 with parallax's firmware...
It will be included in my other thread about it and compiling various parallax tools.
I am using the Parallax-Esp data at the github site:
https://github.com/parallaxinc/Parallax-ESP
And the problem I am having is the flash scripts in the release directory don't work.
The new version of the python programming program doesn't work with it.
And I do not know what version I SHOULD use.
So I downloaded the compiled result of the Parallax-Esp directory, and booted windows.
I used the esp8266 tool to do the programming, but it didn't work.
When I connect putty to the serial output of the 8266 module, it shows this output at baud: 74880
2nd boot version : 1.6 SPI Speed : 40MHz SPI Mode : QIO SPI Flash Size & Map: 4Mbit(256KB+256KB) no GPIO select! jump to run user1 @ 1000 rf_cal[0] !=0x05,is 0xFF ets Jan 8 2013,rst cause:1, boot mode:(3,7) load 0x40100000, len 2408, room 16 tail 8 chksum 0xe5 load 0x3ffe8000, len 776, room 0 tail 8 chksum 0x84 load 0x3ffe8310, len 632, room 0 tail 8 chksum 0xd8 csum 0xd8
The script that is old and dosen't work anymore is:
# flash the firmware # and clear out all settings and the user flash filesystem PORT=/dev/ttyUSB0 if [ ! -z $1 ] then PORT=$1 fi echo Using port $PORT BAUD=115200 BOARD=none # none, ck, nodemcu, wifio FLASH_SIZE=2M FLASH_BLOCK_SIZE=1024 FLASH_SPEED=80 FLASH_INTERFACE=qio BOOT_LOADER=0x000000 USER1_IMAGE=0x001000 USER_SETTINGS1=0x07E000 USER_SETTINGS2=0x07F000 if [ $FLASH_SIZE = 1M ]; then WIFI_SETTINGS1=0x0FC000 WIFI_SETTINGS2=0x0FE000 WIFI_SETTINGS3=0x0FA000 elif [ $FLASH_SIZE = 2M ]; then WIFI_SETTINGS1=0x1FC000 WIFI_SETTINGS2=0x1FE000 WIFI_SETTINGS3=0x1FA000 elif [ $FLASH_SIZE = 4M ]; then WIFI_SETTINGS1=0x3FC000 WIFI_SETTINGS2=0x3FE000 WIFI_SETTINGS3=0x3FA000 else echo Unsupported flash size $FLASH_SIZE exit 1 fi #flash filesystem base FFS_BASE=0x100000 esptool \ -cp $PORT \ -cd $BOARD \ -cb $BAUD \ -bz $FLASH_SIZE \ -bf $FLASH_SPEED \ -bm $FLASH_INTERFACE \ -ca $BOOT_LOADER -cf boot_v1.6.bin \ -ca $USER1_IMAGE -cf httpd.user1.bin \ -ca $USER_SETTINGS1 -cf blank.bin \ -ca $USER_SETTINGS2 -cf blank.bin \ -ca $WIFI_SETTINGS1 -cf esp_init_data_default.bin \ -ca $WIFI_SETTINGS2 -cf blank.bin \ -ca $WIFI_SETTINGS3 -cf blank.bin \ -ca $FFS_BASE -cf blank.bin
I modified it to work with the new python programmer code, but it still dosen't work.
# flash the firmware # and clear out all settings and the user flash filesystem PORT=/dev/ttyUSB0 if [ ! -z $1 ] then PORT=$1 fi echo Using port $PORT BAUD=115200 BOARD=auto # none, ck, nodemcu, wifio FLASH_SIZE=4m #FLASH_SIZE=detect FLASH_BLOCK_SIZE=1024 FLASH_SPEED=80m FLASH_INTERFACE=qio BOOT_LOADER=0x000000 USER1_IMAGE=0x001000 USER_SETTINGS1=0x07E000 USER_SETTINGS2=0x07F000 if [ $FLASH_SIZE = 1m ]; then WIFI_SETTINGS1=0x0FC000 WIFI_SETTINGS2=0x0FE000 WIFI_SETTINGS3=0x0FA000 elif [ $FLASH_SIZE = 2m ]; then WIFI_SETTINGS1=0x1FC000 WIFI_SETTINGS2=0x1FE000 WIFI_SETTINGS3=0x1FA000 elif [ $FLASH_SIZE = 4m ]; then WIFI_SETTINGS1=0x3FC000 WIFI_SETTINGS2=0x3FE000 WIFI_SETTINGS3=0x3FA000 else echo Unsupported flash size $FLASH_SIZE exit 1 fi #flash filesystem base FFS_BASE=0x100000 esptool.py --port $PORT --baud $BAUD write_flash --flash_size $FLASH_SIZE --flash_freq $FLASH_SPEED --flash_mode $FLASH_INTERFACE \ $BOOT_LOADER ../esp_iot_sdk_v2.0.0.p1/bin/boot_v1.6.bin $USER1_IMAGE ../build/httpd.user1.bin \ $USER_SETTINGS1 ../esp_iot_sdk_v2.0.0.p1/bin/blank.bin \ $USER_SETTINGS2 ../esp_iot_sdk_v2.0.0.p1/bin/blank.bin \ $WIFI_SETTINGS1 ../esp_iot_sdk_v2.0.0.p1/bin/esp_init_data_default.bin \ $WIFI_SETTINGS2 ../esp_iot_sdk_v2.0.0.p1/bin/blank.bin \ $WIFI_SETTINGS3 ../esp_iot_sdk_v2.0.0.p1/bin/blank.bin \ $FFS_BASE ../esp_iot_sdk_v2.0.0.p1/bin/blank.bin
I tried another tool.. same result.
Comments
https://forums.parallax.com/discussion/comment/1391937/#Comment_1391937
I need the "helper" program.
https://github.com/igrr/esptool-ck
Testing now.
This is why I am documenting it all.
The little details are missing from instructions.
But the Parallax-ESP program still doesn't work on my ParallaWX8266 module...
And now i can't even get a serial output because i can't use the custom baud in linux???
The old output in windows at the odd baud, showed the module as the wrong size??? I am not sure if that is wrong yet.. So that might be part of the issue.
I had to copy all the files it wants into the release folder. You can find them in ../build and ../esp_iot_sdk_v2.0.0.p1
You also need to change the command esptool to ./esptool in each .sh file.
also copy esptool.py and the esptool into the release folder.
esptool.py is the programmer tool --> https://github.com/espressif/esptool
esptool is actually the esphelper too -->https://github.com/igrr/esptool-ck
Nice linux, nice.
Forced to use standard baud rates.... Same hardware lets custom baud in windozer....
So who knows how to do custom baud in linux?
I guess the only option I have is to rip out my current outdoor install of another working ParallaxEsp.
Then do a .bin backup and then restore that bin to the other module.
Then I can look at the various bins that get uploaded to the esp and figure out why its not working.
Theres a handy python tool someone made that will split your whole bin into the proper sizes and even show you what the whole bin looks like..
Ok, get to hackin..
https://microcontrollerelectronics.com/decoding-an-esp8266-firmware-image/
You must use a fairly large 3.3v regulator with these.
I initially used a lm1117 800ma LDO regulator, and it caused the problem I have now, a bad upload to an esp using the OTA web interface.
I switched to a regulator capable of 3A, no problems after that. But I now have to upload a good image, and don't have a OTA interface.
Now I must do it serially.
Are you still having issues programming the devices?
There's an updated programming doc I could share, which takes into account the module flash size change that happened about a year ago.
The intention is to push github with some parallax-esp code and doc updates in January. If the programming docs would help you sooner, I could prepare something shareable over the weekend.
Yea it won't run the parallax AP when I program. And I haven't yet pulled out my second module to image the bin. (because its keeping my greenhouse from freezing)
So I can't run the bin analysis to figure out WTF...
Do you mean some of the parallax modules have different size flash?
Oh, that is need info, if I want to help others, who knows what they may have...
Which changes how you program it... currently the sh file has 4m for the size.
You saying this changed?
I am adding all this info to my thread in the forum accessories area, anything helps.
From what I recall... The modules were originally 4MB, then became 2MB at some point (supplier change).
But then I think the supplier had some "supply" issues, and was shipping 2MB modules as 4MB
There's a command in this pdf which determines your module size, so you can then use the correct programming command.
This memory size is only really relevant because the module itself will always look for the user-settings (esp_init_data_default.bin) at an address relevant to the max module size. Ie. at 0x1fc000 or 0x3fc000. So that bin needs to be stored in the right place, depending on Flash size, or I think the module may appear bricked.
I'm pretty sure I have a step-by-step on installing python somewhere, but I won't be in that office until late Saturday or Sunday.
THATS IT!
Thanks for the info....
Reading the flash, and recovering it to another esp DOSEN'T WORK. (perhaps some mac address issues) Writing this .bin file to another esp dosen't work.
....grinding.....
Thanks VON!
I put 4m not 4M
If I had payed attention to the script output i could have figured out that was the issue.
SO EVERYONE PAY ATTENTION TO THE FLASH_SIZE=4M setting.
NOT FLASH_SIZE=2M or FLASH_SIZE=4m
Its FLASH_SIZE=4M
Now I can finish the INFO, thanks guys.
I thought that you did too. But if the user purposely writes the user.bin file to the wrong place, things go wonky.
It won't run the AP, and just dumps data out the DO port.
So perhaps my typo isn't the only problem.
But this WILL get the AP working.
https://github.com/igrr/esptool-ck
Why even use it? The user must download ANOTHER program that can simply be eliminated by typing out the instructions...
Perhaps the esptool.py program didn't have things it now does.
So the script currently does
But should do
Im testing right now by rewriting the script.
It WORKS NOW!
NEW flash-all.sh
It looks like we can.
We were using only Python esptool with BadgeWX. It sure works fine nowadays.
Could well be it was updated since your issues some years earlier when PESP began, as you suspected!
(I think the install of python/esptool was pretty text-book. Either-way, I documented the install & usage steps at the time, so will share that here on the weekend, if there was anything funky involved)
Auto mode for Flash size will not work, because the addresses for the "chunks" need to be set, so the user MUST set the size.
(unless you first run the $ esptool.py flash_id and are able to dump the size output to a variable)
I don't know how to do all that....
It would be nice to support all sizes, then Parallax can be like the BORG and assimilate all.
I think someone better than I should rewite the script because esptool.py works great alone!
But for now, the new flash-all.sh works. I suppose they should all get re-written.
I also have found that flashing at speeds above 115200 might be flakey.
I programmed one ParallaxESP at 921600, and it seemed to program fine, most of the time.
But sometimes, I would connect to the AP and it would just drop dead, and the blue light would go out, and i would get a crash dump output from the DBG pin.
I think this is from the fast programming speed.
Perhaps for the re-written default scripts, it should still be the slower speed like it is now, and let the techs up the speed, since they know it might be problematic.
(like I have found)