Avatar for Stephen

Stephen

Member since Apr 2017 • Last active Nov 2020
  • 2 conversations
  • 5 comments

Most recent activity

  • in Pico / Wifi / Original Espruino
    Avatar for Stephen

    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.

  • in Pico / Wifi / Original Espruino
    Avatar for Stephen

    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.

  • in Pico / Wifi / Original Espruino
    Avatar for Stephen

    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
    Connecting....
    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); });
    Serial1.setConsole();
    

    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.

  • in News
    Avatar for Stephen

    Waiting for mine to arrive from Amazon, 31st Aug :-)

  • in Pico / Wifi / Original Espruino
    Avatar for Stephen

    I have been doing some testing on net.connect and find it runs the callback before the connection is established (deliberately erroneous hostname and port in code). I can't then run a registered error event handler. This is counter to the documents that indicate that the callback is executed after the TCP connection is established. I would appreciate some validation that I am not doing anything wrong?

    There is also no way I can see to change the connect timeout, however if I use the AT commands I can catch the error.

    Output:

    **** STARTING ****
    WiFi Connected!
    ["AT+CIPSTART=0,\"TTCP\",\"weeso\",1888\­r\n"
    net client before callback {"type":0,"opt":{"host":"weeso","port":1­888},"sckt":1}
    net client callback {"type":0,"opt":{"host":"weeso","port":1­888},"sckt":1,"conn":true}
    net client disconnected {"type":0,"opt":{"host":"weeso","port":1­888},"conn":true} *** {"type":0,"opt":{"host":"weeso","port":1­888},"conn":true}
    net client disconnected {"type":0,"opt":{"host":"weeso","port":1­888},"conn":true} *** undefined
    net closed, had_error: false
    

    Code:

    var wifi = require("EspruinoWiFi");
    
    function onInit() {
      console.log("**** STARTING ****");
      wifi.connect(WIFI_NAME, WIFI_OPTIONS, function (err) {
        if (err) {
          console.log("WiFi Connection error: " + err);
          return;
        }
        console.log("WiFi Connected!");
        wifi.at.debug();
        var at = wifi.at;
        //at.cmd('AT+CIPSTART=0,"TCP","weeso",18­88\r\n', 10000, (cb) => {
        //  console.log('AT cb '+cb);
        //});
    
        var client = require("net").connect({host: "weeso", port: 1888}, function (skt) {
          console.log('net client callback ' + JSON.stringify(skt));
          //client.write('Hello');
          client.on('error', function (err) {
            console.log("net error ");
            console.log("Error: " + JSON.stringify(err));
          });
          client.on('data', function (data) {
            console.log("net > " + JSON.stringify(data));
          });
          client.on('connected', function(data) {
            console.log("net connect "+JSON.stringify(data));
          });
          client.on('timeout', function (data) {
            console.log("net timeout " + JSON.stringify(data));
          });
          client.on('close', function (data) {
            console.log("net closed, had_error: " + JSON.stringify(data));
          });
          client.on('end', function (err) {
            console.log('net client disconnected ' + JSON.stringify(skt) + ' *** ' + JSON.stringify(err));
          });
        });
        console.log('net client before callback ' + JSON.stringify(client));
    
        });
    }
    
Actions