• Following the instructions for the Espruino WiFi to update the ESP8266 firmware I seem to have bricked my board.

    The ESP8266.py command

    esptool.py --port COM13 --baud 115200 write_flash --flash_mode dio 0 AiThinker_ESP8266_DIO_32M_32M_20160615_V­1.5.4.bin
    esptool.py v3.0
    Serial port COM13
    Detecting chip type... ESP8266
    Chip is ESP8266EX
    Features: WiFi
    Crystal is 26MHz
    MAC: 5c:cf:7f:c0:f4:1f
    Uploading stub...

    A fatal error occurred: Invalid head of packet (0x13)

    I can no longer get an AT prompt, the IDE reports 'Prompt not detected - upload failed. Trying to recover...' when I try

    digitalWrite(A14,0); // power off
    digitalWrite(A13,0); // boot mode
    digitalWrite(A14,1); // power on
    Serial2.setup(115200, { rx: A3, tx : A2 });
    Serial2.on('data', function(d) { USB.write(d); });
    USB.on('data', function(d) { Serial2.write(d); });

    Is there a way to reflash the ESP8266 without soldering? Or should I just get a new one?
    I would also recommend adding a warning to the http://www.espruino.com/WiFi page letting people know this is a risk.

  • First I would try to start the Espruino Wifi without any code: http://www.espruino.com/Troubleshooting#­on-espruino-pico-wifi

  • Sorry about this - I'm looking into it now. I can reproduce here, and I'm pretty sure we'll be able to get the ESP8266 firmware fixed without soldering - this did work in the past so it's likely some change either in esptool or the Espruino firmware.

  • Actually I missed a bit : Prompt not detected - upload failed

    This is actually what you'd expect, since we're turning Espruino into a 'dumb' USB-Serial converter.

    I'm going to have a go at making a 'firmware updater' that you can just upload to the WiFi board to let the board itself do the updates. It should be a lot easier and more reliable

  • Ok, quick update - I now have a proof of concept webpage you can go to which will update the ESP8266 firmware on an Espruino WiFi via Web Serial.

    I'll tidy it up tomorrow, get it online, and that should fix your issues - I'll also change the firmware update page to link to that code

  • Ok, all you need to do now is:

    • Go to https://www.espruino.com/ide/
    • You may need to Ctrl-click the refresh button to get it to fully reload the newest version
    • Click Settings, Flasher
    • Down the bottom, under 'Espruino WiFi Firmware' you can now click a button to update the firmware

    It takes a while, but it should sort your board out just fine

  • I have several Espruino-WiFi devices that I did not update for a while... So I gave it a shot.

    I reloaded from link in post #6 - In environment #1 (macOS Catalina Version 10.15.6 (19G2021) and Chrome Version 86.0.4240.193 (Official Build) (x86_64) - and see Web App, v0.74.3 in IDE console. Navigating to Settings - Flasher I can see the new section for updating Espruino-Wifi / ESP8266 Firmware.

    Attempting to connect, I can though not see my Espruino-WiFi devices in the list. The only thing I see in the list is Web Bluetooth.

    Going to a different Mac - environment #2, same macOS and Chrome browser version (and same USB cable), but with the 'old' Espruino Chrome App, 0.74.1 installed from a while ago, I can connect... and see 1v99 on the Espruino-WiFi. I can also connect to my other devices: PICO, Original and BLE (Puck, Pixl, Bangle,...).

    I updated successfully one Espruino-WiFi device to 2v08 in environment #2 / Chrome App.

    Back on in environment #1, I still can not see my now 2v08-updated Espruino-WiFi devices in the list. The only thing I see in the list is Web Bluetooth.

    Conclusion (in my context):

    • Chrome App IDE: connects but does has not Espruino-Wifi/ESP8266 update feature.
    • Chrome Web IDE: has new Espruino-Wifi/ESP8266 update feature, but cannot connect.


    What do I miss here - in relation to post #6 - to be able to use the Web IDE?

  • You have to enable "Experimental Web Platform features" to get access to web serial. Go to chrome://flags/#enable-experimental-web-­platform-features to do it.

    BTW, right now I can't connect to the Espruino Wifi with https://www.espruino.com/ide/ 0.74.3, I get this error in the console: Serial> ERROR: TypeError: Failed to execute 'open' on 'SerialPort': required member baudRate is undefined.
    (Win10, same behaviour in latest Edge and Chrome and Vivaldi. IIRC it did work at least in some of them)

  • Thanks @AkosLukacs - I was on Chrome 85 and it looks like Chrome Version 86 has broken Web Serial (they randomly renamed baudrate to baudRate!).

    I have now fixed it, so if you update then the Web IDE 0.74.4 should work fine.

    Just a note that if something isn't listed and you click on 'Status' in the connection Window, it'll try and tell you why - in this case mentioning you need to flip the flag in chrome://flags/#enable-experimental-web-­platform-features

  • It's working now, thanks!

  • @AkosLukacs...

    the provided link chrome://flags/#enable-experimental-web-­platform-features to set the flag has some odd ball chars in it when copy-pasting it from posts... (%2C%AC - chrome://flags/#enable-experimental-web-­%C2%ADplatform-features).

    I had already set that flag based on some error indication I got when trying to connect... but it did not help... now I should know why... :-)

    With this flag chrome://flags/#enable-experimental-web-­platform-features set and this link https://www.espruino.com/ide/ opened in the Chrome browser (with shift-reload to get Web App, v0.74.4 ), it...

    ...still does not work! (even though I got a step further: status turns green and no (short0 orange error message).

    2 Attachments

    • EspruinoWifi=_Update_WebIDE_v0.74.4.png
    • EspruinoWifi_Update_Errors.png
  • I missed all this activity, I just tried again with the latest esptool.py and it seems to have worked. I had forgotten to make the ESP_RAM_BLOCK and FLASH_WRITE_SIZE to 0x100 changes previously. I also added the routing code to an onInit() so that the signal bridge was always in place.

    Thanks as always Gordon, stay safe.

  • Glad you got it sorted in the end @Stephen - I updated the docs as it seems forcing it not to upload its own bootloader to RAM really helps.

    @allObjects is it possible you'd put the Espruino WiFi into bootloader mode? It only needs to be in normal JS interpreter mode

  • No pretty sure it was in normal mode, I tried many times. I also upgraded another one without the x100 change and all went fine. It's a long shot but maybe my mobile phone was too close to it, the guys at esptool said these errors can be caused by electrical interfearance.

  • @Gordon,

    nope (was not in boot mode and also expected not to be in boot mode since Espruino acts as a link/bridge between ESP8266 updateder in IDE and ESP8266), *but* darn... the usb connection was at fault. After validation of the cable previously and getting same results, I grabbed an0ther cable in order to have it easier, and that other cable was faulty... :|

    With the initially used - tested - cable it works. ESP8266 software updated successfully from AT 0.40.0 SDK 1.3.0 2015 to AT SDK 1.5.4 2016

    And the final test using the Wifi module - connecting to site / page http://www.pur3.co.uk/hello.txt as described on https://www.espruino.com/WiFi page - works.

    Conclusion / lesson learned: never ever trust a usb cable that you not tested (yet) and tested again...

    Corollary: @Gordon('s code) is always right / never at fault! ;-)

    3 Attachments

    • Espruino_Web_IDE_Connection.png
    • Espruino-Wifi_ESP8266-versionInfo.png
    • Espruino-Wifi_ESP8266-uppdate.png
  • Great! Glad it worked for you!

    Those Micro USB cables are a nightmare. It seems everyone's got a dead one floating around somewhere!

  • ...for charging all the battery banks they (still) work great. Some battery banks come even with cables that have no data wires. So I now start to mark them with a tape around ends to not get caught again.

  • So I now start to mark them with a tape around ends to not get caught again.

    That's a good idea. I'm kicking myself I didn't do that 5 years ago now.

    However I'm sitting next to a crate of probably 100 Micro USB cables now - so in my case I should just chuck the dead ones :)

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

Updating ESP8266 firmware issue killed my Espruino WiFi

Posted by Avatar for Stephen @Stephen