{"id":307,"date":"2014-07-26T21:37:16","date_gmt":"2014-07-26T19:37:16","guid":{"rendered":"http:\/\/heppg.de\/ikg\/wordpress\/?p=307"},"modified":"2014-09-09T20:55:34","modified_gmt":"2014-09-09T18:55:34","slug":"sending-receiving-sms-messages-with-gsm-modem","status":"publish","type":"post","link":"https:\/\/heppg.de\/ikg\/wordpress\/?p=307","title":{"rendered":"Sending, Receiving SMS messages with GSM Modem"},"content":{"rendered":"<p>Recently I bought an instance of adafruit&#8217;s SIM800 breakout board &#8216;fona&#8217;. This board allows for sending and receiving of SMS\u00a0 text messages (and a lot of other functionality, of course. But I covered only the text messages for scratch). For the text messages, I added an adapter for my scratchClient software.<br \/>\nFor download and documentation, see [url]http:\/\/heppg.de\/ikg\/wordpress\/?page_id=6[\/url]<\/p>\n<p>In scratch, a variable &#8216;sms_out&#8217; is used to send messages, incoming messages are in the sensor value &#8216;sms_in&#8217;. Easy to use, and today I ignored provider cost and have sent me SMS every hour &#8216;scratch installation still running&#8217;. Could be more useful, but is fun when your computer gives you a call.<\/p>\n<p>Connection of fona is by RX, TX to TX, RX of raspberry. You need to remove some getty processes from this line, there are documentations around describing this.<\/p>\n<p>The sim800 uses an AT-protocol, like &#8216;at+cpin?&#8217;, and receives signals like &#8216;+CPIN: SIM PIN&#8217;.<br \/>\nFor the initialization of the device, the adapter implements a state machine, which step by step initializes the modem, sets the pin and then waits for action.<br \/>\nSwitching the modem on is done by pressing the &#8216;on&#8217; key on the breakout board. Could be done by using GPIO, but I decided to need some additional access control.<\/p>\n<p>The receiver side oft the serial protocol reads line by line, looks for known names and feeds the state machine with input.<\/p>\n<p>The code is still experimental. There is no buffering for scratch input, so if scratch feeds too fast, there will be lines dropped. But It is not intended as a spam machine&#8230; The phone number being called on send events is fixed for the same reason.<\/p>\n<p>If you want to run the software, be sure to have a backup phone which allows to reset the pin (in case it was forgotten to configure the pin in the adapters xml file, it might happen that after a few retries the device is blocked.)<br \/>\nAnd the manual of the sim800 is useful. Which is 300 pages.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I bought an instance of adafruit&#8217;s SIM800 breakout board &#8216;fona&#8217;. This board allows for sending and receiving of SMS\u00a0 text messages (and a lot of other functionality, of course. But I covered only the text messages for scratch). For the text messages, I added an adapter for my scratchClient software. For download and documentation, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-307","post","type-post","status-publish","format-standard","hentry","category-scratchclient"],"_links":{"self":[{"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=307"}],"version-history":[{"count":4,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/307\/revisions"}],"predecessor-version":[{"id":318,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/307\/revisions\/318"}],"wp:attachment":[{"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}