wifi connection regression in 1v95?

Posted on
  • After flashing my ESP8266's, I do (ccharacters enclosed in <> are nonprinting chars - that's how hTerm represents them when you copy/paste):

    var wifi = require("Wifi");<\r><\n>
    wifi.connect("TwilightZone", {password: "ThePassword"}, function(err){if(err)console.log(err);el­se console.log("connected!");})<\r><\n>

    Then once it prints connected, I do wifi.save() and power cycle the ESP8266 and see if it has an IP with wifi.getIP().

    Under 1.94 this works on my WeMos D1 Mini.

    Under 1.95 it does not.

    When I give the command to connect, and it triggers the callback, instead of "connected", I get:
    <\r><27>[Jconnected!<\r><\n>
    (where <27> is ascii char code 27 aka 0x1B).

    Note the extra CR, non-printing char, open bracket, and capitol J.

    But it gets an IP and seems to work - until power cycle.

    After powercycle, it does not come back, and I cannot connect to that network again (haven't tested other networks) until I reflash the ESP8266.

    Are other people seeing this behavior?

  • It takes some seconds to connect the AP

    >require('ESP8266').reboot();
    =undefined
    >
     ets Jan  8 2013,rst cause:2, boot mode:(3,6)
    load 0x40100000, len 2408, room 16
    tail 8
    chksum 0xe5
    load 0x3ffe8000, len 776, room 0
    tail 8
    chksum 0x84
    load 0x3ffe8310, len 632, room 0
    tail 8
    chksum 0xd8
    csum 0xd8
    2nd boot version : 1.6
      SPI Speed      : 80MHz
      SPI Mode       : QIO
      SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
    jump to run user1 @ 1000
    âìnìròn|ìll`ârlþ
     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v95.3493 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
    >require('Wifi').getIP();
    ={
      "ip": "0.0.0.0",
      "netmask": "0.0.0.0",
      "gw": "0.0.0.0",
      "mac": "5c:cf:7f:c1:12:0b"
     }
    >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"
     }
    > 
    
  • Steps I do to have a working wifi after reboot.

    get official zip for 1v95, unzip and change to directory espruino_1v95_esp8266_4mb

    list of files:

    1122 15 Dez 12:59 README_flash.txt
    4096 15 Dez 12:59 blank.bin
    3856 15 Dez 12:59 boot_v1.6.bin
    128 15 Dez 12:59 esp_init_data_default.bin
    509332 15 Dez 12:59 espruino_esp8266_user1.bin
    509332 15 Dez 12:59 espruino_esp8266_user2.bin
    2961 15 Dez 12:59 wiflash.sh

    first erase

    esptool.py --port $COMPORT --baud 115200 erase_flash

    than flash

    esptool.py --port /dev/cu.usbserial --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

    result after flash

         _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| 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
    

    now setup wifi, save, reboot and check

    // setup wifi and save when connected
    var Wifi = require('Wifi');
    SSID='SSID';SSIDPASS='SSIDPASS';
     Wifi.connect(SSID, {password:SSIDPASS}, function(err){
       if (err === null){
         console.log('Connected to AP');
         console.log(Wifi.getIP());
         Wifi.stopAP();
         Wifi.save();
       }
     });
    
    // reboot
    require('ESP8266').reboot();
    =undefined
    >
     ets Jan  8 2013,rst cause:2, boot mode:(3,6)
    load 0x40100000, len 2408, room 16
    tail 8
    chksum 0xe5
    load 0x3ffe8000, len 776, room 0
    tail 8
    chksum 0x84
    load 0x3ffe8310, len 632, room 0
    tail 8
    chksum 0xd8
    csum 0xd8
    2nd boot version : 1.6
      SPI Speed      : 80MHz
      SPI Mode       : QIO
      SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
    jump to run user1 @ 1000
    
     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| 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
    
    >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"
     }
    > 
    
    
  • Wifi.save() is broken on espruino_1v95_esp8266_4mb_combined_4096.­bin

    created issue #1309

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

wifi connection regression in 1v95?

Posted by Avatar for DrAzzy @DrAzzy

Actions