Avatar for user118421

user118421

Member since Sep 2020 • Last active Nov 2020
  • 4 conversations
  • 24 comments

Most recent activity

    • 27 comments
    • 6,689 views
  • in General
    Avatar for user118421

    I have not received the TTL USB adaptor yes but tried this;

    I connected the Pixl.js to the ESP8266 Esp-01 like this;
    Pixl.js <-> Esp01
    GND <-> GND
    3.3V <-> EN
    3.3V <-> 3.3V
    D0 <-> RX
    D1 <-> TX

    Then ran this;

    var serial = Serial1;
    var pins = { rx: D1, tx : D0 };
    function test(baud) {
      serial.removeAllListeners();
      var l="";
      serial.on('data', function(d) {l+=d;});
      serial.setup(baud, pins);
      serial.write("AT+GMR\r\n");
      setTimeout(function(){console.log(JSON.s­tringify(l));},800);
    }
    setTimeout(function() { test(9600); }, 2000);
    setTimeout(function() { test(115200); }, 3000);
    setTimeout(function() { test(57600); }, 4000);
    setTimeout(function() { console.log("Done!"); }, 5000);
    

    The result;

    "AT+GMR\r\r\nAT version:1.1.0.0(May 11 2016 18:09:56)\r\nSDK version:1.5.4(baaeaebb)\r\ncompile time:May 20 2016 15:08:19\r\nOK\r\n"")m\u00E9oI\r\n"
    

    However, when I then run this the Pixl.js just disconnects from my PC Espruino Web IDE bluetooth and enters into a boot loop..;

    var WIFI_NAME = "x";
    var WIFI_PASS = "x";
    
    Serial1.setup(115200, { rx: D1, tx : D0 });
    var wifi = require("ESP8266WiFi_0v25").connect(Seri­al1, function(err) {
      //                ^^^^^^^^^^^^^^^^
      //                Use ESP8266WiFi here (and 9600 baud) if you have an ESP8266 with firmware older than 0.25
      if (err) throw err;
      console.log("Connecting to WiFi");
      wifi.connect(WIFI_NAME, WIFI_PASS, function(err) {
        if (err) throw err;
        console.log("Connected");
        // Now you can do something, like an HTTP request
        require("http").get("http://www.pur3.co.­uk/hello.txt", function(res) {
          console.log("Response: ",res);
          res.on('data', function(d) {
            console.log("--->"+d);
          });
        });
      });
    });
    
  • in General
    Avatar for user118421

    Many thanks for all advice!

    Yes, the Pixl is powered with 5v USB. If I measure on the ESP8266 it shows 3.3V.

    Flipping tx with rx gives same result (empty string)

    I also still just get empty strings as response if I set SW1 and SW2 to 'off'.

    Same thing with the first piece of code in #18 from allObjects which returns this;

    >
    >test()
    =undefined
    9600 : ""
    115200 : ""
    76800 : ""
    57600 : ""
    74880 : ""
    Done!
    

    I did order the USB-TTL converter so I'll give the firmware update instructions a shot when I receive it. I'll update here when I have tried that. Sorry if I missed trying something out but as I'm all new to this it's easy to get lost in all details :)

  • in General
    Avatar for user118421

    @parasquid - many thanks for helping and making the effort to test!

    I see the shield as FaryLink_ABC123 in the network but I'm not able to get the info page you mention. Anyway some googling indicated that these shields probably needs new firmware so I'll follow the instructions you linked to. I had to order the USB-TTL adaptor described so have to wait for that though.

  • in General
    Avatar for user118421

    Changing to Serial1 returns empty strings;

    >var serial = Serial1;
    =Serial1
    >var pins = { rx: D0, tx : D1 };
    ={ rx: D0, tx: D1 }
    >function test(baud) {
    :  serial.removeAllListeners();
    :  var l="";
    :  serial.on('data', function(d) {l+=d;});
    :  serial.setup(baud, pins);
    :  serial.write("AT+GMR\r\n");
    :  setTimeout(function(){console.log(JSON.s­tringify(l));},800);
    :}
    =function (baud) { ... }
    >//digitalWrite(B9,1); // enable on Pico Shim V2
    =undefined
    >setTimeout(function() { test(9600); }, 2000);
    =1
    >setTimeout(function() { test(115200); }, 3000);
    =2
    >setTimeout(function() { test(57600); }, 4000);
    =3
    >setTimeout(function() { console.log("Done!"); }, 5000);
    =4
    ""
    ""
    ""
    Done!
    >
    
  • in General
    Avatar for user118421

    I get an error when trying to verify the firmware version. Running this;

    var serial = Serial2;
    var pins = { rx: D0, tx : D1 };
    function test(baud) {
      serial.removeAllListeners();
      var l="";
      serial.on('data', function(d) {l+=d;});
      serial.setup(baud, pins);
      serial.write("AT+GMR\r\n");
      setTimeout(function(){console.log(JSON.s­tringify(l));},800);
    }
    //digitalWrite(B9,1); // enable on Pico Shim V2
    setTimeout(function() { test(9600); }, 2000);
    setTimeout(function() { test(115200); }, 3000);
    setTimeout(function() { test(57600); }, 4000);
    setTimeout(function() { console.log("Done!"); }, 5000);
    

    Gives me this response;

    >Uncaught ReferenceError: "Serial2" is not defined
     at line 1 col 14
    var serial = Serial2;
                 ^
    Uncaught Error: Cannot read property 'removeAllListeners' of undefined
     at line 4 col 7
    serial.removeAllListeners();
          ^
    in function "test" called from line 12 col 10
    test(9600);
             ^
    in function called from system
    Uncaught Error: Cannot read property 'removeAllListeners' of undefined
     at line 4 col 7
    serial.removeAllListeners();
          ^
    in function "test" called from line 13 col 12
    test(115200);
               ^
    in function called from system
    Uncaught Error: Cannot read property 'removeAllListeners' of undefined
     at line 4 col 7
    serial.removeAllListeners();
          ^
    in function "test" called from line 14 col 11
    test(57600);
              ^
    in function called from system
    Done!
    
  • in General
    Avatar for user118421

    Many thanks for the super clear reply and image! I followed it but unfortunately I receive the error;

    Uncaught No 'ready' after AT+RST
    

    when running the below code (from the instruction page). Any idea what I may be doing wrong?

    var WIFI_NAME = "x";
    var WIFI_PASS = "x";
    var wifi;
    
    function getPage() {
      require("http").get("http://www.pur3.co.­uk/hello.txt", function(res) {
        console.log("Response: ",res);
        res.on('data', function(d) {
          console.log("--->"+d);
        });
      });
    }
    
    function go() {
      Serial1.setup(115200,{rx:D0,tx:D1});
      wifi = require("ESP8266WiFi_0v25").connect(Seri­al1, function(err) {
        if (err) throw err;
        console.log("Connecting to WiFi");
        wifi.connect(WIFI_NAME, WIFI_PASS, function(err) {
          if (err) throw err;
          console.log("Connected");
          // Now you can do something, like an HTTP request
          getPage();
        });
      });
    }
    
    function onInit() {
      Terminal.setConsole();
    }
    
    go();
    
  • in General
    Avatar for user118421

    I now have the WiFi shield but fail to understand the instructions here . I'm sure it's just me lacking knowledge but I don't understand the difference of using it 'as-is' or 'as a shield'. Do I need to re-wire or solder anything or can I just connect the pins from the shield to the Pixl.js? There seems to be different ways of connecting described on the page and I'm not sure which parts of the instruction I need to follow to add the wifi shield as simple as possible. Grateful for any clarification that could help me :)

  • in General
    Avatar for user118421

    Brilliant - thank you very much - both ordered and looking forward to test :)

  • in General
Actions