Saving Wifi Config Foobars Everything

Posted on
  • I am running espruino 1v95.173 on a NODEMCU board.

    I can connect to a WiFi AP like this (Per the docs)...

    var wifi = require("Wifi");
    wifi.connect("my-ssid", {password:"my-pwd"}, function(err){
      console.log("connected? err=", err, "info=", wifi.getIP());
    });
    wifi.stopAP();
    

    However the moment I add wifi.save() and reboot, the 8266 gets stuck in what looks like a reboot loop and barfs all over the screen. This forces me to reflash...


    1 Attachment

    • Espruino_Web_IDE.jpg
  • I am running espruino 1v95.173 on a NODEMCU board.

    Looks like you build your own, what kind of flash commands do you use?

  • esptool.py --port /dev/tty.SLAB_USBtoUART --baud 115200 write_flash   --flash_freq 80m --flash_mode qio --flash_size 32m   0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin
    

    Should I be flashing it differently?

  • This is ok for a flash map 4MB:512/512, as if you have a 4MB you can use the 4MB

    First run erase_flash to start from a clean base

    esptool.py --port /dev/tty.SLAB_USBtoUART --baud 115200 erase_flash 
    

    and than try again write_flash

  • Thanks for the response. After erasing the flash and re-flashing Espruino the board goes right into a reboot loop. Now I can't get it to stop. I tried it again with the same result.

  • Is espruino_esp8266_user1.bin a file you build ?

    If Yes -I recommend to flash the official 4MB bin file from download.

  • This is really odd. I can flash micropython, but if I flash espruino it just goes into a reboot loop (I think it's a reboot loop).

  • I erased the flash again and used the files you linked with this command...

    esptool.py --port /dev/tty.SLAB_USBtoUART --baud 115200 write_flash   --flash_freq 40m --flash_mode qio --flash_size 4m   0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin
    

    I am getting the same result.

  • So I should have been running this...

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

    This got the board working again.
    It still goes nuts and I have to re-flash when I run wifi.save() and reboot.
    I am not sure if this is a good idea or not, but I just removed the wifi.save() and moved the wifi connect to the onInit function and it works on reboot. Is there something wrong with doing this?

    Thanks for all of your help by the way!

  • moved the wifi connect to the onInit function and it works on reboot

    Sure, this is a possible workaround.

    Please share the Espruino startup screen and the text output after wifi.save()

    | |_ ___ ___ _ ||___ ___
    | |_ -| . | _| | | | | . |
    |
    || || |_|||_|_|

          |_| http://espruino.com
    

    1v95 Copyright 2017 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 4MB:1024/1024, manuf 0xe0 chip 0x4016

  • Hmm, I have two that work, but have also had issues. Not sure whether there was a pattern with combined vs non

  • if Flash map 4MB:512/512 and chip 0x4016 use this flash command from this link

    http://forum.espruino.com/conversations/­314732/#14021236

  • Here are my screens...


    2 Attachments

    • pre_restart.png
    • post_restart.png
  • Using the flash command from the other post you linked to worked. Shouldn't the readme file that you get when you download the firmware be updated with this command?

    Is it the 4MB-c1 that makes it work? If so, how?

  • Yes, of course, see the new version of the REAMDE.txt

    Is wifi.save() no working for you?

  • Yes it is working now. After I used this...

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

    ...it started working.

    One difference is that I had to change the baud from 460800 to 115200.

    Thank you so much for your help. I'm still not sure how this fixed the wifi.save() issue.

  • As you have a 4016 chip which is 4MB of size, you can try those files:

    http://www.espruino.com/binaries/espruin­o_1v95_esp8266_4mb/

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

  • Thank you. I am using the 4MB binaries.

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

Saving Wifi Config Foobars Everything

Posted by Avatar for calebbrewer @calebbrewer

Actions