• Hi Guys,

    Just curious if anyone can reproduce this problem. I noticed that when I flashed my 512K boards (specifically an ESP-01, and several ESP-201s), that they did not execute wifi.save(), and thus when restarted did not automatically connect to the network. The network parameters were blank/null.

    I went BACK and tried v86 -- my kind of "standard" -- that always works, and after v91. Both work fine. However, I was using the following method:

    esptool.py  --port /dev/ttyUSB0 --baud 115200 write_flash 0 espruino_1v91_esp8266_combined_512.bin
    

    After I was able to use wifi.save() normally, and the boards reconnected normally on startup. However after some experimentation I discovered that if I use for example:

    esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash \
      --flash_freq 40m --flash_mode qio --flash_size 4m \
      0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin
      0x7C000 esp_init_data_default.bin 0x7E000 blank.bin
    

    on v91 then it does NOT save any wifi configuration when I do wifi.save().

    As v92 does not have the "espruino_1v92_esp8266_combined_512.bin" file, its impossible to test between the two methods.

    I'm curious if anyone else can confirm this, or if perhaps its a problem with my setup. I have not tested if this problem exists on my 4MB flash boards at this point.

    Thanks :)
    -hfc.

  • hi @hungryforcodes,

    check http://www.espruino.com/binaries/ for file espruino_1v92_esp8266_combined_512.bin

  • tested this images on a ESP8266 12 board

    var wifi = require("Wifi");
    wifi.connect("xxx", {password:"xxx"}, function(ap){ 
       console.log("connected"); 
      wifi.save()
    });
    

    result after reset

    >rllœž|Œlà|Œlìb|Ž‚ì’r’bŒbŒònnžlnnœâìbpŒŽlrlrlpònà‚lbnâ|ŒŽbŒònnîlŒŽl`nnl`nrŽ’’n’’l`pònàrŒœœâàbnâ|쎎ŽbŒònnîl`nnl`nrŽ’’nŽlpònàrŒœœâàìlbnâ|ŒŽŒbŒònnîl`nnl`nrŽ’’n‚l`r’’n‚l`rlŒŒnœŒònnžŒžâŒrnnnŒlŒbŽlì’lì’’‚ŒŽlll~rlì’lllnœâŒl’lllì’lŒnàŽnì’n~ŒŒllà€bìŒllpb‚br‚Œìl`nlŽpŒìl`bl`l’’nžnŒ’ânlž|bll`rlŒâì‚nì’r‚òn|ìlŒl`Œâr’lŒþ
    
         _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v92 Copyright 2016 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:512/512, manuf 0xe0 chip 0x4016
    >require("Wifi").getIP();
    ={
      "ip": "192.168.194.121",
      "netmask": "255.255.255.0",
      "gw": "192.168.194.1",
      "mac": "5c:cf:7f:c1:12:0b"
     }
    > 
    

    so it works

  • Hi @hungryforcodes, I have the same issue.
    I will test the suggest of @MaBe today, if it works will post it here the results.

    I am testing with ESP8266-01 doesn't work and with node MCU, works fine.

    Regards,
    Fabiano

  • Good to know that in previous versions it works, if the issue persist I have alternatives.

  • @MaBe great! Thank you :) I'll try your suggestion too and report back :)

  • @MaBe @Fabiano-Gomes So just to report it did work on my ESP-01. I was able to flash it using the espruino_1v92_esp8266_combined_512.bin file. And after wifi.save() worked correctly.

    Interestingly though both v92 and v91 combined files put my ESP-201 into a constant restart mode where the blue light on it flashed continuously. I downgraded to v86 and it works fine, so I'll use that for these remaining boards. Espytool said it autodetected 8m of flash, which would suggest that the ESP-201 is not a 512KB board as the spec suggests, but rather a 1MB board.

    Either way, maybe we should include the espruino_1v92_esp8266_combined_512.bin file by default in the v92 distribution?

    Just curious why this way preserves the wifi.save() functionality, and the more complex way does not?

    Anyways thanks guys! :)

  • Great, thanks for your feedback.

    you could erase flash before flashing new files

    esptool.py --port /dev/ttyUSB0 --baud 115200 erase_flash
    

    This is exactly what is achieved when using a combined file :)

  • Yes those were in the instructions and I followed them :) I will try again with the ESP-01 (I have a few coming in anyways), as I did that with the ESP-201 and had a negative result.

  • @MaBe So a quick update -- the ESP-201 is supposed to come with only 4mbit flash, and this is even supported by many photos online (at least I guess of early chips), but mine for whatever reason have 8mbit parts (maybe they ran out at the factory of the 4mbit flash? Who knows). This is what caused the problem. So I guess you can never assume anything in the ESP world :P

    So I did erase the flash and use the following as per the README (adjusted for 8mbit flash):

    esptool.py --port [/dev/ttyUSB0|COM1] --baud 115200 write_flash \
      --flash_freq 40m --flash_mode qio --flash_size 8m \
      0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin 
      0xFC000 esp_init_data_default.bin 0xFE000 blank.bin
    

    and now it works, and thus no need for the combined file. Anyways so if anyone else has an ESP-201 board and is having problems flashing, please check the part size for the flash.

    -hfc

  • Good to know - thanks

  • Is this still an issue with latest firmware? If so, what are the instructions for avoiding? I believe I am having same issue with the esp8266 in the sonoff

  • let esptool.py figure out your flash size

    esptool.py --port "$COMPORT" --baud 460800 flash_id
    
      Manufacturer: e0
      Device: 4016
      Detected flash size: 4MB
    

    W25Q40BV ( 4 Mega Bits / 512K Byte ) = ID 4013h
    W25Q80BV ( 8 Mega Bits / 1 Mega Byte ) = ID 4014h
    W25Q16BV ( 16 Mega Bits / 2 Mega Bytes ) = ID 4015h
    W25Q32BV ( 32 Mega Bits / 4 Mega Bytes ) = ID 4016h
    W25Q64CV ( 64 Mega bits / 8 Mega Bytes ) = ID 4017h

  • Thank you @MaBe

    This worked for me (leaving off the flash size, and using bin locations for larger chip:

    python "MYPATH\esptool.py" --port COM4 --baud 115200 write_flash --flash_freq 40m --flash_mode qio 0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin 0xFC000 esp_init_data_default.bin 0xFE000 blank.bin
    
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Problems with V92 and wifi.save() on ESP8266 512K Flash Boards?

Posted by Avatar for hungryforcodes @hungryforcodes

Actions