Restart to use Web IDE after Flash of ESP8266-01

Posted on
  • I have to restart my computer after I have flashed ESP8266-01, to use Espruino Web IDE,because it won't connect.

    Connected
    >
    Disconnected
    
    

    I use Mint 18.1 and chromium.
    I have tried to pull the USB cable, and log out, login.
    I can connect via GtkTerm without restart.

    Before christmas it worked allright.
    Anybody have the same behavior?

  • Yes. I get a similar thing with the esp32 and windows 10.

    I can connect with putty, but not the ide after a flash.

    So what I do is

    • flash
    • hit reset button on the board
    • connect with putty, then quit
    • connect via the ide

    Because this is a pain, I have the board set up to connect to wifi and use the ip address in the ide and connect via tcpip.

  • Even I only do a erase_flash without setting ESP in boot mode, it's the same.
    From the console in settings.

    conection ok

    Initialising Debugger
    Initialising Tour
    Initialising SettingsProfile
    Initialising HelpLinks
    Loaded code from storage.
    >>> Connecting...
    Set Slow Write = true
    [object Object]
    Connected [object Object]
    Received a prompt after sending newline... good!
    >>> Sending...
    ---> "\u0010console.log(\"<\",\"<<\",JSON.str­ingify(process.env),\">>\",\">\")\n"
    >>> Sent
    Got "< << {\"VERSION\":\"1v91.66\",\"BUILD_DATE\":­\"Mar  5 2017\",\"BUILD_TIME\":\"14:37:09\",\"GIT­_COMMIT\":\"567fee8447461adf4a57d7630192­9b3f63edb601\",\"BOARD\":\"ESP8266_BOARD­\",\"CHIP\":\"ESP8266\",\"CHIP_FAMILY\":­\"ESP8266\",\"FLASH\":0,\"RAM\":81920,\"­SERIAL\":\"18fe349d-47ca\",\"CONSOLE\":\­"Serial1\",\"EXPORTS\":{\"jsvLock\":1075­850320,\"jsvLockAgainSafe\":1075850372,\­"jsvUnLock\":1075850744,\"jsvSkipName\":­1075859352,\"jsvMathsOp\":1075864552,\"j­svMathsOpSkipNames\":1075866244,\"jsvNew­FromFloat\":1075857060,\"jsvNewFromInteg­er\":1075856960,\"jsvNewFromString\":107­5856620,\"jsvNewFromBool\":1075857028,\"­jsvGetFloat\":1075862368,\"jsvGetInteger­\":1075858848,\"jsvGetBool\":1075862728,­\"jspeiFindInScopes\":1075877572,\"jspRe­placeWith\":1075877292,\"jspeFunctionCal­l\":1075887616,\"jspGetNamedVariable\":1­075879416,\"jspGetNamedField\":107587986­0,\"jspGetVarNamedField\":1075879992,\"j­svNewWithFlags\":1075856360}} >> >\r\n>"
    Loading http://www.espruino.com/json/ESP8266_BOA­RD.json
    Device found (connectionId=1)
    [success] Connected to port /dev/ttyUSB0
    >>> Connected to port /dev/ttyUSB0
    Board JSON loaded
    Set Slow Write = true
    FIRMWARE: Current 1v91.66, Available 1v91
    

    conection lost

    Initialising Debugger
    Initialising Tour
    Initialising SettingsProfile
    Initialising HelpLinks
    Loaded code from storage.
    >>> Connecting...
    Set Slow Write = true
    [object Object]
    Connected [object Object]
    ERROR: RECEIVE ERROR: {"connectionId":1,"error":"device_lost"}­
    Disconnect callback...
    WARNING: [notify_warn] Disconnected
    >>> Disconnected
    ERROR: executeExpression called when not connected!
    
  • Not sure why it wouldn't be going - but I'm not sure much has changed in the IDE in the last few months. You could try manually loading an older IDE from GitHub and see if that fixes it, then you could git bisect to narrow down the problem (if there was one).

    I'm afraid it could just be something in a new version of Chrome though.

  • I'm getting this after flashing an ESP32:

    >>> Disconnected
    >>> Connecting...
    Set Slow Write = true
    [object Object]
    Connected [object Object]
    ERROR: RECEIVE ERROR: {"connectionId":2,"error":"overrun"}
    Disconnect callback...
    WARNING: [notify_warn] Disconnected
    >>> Disconnected
    ERROR: executeExpression called when not connected!
    >>> Connecting...
    Set Slow Write = true
    [object Object]
    Connected [object Object]
    Found a prompt... great!
    >>> Sending...
    ---> "\u0010console.log(\"<\",\"<<\",JSON.str­ingify(process.env),\">>\",\">\")\n"
    >>> Sent
    ERROR: RECEIVE ERROR: {"connectionId":3,"error":"overrun"}
    Disconnect callback...
    WARNING: [notify_warn] Disconnected
    >>> Disconnected
    WARNING: No result found - just got ""
    Device found (connectionId=3)
    [success] Connected to port COM3
    >>> Connected to port COM3
    

    If from the ide If I attempt disconnect/connect a few times, and then hit reset on the board, it finally connects.

  • If this only seems to be happening with ESP32/ESP8266 flashing tools, it might be worth filing a bug with them? Are you sure they're not still running in the background in some form?

    I imagine Windows 10 vs Linux problems are different, but on linux try running stty -a -F /dev/ttyACM0 before and after - it's possible that the communication port settings have got messed up somehow

  • Are you sure they're not still running in the background in some form?

    No - the serial port gets locked - you can't flash with a current ide connection. And the esptool.py script is closed before attempting to reconnect in the ide.

    Can you please explain what this means:
    ERROR: RECEIVE ERROR: {"connectionId":2,"error":"overrun"}

  • It's from here: https://github.com/espruino/EspruinoTool­s/blob/gh-pages/core/serial_chrome.js#L1­06

    which is straight from chrome. https://developer.chrome.com/apps/serial­#event-onReceiveError

    Chrome says overrun is:

    A character-buffer overrun has occurred. The next character is lost.

    So I guess you could try simply ignoring that particular error? I guess maybe Chrome recently added the reporting of it? Maybe it's just because the ESP8266/etc sent a whole bunch of data before it connected and so some data ended up getting dropped from the buffer?

  • That seems to be different to @Frida's problems though - I've never seen 'overrun' before.

  • Hi, not sure whether its related. I was running espruino on my nodemcu for several months with no issues. Several days ago i tried to updated the code. And got this:

    I use mac, SiLabsUSBDriverDisk driver.
    Tried different cables, different devices, updated drivers.
    Sometimes after flashing I see this weird characters, sometimes nothing, Espruino text wont appear.
    Any Ideas what might be an issue please ?

  • Those characters look like the baud rate is wrong. Check you have 115200 as the default for ide is 9600

  • Baud rate is 115200. Flashed with 115200 and ide is set to 115200.
    Tried on different pc with windows, there are no characters, but no espruino logo and default text, and I am not able to type anything in console.

    Tried around 5 cables and 3 nodemcu boards.
    After flashing, there are no errors in console. Everything as expected.

    Before flashing I erase flash.
    Press rst while holding flash.
    Then hold flash while connecting usb.

  • Hi @user73662, looks like there is no Espruino an this board.

    Lets have a look at the flash command you are using, please share.

  • @MaBe, Hi.

    here is the command:

    python esptool.py --port /dev/tty.SLAB_USBtoUART --baud 115200 write_flash --flash_freq 80m --flash_mode qio --flash_size 4MB 0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin 0x3FC000 esp_init_data_default.bin 0x3FE000 blank.bin
    

    here is ht result:

  • esptool.py call is correct for a 4MB board.

    please post the result of this call

    python esptool.py --port /dev/tty.SLAB_USBtoUART --baud 115200  flash_id
    
  • Device 4016 stands for a 4MB board

  • My problem was i had to use:
    --flash_mode dio instead of qio

  • dito on the --flash_mode dio

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

Restart to use Web IDE after Flash of ESP8266-01

Posted by Avatar for Frida @Frida

Actions