You are reading a single comment by @Hardware_Hacks and its replies. Click here to read the full conversation.
  • Thanks for all the help on this guys.

    I have just wired up the GSM module to a 1000mAh battery with 3A output and only using the Espruino for reading the RX and TX lines. The text messages now come through it seems every time and the AT commands are more responsive.

    I am still getting some spurious data coming through the lines but not half as bad as before here is what I am seeing:

    =undefined
     _____                 _ 
    |   __|___ ___ ___ _ _|_|___ ___ 
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v52 Copyright 2014 G.Williams
    >>echo(0);
    GSM Starting..
    =undefined
    AT+CMGF=1
    >
    OK
    AT+IPR=9600
    OK
    >Serial1.print("AT+CMGS=\"07817xxxxx\"\r");
    =undefined
    AT+CMGS="07817xxxxxx"
    >
    >Serial1.print("testing a message" + "\x1a");
    =undefined
     ÿÿÿýýÿÿÿòÿïÿÿÿþûÿÿþýÿûÿýýìÿÿÿþÿÿöóýÿÿøüóüÿÿþûÿýýÿûýÿýûÿùûÿúÿû÷testing a messageÿÿÿÿÿÿýÿýýÿÿÿÿûþÿ
    +CMGS: 9
    >
    OK
    > 
    

    The text message I receive is:

     ÿÿÿýýÿÿÿòÿïÿÿÿþûÿÿþýÿûÿýýìÿÿÿþÿÿöóýÿÿøüóüÿÿþûÿýýÿûýÿýûÿùûÿúÿû÷testing a message
    

    Subsequent messages are better:

    >Serial1.print("testing a message again" + "\x1a"); 
    =undefined
     testing a message againÿÿÿÿÿÿÿÿÿÿÿþÿÿ÷ÿ
    

    With the message received at the phone being:

    testing a message again
    

    Is there a check I can put in place to remove these weird characters?

    Currently using:

    function handler(c){
      ms=ms+c;
      if (c=='\r' || c=="\n" || c==">"){
        console.log(ms);
        ms="";
      }
    }
    
    Serial1.onData(function (d) {handler(d.data);});
    
    

    For serial data handling.

    For anyone else with similar issues to this thread, power was the killer for me it seems.

About