Thought I'd drop a reply in here to update.
After much to'ing and fro'ing using my two existing ESP8266's, I decided to purchase two new ones. The news is that the two new ESP8266's worked perfectly first time with the process of erase_flash, write_flash, rshell, REPL - without seeing the dreaded error above.
So all I can think of is that there may be a hardware issue re flashing MicroPython to older (2.5-3 yr old) ESP8266's. That's all I can think of.
Error when flashing ESP32 - Testing if ubinascii.unhexlify exists ...
-
- Posts: 23
- Joined: Mon Feb 11, 2019 12:16 am
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Error when flashing ESP32 - Testing if ubinascii.unhexlify exists ...
Some ESP8266 boards require special esptool args. I have found the following -fm values to work on some hardware:
esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --verify --flash_size=8m -fm qio 0 build/firmware-combined.bin
esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --verify --flash_size=detect -fm dout 0 build/firmware-combined.bin
esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --verify --flash_size=8m -fm qio 0 build/firmware-combined.bin
esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --verify --flash_size=detect -fm dout 0 build/firmware-combined.bin
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Error when flashing ESP32 - Testing if ubinascii.unhexlify exists ...
I cannot tell if anybody has asked that yet, but which type, version and flash size are the ESP8266 boards that fail?
-
- Posts: 23
- Joined: Mon Feb 11, 2019 12:16 am
Re: Error when flashing ESP32 - Testing if ubinascii.unhexlify exists ...
Thanks for the suggestion pythoncoder; tried these and alas, still the same results when I try to run rshell.pythoncoder wrote: ↑Mon Feb 18, 2019 2:01 pmSome ESP8266 boards require special esptool args. I have found the following -fm values to work on some hardware:
esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --verify --flash_size=8m -fm qio 0 build/firmware-combined.bin
esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --verify --flash_size=detect -fm dout 0 build/firmware-combined.bin
One is a Wemos Pro Mini - and the write flash gives this...
Code: Select all
esptool.py --port /dev/cu.SLAB_USBtoUART --baud 115200 write_flash --verify --flash_size=detect -fm dout 0 Desktop/esp8266-20190125-v1.10.bin
esptool.py v2.6
Serial port /dev/cu.SLAB_USBtoUART
Connecting........_
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: 5c:cf:7f:d9:60:45
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 16MB
Flash params set to 0x0390
Compressed 615388 bytes to 399928...
Wrote 615388 bytes (399928 compressed) at 0x00000000 in 35.2 seconds (effective 140.0 kbit/s)...
Hash of data verified.
Leaving...
Verifying just-written flash...
(This option is deprecated, flash contents are now always read back after flashing.)
Flash params set to 0x0390
Verifying 0x963dc (615388) bytes @ 0x00000000 in flash against Desktop/esp8266-20190125-v1.10.bin...
-- verify OK (digest matched)
Hard resetting via RTS pin...
john@Mac-82:~$
Code: Select all
esptool.py --port /dev/cu.SLAB_USBtoUART --baud 115200 write_flash --verify --flash_size=detect -fm dout 0 Desktop/esp8266-20190125-v1.10.bin
esptool.py v2.6
Serial port /dev/cu.SLAB_USBtoUART
Connecting........_
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: 5c:cf:7f:39:d4:60
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0340
Compressed 615388 bytes to 399928...
Wrote 615388 bytes (399928 compressed) at 0x00000000 in 35.3 seconds (effective 139.5 kbit/s)...
Hash of data verified.
Leaving...
Verifying just-written flash...
(This option is deprecated, flash contents are now always read back after flashing.)
Flash params set to 0x0340
Verifying 0x963dc (615388) bytes @ 0x00000000 in flash against Desktop/esp8266-20190125-v1.10.bin...
-- verify OK (digest matched)
Hard resetting via RTS pin...
Re: Error when flashing ESP32 - Testing if ubinascii.unhexlify exists ...
On the Wemos Pro mini, you could to set the flash size during loading to 4 MByte, since Micropython does not support more. There is a method for that, but it's not part of the standard procedure.
-
- Posts: 23
- Joined: Mon Feb 11, 2019 12:16 am
Re: Error when flashing ESP32 - Testing if ubinascii.unhexlify exists ...
Thanks Robert... so would the syntax for this be...
Code: Select all
esptool.py --port /dev/cu.SLAB_USBtoUART --baud 115200 write_flash --verify --flash_size=4000 -fm dout 0 Desktop/esp8266-20190125-v1.10.bin
Re: Error when flashing ESP32 - Testing if ubinascii.unhexlify exists ...
It's
--flash_size 4MB
--flash_size 4MB
-
- Posts: 23
- Joined: Mon Feb 11, 2019 12:16 am
Re: Error when flashing ESP32 - Testing if ubinascii.unhexlify exists ...
Hey Robert... I owe you a beer! or wine! or gin!
Well, well well... would you believe it... this command...
...actually worked on the Wemos D1 Mini Pro AND on the NodeMCu!!!!!esptool.py --port /dev/cu.SLAB_USBtoUART --baud 115200 write_flash --verify --flash_size=4MB -fm dout 0 Desktop/esp8266-20190125-v1.10.bin
After all this... posts on loads of forums, dozens of attempts... and it comes down to '4MB'
Thanks a million Robert, much appreciated sir. I now have two additional ESP8266's I need to put to good use.
On to trying to get the temp and humidity data extracted from data packets on the SONOFF TH10 I've just bought... life's one great challenge for us eh