However it is hit or miss it seems whether a message sends. I get a SMS probably once every 4 or 5 restarts of the device and re-flashing with the code.
I seem to be getting loads of garbled text coming back from the GSM module as I had in my first post. This seems to mess up the commands being sent also as sometimes if I send a command using Serial4.print("AT+blahcommand"); I then see in my terminal a mash e.g.:
ÿ¬þ¾ÿÿ·ýÛÅ'ÿ翼ïõ
OK
°ªþÿÃÀþYg:K
blèó@¨èÿ!£æþ;AAT+CMGS="078177XXXXX"
>
I never sent "AAT+CMGS" I actually sent "AT+CMGS".
Also the spurious data coming back is everywhere.. I've tried messing with the baud rates to no avail. Further example:
That is using a low baud of 2400. I get similar issues with high baud. The lower baud however always results in the "ERROR" message, the higher bauds atleast register something but I still get the garbled outputs which means nothing.
The parsing script I use for Serial4.ondata is:
function handler(c){
ms=ms+c;
if (c=='\r' || c=="\n" || c==">"){
console.log(ms);
ms="";
}
}
Serial4.onData(function (d) {handler(d.data);});
Im attempting to pick up /n /r and > (which is returned when the GSM wants you to enter the SMS text).
Sorry for the long and incoherent post but theres lots of small issues. I know the module is functioning at least as I have received text messages, saying that though the messages are also garbled e.g.
"i@@@f@@?@y@@@@@test"
It seems to be sending the messed up text and then appending my actual "test" message on the end.
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.
I've managed to get a couple of messages to come through based on the following code:
Where msg is just a string of text to test with.
However it is hit or miss it seems whether a message sends. I get a SMS probably once every 4 or 5 restarts of the device and re-flashing with the code.
I seem to be getting loads of garbled text coming back from the GSM module as I had in my first post. This seems to mess up the commands being sent also as sometimes if I send a command using Serial4.print("AT+blahcommand"); I then see in my terminal a mash e.g.:
I never sent "AAT+CMGS" I actually sent "AT+CMGS".
Also the spurious data coming back is everywhere.. I've tried messing with the baud rates to no avail. Further example:
That is using a low baud of 2400. I get similar issues with high baud. The lower baud however always results in the "ERROR" message, the higher bauds atleast register something but I still get the garbled outputs which means nothing.
The parsing script I use for Serial4.ondata is:
Im attempting to pick up /n /r and > (which is returned when the GSM wants you to enter the SMS text).
Sorry for the long and incoherent post but theres lots of small issues. I know the module is functioning at least as I have received text messages, saying that though the messages are also garbled e.g.
"i@@@f@@?@y@@@@@test"
It seems to be sending the messed up text and then appending my actual "test" message on the end.