{"id":1337,"date":"2019-03-19T09:02:31","date_gmt":"2019-03-19T14:02:31","guid":{"rendered":"https:\/\/www.tigoe.com\/pcomp\/code\/?p=1337"},"modified":"2019-03-19T09:02:33","modified_gmt":"2019-03-19T14:02:33","slug":"mkr-gsm-1400-pre-flight-checklist","status":"publish","type":"post","link":"https:\/\/www.tigoe.com\/pcomp\/code\/arduinowiring\/1337\/","title":{"rendered":"MKR GSM 1400 Pre-flight Checklist"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I&#8217;ve been getting to know the <a href=\"https:\/\/www.arduino.cc\/en\/Guide\/MKRGSM1400\">MKR GSM 1400<\/a>  boards better the past few days, and in the process I&#8217;ve assembled a &#8220;pre-flight checklist&#8221; of things you&#8217;ll want to do first, in order to make sure everything is ready to go.  It took a few errors and missteps to get here, so I&#8217;ll mention those along the way. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Make sure you have an antenna attached<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I thought &#8220;I&#8217;ll be fine just to test, there&#8217;s good service in my city.&#8221; Wrong. Attach an antenna. You&#8217;ll need it to get a good signal even in a well-covered area. The<a href=\"https:\/\/store.arduino.cc\/usa\/gsm-antenna-anth7100a0200ai1\"> GSM Antenna<\/a> sold on the Arduino Store works well, though any GSM antenna with a SMA male connector should work. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Get a SIM card<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I used <a href=\"https:\/\/hologram.io\/\">Hologram.io<\/a>, thanks to recommendations from the rest of the Arduino team and <a href=\"https:\/\/don.github.io\/slides\/2018-09-22-makerfaire-iot-cellular\/assets\/player\/KeynoteDHTMLPlayer.html\">Don Coleman.<\/a> Their Hologram Maker Edition service is affordable and easy to use. When you do set up an account, get a SIM card of course, and assign a phone number to it. That&#8217;s optional for their service, but needed if you want to send and receive SMS messages or phone calls.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll also want to take note of the <strong>Device ID, APN info, <\/strong>and<strong> Device Key.<\/strong> You&#8217;ll need those later. When accessing GPRS services through the MKR 1400, the login is the Device ID and the password is the Device Key. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Download MKRGSM library<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can find this in the Arduino IDE&#8217;s LIbrary Manager. When you install it, you&#8217;ll get a new set of example sketches in the File Menu, Examples submenu called MKRGSM. You&#8217;ll need to have the right board chosen in the Tools menu (MKR 1400) in order for these examples to show up in the Examples submenu, though.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Run the TestModem Sketch<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Click the File Menu, Examples submenu, MKRGSM submenu, Tools submenu to find the TestModem sketch. Upload this to your board and open the Serial Monitor. You should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Starting modem test\u2026<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then a slight delay, followed by:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">modem.begin() succeeded<br> Checking IMEI\u2026Modem's IMEI: XXXXXXXXXXXXXXX<br> Resetting modem\u2026Modem is functoning properly<br><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Your IMEI will be unique to your board, it&#8217;s the International Mobile Equipment Identifier. It&#8217;s written on the MKR1400, and encoded in the QR code there as well. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you don&#8217;t get these messages, check that your SIM card is inserted properly, and that you&#8217;ve chosen the right board and serial port.  Then upload the sketch again.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Run the BandManagement sketch<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Click the File Menu, Examples submenu, MKRGSM submenu, Tools submenu to find the BandManagement sketch.  Upload this to your board and open the Serial Monitor. You should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Restarting modem\u2026<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then a slight delay followed by:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Modem restarted.<br> Current band:EGSM_DCS_MODE<br> Want to change the band you\u2019re on?<br> Select band:<br> 1 : E-GSM(900)<br> 2 : DCS(1800)<br> 3 : PCS(1900)<br> 4 : E-GSM(900)+DCS(1800) ex: Europe<br> 5 : GSM(850)+PCS(1900) Ex: USA, South Am.<br> 6 : GSM(850)+E-GSM(900)+DCS(1800)+PCS(1900)<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Choose the right band for your region of the world. If you pick the wrong region, the MKR1400 will never connect to a network. I puzzled over this for several minutes before I thought to check the band, as I was in the US and the board came from Europe.  Type the correct number in the Serial Monitor&#8217;s input field, then hit enter. You should get:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Configuring band GSM850_PCS_MODE<br><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Or whatever mode is appropriate to your region. Then after a few seconds:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Success<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Run the  ScanNetworks sketch<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Click the File Menu, Examples submenu, MKRGSM submenu, Tools submenu to find the GsmScanNetworks sketch. If your SIM card requires a PIN, enter it in the <code>arduino_secrets.h<\/code> tab. Upload this to your board and open the Serial Monitor. You should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">GSM networks scanner<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then a longer delay followed by:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Modem IMEI: XXXXXXXXXXXXXXX<br> Scanning available networks. May take some seconds.<br> Current carrier: T-Mobile<br> Signal Strength: 5 [0-31]<br> Scanning available networks. May take some seconds.<br> Current carrier: T-Mobile<br> Signal Strength: 5 [0-31]<br> Scanning available networks. May take some seconds.<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This should be the first sketch that connects your MKR 1400 to the mobile network, so make sure you have an antenna attached.  Your carrier name and signal strength will vary, of course. The scanning will run continually. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you see this, you know you&#8217;re on the mobile network. Now the fun begins.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Run the SendSMS sketch<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Click the File Menu, Examples submenu, MKRGSM submenu, to find the SendSMS sketch. If your SIM card requires a PIN, enter it in the <code>arduino_secrets.h<\/code> tab. Upload this to your board and open the Serial Monitor. You should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SMS Messages Sender<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then a delay followed by:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">GSM initialized<br> Enter a mobile number: <br><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Type your mobile phone number into the Serial Monitor&#8217;s input field, including the country code. For example, a typical US number would be +15551212. Then type enter. You should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+15551212<br> Now, enter SMS content: <\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Type a message,  something like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">I like aardvarks and okapi, don't you too?<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Message:<br> I like aardvarks and okapi, don't you too?<br><br>COMPLETE!<br><br>Enter a mobile number: <br><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should get the text on your phone number too, of course.  Note that the sending phone number may not be the one associated with your SIM. This will depend on your carrier. Send a few more until you&#8217;ve exhausted that fun. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Run the ReceiveSMS sketch<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Click the File Menu, Examples submenu, MKRGSM submenu, to find the ReceiveSMS sketch. If your SIM card requires a PIN, enter it in the <code>arduino_secrets.h<\/code> tab. Upload this to your board and open the Serial Monitor. You should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SMS Messages Receiver<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then a delay followed by:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">GSM initialized<br> Waiting for messages<br><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Send a text message from your mobile phone to the number associated with your SIM card.  You should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Message received from:<br> +15551212<br> Oh, and llamas and bonobos are quite nice too.<br> END OF MESSAGE<br> MESSAGE DELETED<br><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now you know you&#8217;re successfully sending and receiving messages from the mobile network. Finally, test GPRS connectivity:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Run the GsmSSLWebClient sketch<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Click the File Menu, Examples submenu, MKRGSM submenu, to find the GsmSSLWebClient sketch. Click the <code>arduino_secrets.h<\/code> tab and enter your APN info, login, and password. From Hologram.io, you hologram for the APN, use the Device ID as login and generate a Device Key as password. Hologram SIMs do not require a PIN.  Check with your mobile provider for details on your own SIM. Upload this to your board and open the Serial Monitor. You should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Starting Arduino web client.<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then a longer delay followed by:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">connecting\u2026<br> connected<br> HTTP\/1.1 200 OK<br> Server: nginx<br> Date: Tue, 19 Mar 2019 13:48:40 GMT<br> Content-Type: text\/plain<br> Content-Length: 2263<br> Last-Modified: Wed, 02 Oct 2013 13:46:47 GMT<br> Connection: close<br> Vary: Accept-Encoding<br> ETag: \"524c23c7-8d7\"<br> Accept-Ranges: bytes<br> <code>       `:;;;,`                      .:;;:.                .;;;;;;;;;;;`                :;;;;;;;;;;:     TM    `;;;;;;;;;;;;;;;`            :;;;;;;;;;;;;;;;        :;;;;;;;;;;;;;;;;;;         `;;;;;;;;;;;;;;;;;;      ;;;;;;;;;;;;;;;;;;;;;       .;;;;;;;;;;;;;;;;;;;;    <\/code><br> ;;;;;;;;:;;;;;;;;;     ,;;;;;;;;.<code>.;;;;;;;;      .;;;;;;,         :;;;;;;;   .;;;;;;;          ;;;;;;;     ;;;;;;             ;;;;;;;  ;;;;;;,            ;;;;;;.   ,;;;;;               ;;;;;;.;;;;;;<\/code>              ;;;;;; <br>  ;;;;;.                ;;;;;;;;;;;<code>```       ;;;;;<\/code><br>  ;;;;;                  ;;;;;;;;;,       ;;;       .;;;;;<br> <code>;;;;:<\/code>;;;;;;;;        ;;;        ;;;;;<br> ,;;;;,,,,,,,,      ;;;;;;;      .,,;;;,,,     ;;;;;<br> :;;;;<code>.;;;;;;;;       ;;;;;,      :;;;;;;;;     ;;;;; :;;;;<\/code>    .;;;;;;;;      <code>;;;;;;      :;;;;;;;;     ;;;;; .;;;;.                   ;;;;;;;.        ;;;        ;;;;;  ;;;;;                  ;;;;;;;;;        ;;;        ;;;;;  ;;;;;                 .;;;;;;;;;;       ;;;       ;;;;;,  ;;;;;;<\/code>;;;;;;;;;;;;                ;;;;; <br>  <code>;;;;;,             .;;;;;; ;;;;;;;              ;;;;;;    ;;;;;;:           :;;;;;;.  ;;;;;;;            ;;;;;;      ;;;;;;;<\/code>       .;;;;;;;,    ;;;;;;;;        ;;;;;;;:  <br>     ;;;;;;;;;:,:;;;;;;;;;:      ;;;;;;;;;;:,;;;;;;;;;;   <br>     <code>;;;;;;;;;;;;;;;;;;;.        ;;;;;;;;;;;;;;;;;;;;           ;;;;;;;;;;;;;;;;;           :;;;;;;;;;;;;;;;;:             ,;;;;;;;;;;;;;,              ;;;;;;;;;;;;;;                 .;;;;;;;;;<\/code>                  ,;;;;;;;;:         <br> <code>;;;   ;;;;;`  ;;;;:  .;;  ;; ,;;;;;, ;;. `;,  ;;;;    ;;;   ;;:;;;  ;;;;;; .;;  ;; ,;;;;;: ;;; `;, ;;;:;;  <\/code><br> ,;:;   ;;  ;;  ;;  ;; .;;  ;;   ,;,   ;;;,<code>;, ;;  ;;      ;; ;:  ;;  ;;  ;;  ;; .;;  ;;   ,;,   ;;;;<\/code>;, ;;  ;;. <br>    ;: ;;  ;;;;;:  ;;  ;; .;;  ;;   ,;,   ;;<code>;;;, ;;  ;;<\/code> <br>   ,;;;;;  ;;<code>;;   ;;  ;; .;;  ;;   ,;,   ;; ;;;, ;;  ;;     ;;  ,;, ;; .;;  ;;;;;:  ;;;;;: ,;;;;;: ;;  ;;, ;;;;;;     ;;   ;; ;;  ;;<\/code> ;;;;.   `;;;:  ,;;;;;, ;;  ;;,  ;;;;   <br> disconnecting.<br><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That text will appear as the ASCII-encoded Arduino logo in your Serial Monitor.  Now you know you&#8217;ve got GPRS working, and should have enough functionality to proceed with your own sketches. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The MKRGSM library is based on similar principles as the WiFi101 and WiFiNINA libraries. Once you connect to the network, you use a variety of classes to do your business. The SMS class functions a bit like the Serial class, in that it&#8217;s based on the Stream class, so you can do things like see how many bytes are <code>available()<\/code>, you can <code>read()<\/code> and <code>write()<\/code>, and so forth.  The GSMClient and GSMSSLClient classes function just like the TCP client classes in the WiFi libraries. Check the <a href=\"https:\/\/www.arduino.cc\/en\/Reference\/MKRGSM\">MKRGSM library documentation <\/a>for more detail. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been getting to know the MKR GSM 1400 boards better the past few days, and in the process I&#8217;ve assembled a &#8220;pre-flight checklist&#8221; of things you&#8217;ll want to do first, in order to make sure everything is ready to go. It took a few errors and missteps to get here, so I&#8217;ll mention those &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.tigoe.com\/pcomp\/code\/arduinowiring\/1337\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;MKR GSM 1400 Pre-flight Checklist&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,74],"tags":[],"class_list":["post-1337","post","type-post","status-publish","format-standard","hentry","category-arduinowiring","category-electronics"],"_links":{"self":[{"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/posts\/1337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/comments?post=1337"}],"version-history":[{"count":2,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/posts\/1337\/revisions"}],"predecessor-version":[{"id":1339,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/posts\/1337\/revisions\/1339"}],"wp:attachment":[{"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/media?parent=1337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/categories?post=1337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/tags?post=1337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}