-
-
-
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.
-
I'll check the tx connection and also the board power. I need Max of 2amps and also 5v. I've been using the bat pin on the espruino and I think it isn't strong enough to meet these requirements.
I'll also have a mess with the tx line. I'll try it on a different serial first to see if the spurious data coming back drops off.
-
I've managed to get a couple of messages to come through based on the following code:
Serial4.print('AT+CMGS=\"078177XXXXX\"\r') Serial4.print(msg + "\x1a")
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.:
ÿ¬þ¾ÿÿ·ýÛÅ'ÿ翼ïõ 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:
| __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v51 Copyright 2014 G.Williams >echo(0); GSM Starting.. =undefined AT+CMGF=1 > > OK > AT+IPR=2400 > > OK > ü_öÿþþ×÷ýÿºþéÞ¹}uæÏ×ÿÿoç»ãÔîwgò]¥wæ³×7½×:Åž¬^\mu£ê½Oð¯dX×ÿ¿°íÛþ®µ».ënýûWï÷ïíÿÿ÷ú?ÿöýæó¦øÿf*ëû¾¿ÿOÛ§ÿ½ÕýÞöçs«=öú÷»9¾¿GýËçüíºÏ½ßÜËËÿöÿûWo?¾Ýýú> ýëÿÿ?Í¿}ÿßÿýÿ> Ïf;sÞ÷ÛßêôwAT+CMGS="07817XXXXXX" > > +CMS ERROR: 3765 > ÿ®ÿ?÷¿ÿÿïþv_«¿ÏÛûvùß}öûþ¿×ßu÷ýø¹}¿ÿ»þ_ÿ¿YþýßýÎ}½øÏï|úõÞÿ§¿¿Þº/_»ßçü¶ÿú_¿Ûiñ®Þ]ßgÝõ~Û?ÿýo?}½ôþ~ûßgõÿûùß1á¿à§uù\ûíîö«ÉþUßë»ÿ·¼G7=ÝýþéöÕó^ñã£mÆó=¾ø³å¸Î»Ö]móoÓj·æv3}ÿÃß$ùü}Æ_ó´÷ÎüS~tøÙíïÿ¢eÛëØýfyóë´ùïûRßÃÿzb¿ÉÝów|}±=a_1ÛÊrðýùö3oço6ôPgÿY¶;?¸=3ÝÿÿÖÿÛÙ²~óí/ûä¾Bo/î¸îÛûw{^÷/ÿåÝVúïß¹AJçÞ)^½ùÍû~ïöèùÖ³ÓÆAwÿ¿Ï~øÿçåÝ?çÞèiZï_«®¿×Vüò_àøÏÛïë»:þ.íã?½üÿÿ<ì=)ýËîÿëø~ßßÿ¿ùõËûsç÷ßÙ¡¿ößëéÿ½ÿÛþÿ÷¿¿³÷ÿüÿ[ѯc¿âåíïúZïã]÷ÿíÇí¡õy=õø.«{ìçog©k:µï¶_õÈôÖ÷Ófªï¿Uµÿ¯×?ù3_þü/ïßÿ®ó»Ë¿ûÿï;??÷ÿ·ÿGëWz×ïiãú1·Htû½ÝÿñÏßïß¼=ý?÷þõ?s¿êÿóíÓîýúÅî9WWæ6«ïʶð§ôüÏOºjæ|YTw-ÏßÛë¼Õ<ÇÔ× ìùºY.ü:Çß ERROR >
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.
-
-
Hi All,
I'm a bit stuck when trying to send a text message via my GSM2 Click device which uses the M95 chip.
I have the module accepting AT commands through Serial4 however I really can't get the syntax working correctly to send a SMS message sucesfully.
I can carry out the following commands:
I firstly set the chip to Text Mode:
>Serial4.println("AT+CMGF=1"); =undefined �AT+CMGF=1
I then set the number to send the SMS to (I have added in the xxx's for anonymity)
>Serial4.println("AT+CMGS=\"078177xxxxx\""); =undefined uAT+CMGS="078177xxxxx" > ���+���������r�:ֿ�{�m�I���}Δ�{�ϧ�uI�m�C��_o��������u�ݵ��Ͽ�+�����+ɷ�������{�x�>_E�w���������Y�+>����ጒ���v?�7�흶i��q~��&��|�{-����nzn�����{��Jo��]��}v�!>�+������Mx����w��u��sC+M��������NAWޘ+~��w�B������l U������M��{�D�������Uj���/ػa�k����}?�r���d�,5�#��C����y�$~nޯ���}�������������|k��ױw�+߿�n��moP�ַ��������3�w����=�4���U���/���������(w{�X�����^ ����z�U��^�����\�O�־�����5������aוl����.Vݽ�E=�����ξa�b�'��{��?n���j� }��g�����ս�������3E�a��Re}��ݘޙj�zO�Ӧ��7��}��^����'��w^������e����q;��m�������l~��^��y����~����Î�������~�o���!{�������y��ͽoo�ck�yM��.�}���L���߳C�}���<w���K�w������|��gn��巹9��w���w��{��������u�v������k��{G��x?�����k����{��ݟ���|��K��������d������߿��������������9n�������Y{?����f����ge�E�g��������}Y���FV�}��_(��g�~�?��������(�������$������|���*y����?�>����o�� ����������{����{���k�[z��^m����گ���/��=ߞ�����݀[��k�u����{���o��C��/�7���&z����?����]�׃���~�������{��{��~?��z���~g�f�� �����b������W�nag����l�JgO�O{ۼ�����^���v}n�r?Ϸ��7��˸�v������w�w���'���7�|L��}�o�}�no}��������������D���?�����k��L�����:O���퇻����].ߏ��������x��������-���]�>�9���g_oKӯ����q� ����������~>K�Kl���>�����~��k����+�m���������U뿶"�������W���?ۿ{�=_ˣ�w�ׯ����~'���mn��U��o��u峣���w��V����}���ߞ�_�������ݥ7�� ����������e���]i��b���{ϟ_|��'�j|{no��o�}~��<����v~�����{����¯����M���~��6�����������ׯ�Ǯ����������u����B����?0���|����'�ݼ��߷�����s�����g?S�WЏ���5ڣ��� �����:��v�w���������W�ᆵ�7�3��������ۺ���??�����ϳ���}��~���������������ۻW����5 OK
As you can see there is a lot of garbled characters but the output is an "OK" at the end.
I then assume that the Serial4 is sat at the ">" prompt where I would then enter the text for the text message so I go ahead with the following command:
>Serial4.println("testing a sms message"); =undefined
From here I know I need to send a CTRL+Z character at the prompt to send the message so I carry out the following:
>Serial4.write(0x1A); =undefined
However.. I receive nothing. I would expect to see an ID number pop up and the message to go through to my phone.
Any ideas where I am going wrong here I've been messing around with all the variants I can think of - changing the Serial.write to print and print to println with no luck.
Sounds good will take a look at getting one now (Their site seems a little broken at the moment though for me..)
Is minimum order quantity 3? Don't think I'll need 3 if it didn't work :p