Avatar for CriscoCrusader

CriscoCrusader

Member since Nov 2016 • Last active May 2017
  • 13 conversations
  • 53 comments

Most recent activity

  • in JavaScript
    Avatar for CriscoCrusader

    I'm publishing the same topic over and over again, using the node mqtt module on my computer, and occasionally I'm getting incomplete data printed out in Espruino. I assume the Espruino MQTT code is to blame because the client matched on the topic, yet the output doesn't match.

    { 
      "topic": "sb_platform/v1/tes_16002b00", 
      "message": "100", 
      "dup": 0, "qos": 0, "retain": 0 }
    100
    Connection refused, unknown return code: 115.
    { 
      "topic": "sb_platform/v1/tes_16002b00", 
      "message": "100", 
      "dup": 0, "qos": 0, "retain": 0 }
    100
    { 
      "topic": "sb_platform/v1/tes_16002b00", 
      "message": "100", 
      "dup": 0, "qos": 0, "retain": 0 }
    100
    { 
      "topic": "sb_platform/v1/tes_16002b00", 
      "message": "100", 
      "dup": 0, "qos": 0, "retain": 0 }
    100
    MQTT unsupported packet type: 0
    [MQTT]0,27,115,98,95,112,108,97,116,102,­111,114,109,47,118,49,47,116,101,115,95,­49,54,48,48,50,98,48,48,49,48,48
    { 
      "topic": "sb_platform/v1/tes_16002b00", 
      "message": "10", 
      "dup": 0, "qos": 0, "retain": 0 }
    10
    { 
      "topic": "sb_platform/v1/tes_16002b00", 
      "message": "100", 
      "dup": 0, "qos": 0, "retain": 0 }
    100
    { 
      "topic": "sb_platform/v1/tes_16002b00", 
      "message": "100", 
      "dup": 0, "qos": 0, "retain": 0 }
    100
    { 
      "topic": "sb_plat", 
      "message": "", 
      "dup": 0, "qos": 0, "retain": 0 }
    
    MQTT unsupported packet type: 6
    [MQTT]102,111,114,109,47,118,49,47,116,1­01,115,95,49,54,48,48,50,98,48,48,103,11­1
    
    • 4 comments
    • 145 views
  • in General
    Avatar for CriscoCrusader

    My bad. I've used that before, I think it's quite good, and I see these functions are there too. I'm really sleep deprived, that will be my excuse. Sorry for being a nuisance :). Thanks as always.

  • in General
    Avatar for CriscoCrusader

    I didn't know it has that feature! Trying it now, but seem to be having troubles.

    Using first port, {"path":"/dev/cu.usbmodem1421","usb":[11­55,22336],"description":"Espruino board"}
    Connecting to '/dev/cu.usbmodem1421'
    Connected
    Espruino.Core.Utils.getURL: got HTTP status code 404 for http://www.espruino.com/modules/NetworkJ­S.min.js
    Espruino.Core.Utils.getURL: got HTTP status code 404 for http://www.espruino.com/modules/net.min.­js
    Espruino.Core.Utils.getURL: got HTTP status code 404 for http://www.espruino.com/modules/net.js
    Module net not found
    Espruino.Core.Utils.getURL: got HTTP status code 404 for http://www.espruino.com/modules/NetworkJ­S.js
    Module NetworkJS not found
    

    I'll probably figure out why this happens. I see these same messages sometimes in the IDE, but it's fixed if I reset();save();.

  • in General
    Avatar for CriscoCrusader

    To get into the bootloader you just power the board up with the button held down - does that not work?

    It does not appear to be working. What does the yellow LED mean?

    For modules that have to be loaded off the internet you have to use the right-hand side of the IDE so the IDE can detect their use and load them automatically. The left-hand side goes direct to the Espruino Board, so if it doesn't know about a module it's unable to load it.

    Ya, see how it works now.

    It'd be worth going through the quick start and a few of the Espruino Pico tutorials - I think a lot of this stuff is covered already there - it might save you some time :)

    I did when I got my first board. I saw the section about save and onInit at the time, but I didn't try it out, and I forgot those features existed. I don't learn well by reading, I learn by doing, which is apparently uncommon among developers. FWIW, the Lodash project documentation is really easy to work with. Would be super if Espruino could have similar documentation at some point in the future.

  • in General
    Avatar for CriscoCrusader

    Would be nice if there was a way to have the right panel load from my file before sending to Espruino. I would be able to work in my preferred editor, Sublime Text. The Web IDE has a clumsy aspect to it (at least one Macs) because it's a Chrome App, so changing to Chrome using CMD + Tab brings the Web IDE to the front, covering all of Chrome (since I'm on a laptop the majority of the time). So I then have to hit CMD + ` (this hotkey is for changing between multiple windows of the same program on Macs).

    I tried the Web IDE in a tab for the first time just now, but it can't find my Espruino.

    I guess that for now, I'll just have to use another browser besides Chrome, when I'm working with Espruino.

  • in General
    Avatar for CriscoCrusader

    Thanks, Gordon. I did go through the FAQ's, it's not there. I might have looked through the quick start guide, can't remember, but you're right that it's explained there.

  • in General
    Avatar for CriscoCrusader

    Ooohhhhhh, it works. I understand now.

    Instead of typing require("EspruinoWiFi") in the left pane, it has to go in the right pane:

    var wifi = require("EspruinoWiFi");
    

    Press Send to Espruino

    dump() // left pane
    var wifi = {
      "connect": function (a,b,c) {var f="";void 0!==b.password&&(f=b.password);m(1,funct­ion(b){if(b)return c(b);d.cmd("AT+CWJAP="+JSON.stringify(a)­+","+JSON.stringify(f)+"\r\n",2E4,functi­on x(a){if(0<=["WIFI DISCONNECT","WIFI CONNECTED","WIFI GOT IP","+CWJAP:1"].indexOf(a))return x;"OK"!=a?setTimeout(c,0,"WiFi connect failed: "+(a?a:"Timeout")):setTimeout(c,0,null)}­)})},
      "disconnect": function () {r(1)},
      "getIP": function (a) {var b={};d.cmd("AT+CIFSR\r\n",1E3,function f(d){if(void 0===d)a("Timeout");else{if("+CIFSR:STAIP­"==d.substr(0,12))b.ip=d.slice(14,-1);el­se if("+CIFSR:STAMAC"==d.substr(0,13))b.mac­=d.slice(15,-1);else if("OK"==d){a(null,b);return}return f}})},
      "startAP": function (a,b,c) {
      b=b||{};if(!b.password||8>b.password.len­gth)throw Error("Password must be at least 8 characters");var f=b.password?"3":"0";if(b.authMode&&(f={­open:0,wpa:2,wpa2:3,wpa_wpa2:4}[b.authMo­de],void 0===f))throw Error("Unknown authMode "+
    b.authMode);void 0===b.channel&&(b.channel=5);m(2,functio­n(e){if(e)return c(e);d.cmd("AT+CWSAP="+JSON.stringify(a)­+","+JSON.stringify(b.password)+","+b.ch­annel+","+f+"\r\n",5E3,function(a){"OK"!­=a?c("CWSAP failed: "+(a?a:"Timeout")):c(null)})})
    },
      "stopAP": function () {r(2)},
      "scan": function (a) {
      var b=[];m(1,function(c){if(c)return a(c);d.cmdReg("AT+CWLAP\r\n",5E3,"+CWLAP­:",function(a){a=a.slice(8,-1).split(","­);b.push({ssid:JSON.parse(a[1]),authMode­:w[a[0]],rssi:parseInt(a[2]),mac:JSON.pa­rse(a[3]),
    channel:JSON.parse(a[4])})},function(c){­a(null,b)})})
    }
     };
    =undefined
    

    So if I upload code that isn't messed up (trying to support __non_webpack_require__ causes issues) I think this will work once again.

    Getting into bootloader probably not working still :(

Actions