{"id":468,"date":"2015-02-21T01:53:14","date_gmt":"2015-02-21T01:53:14","guid":{"rendered":"http:\/\/itp.fromjia.com\/?p=468"},"modified":"2015-02-21T19:00:52","modified_gmt":"2015-02-21T19:00:52","slug":"hello-world","status":"publish","type":"post","link":"http:\/\/itp.fromjia.com\/?p=468","title":{"rendered":"Hello LED"},"content":{"rendered":"<p><a href=\"http:\/\/itp.fromjia.com\/wp-content\/uploads\/2015\/02\/IMG_4801.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-469\" src=\"http:\/\/itp.fromjia.com\/wp-content\/uploads\/2015\/02\/IMG_4801-1024x765.jpg\" alt=\"IMG_4801\" width=\"730\" height=\"545\" srcset=\"http:\/\/itp.fromjia.com\/wp-content\/uploads\/2015\/02\/IMG_4801-1024x765.jpg 1024w, http:\/\/itp.fromjia.com\/wp-content\/uploads\/2015\/02\/IMG_4801-300x224.jpg 300w, http:\/\/itp.fromjia.com\/wp-content\/uploads\/2015\/02\/IMG_4801-1200x896.jpg 1200w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/a><\/p>\n<p>The first time I tried using the GSM module to send a text, I made the dumb mistake of not turning on the module. So it worked this time. I used the code that Benedetta had emailed us.<br \/>\n<div id=\"attachment_470\" style=\"width: 610px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/itp.fromjia.com\/wp-content\/uploads\/2015\/02\/sendtext.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-470\" src=\"http:\/\/itp.fromjia.com\/wp-content\/uploads\/2015\/02\/sendtext.gif\" alt=\"Sending SMS from GSM module.\" width=\"600\" height=\"338\" class=\"size-full wp-image-470\" \/><\/a><p id=\"caption-attachment-470\" class=\"wp-caption-text\">Sending SMS from GSM module.<\/p><\/div><\/p>\n<p>A modest next step: turn on a LED with a text. For now, I&#8217;m able to receive texts by sending them through the GSM module with CoolTerm, but I can&#8217;t receive any messages on the GSM module. I&#8217;ll need to figure out how to receive a message, match it, then change the LED pin output to HIGH.<\/p>\n<p><strong>UPDATE:<\/strong><\/p>\n<p>I attempted again with the white GSM module. I can read SMS with CoolTerm now, but there seems to be a long delay. It takes a few seconds for the messages to show. If I use the command <em>AT+CMGL=&#8221;ALL&#8221;<\/em>, only the first part of the first message would display correctly. The rest of the messages are in gibberish. I tried changing the delay that follows\u00a0<em>Serial.write(inChar);<\/em> in the code. But this didn&#8217;t help.<\/p>\n<div id=\"attachment_477\" style=\"width: 740px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/itp.fromjia.com\/wp-content\/uploads\/2015\/02\/Screen-Shot-2015-02-21-at-11.56.35-AM.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-477\" src=\"http:\/\/itp.fromjia.com\/wp-content\/uploads\/2015\/02\/Screen-Shot-2015-02-21-at-11.56.35-AM-1024x833.png\" alt=\"Reading SMS in CoolTerm. \" width=\"730\" height=\"594\" class=\"size-large wp-image-477\" srcset=\"http:\/\/itp.fromjia.com\/wp-content\/uploads\/2015\/02\/Screen-Shot-2015-02-21-at-11.56.35-AM-1024x833.png 1024w, http:\/\/itp.fromjia.com\/wp-content\/uploads\/2015\/02\/Screen-Shot-2015-02-21-at-11.56.35-AM-300x244.png 300w, http:\/\/itp.fromjia.com\/wp-content\/uploads\/2015\/02\/Screen-Shot-2015-02-21-at-11.56.35-AM-1200x977.png 1200w, http:\/\/itp.fromjia.com\/wp-content\/uploads\/2015\/02\/Screen-Shot-2015-02-21-at-11.56.35-AM.png 1376w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/a><p id=\"caption-attachment-477\" class=\"wp-caption-text\">Reading SMS in CoolTerm.<br \/><\/p><\/div>\n<p>I also tried to turn the LED on by texting <em>I<\/em>, and turning it off by texting <em>O<\/em>. After about 10 secs of texting <em>I<\/em>, the LED would turn on. But typing <em>O<\/em> did not work. Also if I change the letter in the code from <em>I<\/em> to <em>O<\/em>, the LED would not turn on. Another issue I had was that after testing with my SIM card for a while, I wouldn&#8217;t be able to read anymore SMS on that card though I was still able to send SMS out. I had to switch to another SIM card to continue testing and reading SMS.<\/p>\n<p>This is how it worked when I text &#8220;<em>I<\/em>&#8221; to turn on the LED:<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/E37y6VD7gFE\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>Here&#8217;s the code:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/OhJia\/760135481c9edbc690fb.js\"><\/script><\/p>\n<p><strong>Question<\/strong><br \/>\n<br \/>\nIs <strong>Serial.write(mySerial.(read))<\/strong> writing <em>+CMTI: &#8220;SM&#8221;,sms#<\/em> each time? Perhaps this is why typing <em>I<\/em> would turn the LED on \u2013 because <em>+CMTI<\/em> contains the letter <em>I<\/em>. If this is the case, what is an effective way to check for <em>+CMTI: &#8220;SM&#8221;,sms#<\/em>, mySerial.print() the AT commands for reading SMS, skip through the metadata for the SMS, and read the actual SMS message?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The first time I tried using the GSM module to send a text, I made the dumb mistake of not turning on the module. So it worked this time. I used the code that Benedetta had emailed us. A modest next step: turn on a LED with a text. For now, I&#8217;m able to receive [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-468","post","type-post","status-publish","format-standard","hentry","category-towers-of-power"],"_links":{"self":[{"href":"http:\/\/itp.fromjia.com\/index.php?rest_route=\/wp\/v2\/posts\/468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/itp.fromjia.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/itp.fromjia.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/itp.fromjia.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/itp.fromjia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=468"}],"version-history":[{"count":10,"href":"http:\/\/itp.fromjia.com\/index.php?rest_route=\/wp\/v2\/posts\/468\/revisions"}],"predecessor-version":[{"id":483,"href":"http:\/\/itp.fromjia.com\/index.php?rest_route=\/wp\/v2\/posts\/468\/revisions\/483"}],"wp:attachment":[{"href":"http:\/\/itp.fromjia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/itp.fromjia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=468"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/itp.fromjia.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}