The ESP8266 problem is because of their stupid use of Linked/Unlinked with no connection number. The SIM900 shouldn't have that.
Linked
Unlinked
I guess the problem here is that at.isBusy() is reporting false because it's not actually busy, just waiting for >.
at.isBusy()
>
Why not add your own variable to track whether you're waiting or not?
send: function(sckt, data) { if (at.isBusy() || this.sendWaiting || socks[sckt]=="Wait") return 0; if (!socks[sckt]) return -1; // error - close it this.sendWaiting = true; var f = function(d) { at.unregister('>'); this.sendWaiting = false; if (d != sckt + ", SEND OK") return; // <------- this doesn't seem to do anything? }; at.register('>', function() { at.write(data); return ""; }); at.cmd('AT+CIPSEND='+sckt+','+data.length+'\r\n', 10000, f); return data.length; }
@Gordon started
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.
The ESP8266 problem is because of their stupid use of
Linked
/Unlinked
with no connection number. The SIM900 shouldn't have that.I guess the problem here is that
at.isBusy()
is reporting false because it's not actually busy, just waiting for>
.Why not add your own variable to track whether you're waiting or not?