Ok, turns out there's a very annoying bug in the interpreter! > is used as a character that prefixes internal variables that users don't want to see, and it means it gets ignored when it's in an array. I've just pushed out a new AT module with a workaround in.
Try:
send : function(sckt, data) {
if (at.isBusy() || socks[sckt]=="Wait") return 0;
if (!socks[sckt]) return -1; // error - close it
var f = function(d) {
at.unregister(">");
if (d!="SEND OK") console.log("Send got: "+d);
};
at.register(">", function() {
at.write(data);
return "";
});
at.cmd('AT+CIPSEND='+sckt+','+data.length+'\r\n', 10000, f);
return data.length;
}
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Ok, turns out there's a very annoying bug in the interpreter!
>
is used as a character that prefixes internal variables that users don't want to see, and it means it gets ignored when it's in an array. I've just pushed out a newAT
module with a workaround in.Try: