{"id":9894,"date":"2015-11-12T10:32:35","date_gmt":"2015-11-12T16:32:35","guid":{"rendered":"http:\/\/www.multitech.net\/developer\/?page_id=9894"},"modified":"2019-09-04T22:43:59","modified_gmt":"2019-09-05T03:43:59","slug":"at-command-firmware-user-guide","status":"publish","type":"page","link":"https:\/\/www.multitech.net\/developer\/software\/mdot-software\/at-command-firmware-user-guide\/","title":{"rendered":"AT Command Getting Started Guide"},"content":{"rendered":"<p>mDots<sup>\u2122\u00a0<\/sup>are pre-loaded with custom AT Command firmware, which turns the serial interface into a command port for configuring the mDot. You can use this firmware to test LoRa connections and to develop production applications where a host processor issues AT commands to the mDot.<\/p>\n<p>The AT Command Firmware is a convenient wrapper around <a href=\"https:\/\/developer.mbed.org\/teams\/MultiTech\/code\/libmDot\/\">libmDot<\/a>, our mbed LoRa API. The source code is <a href=\"https:\/\/developer.mbed.org\/teams\/MultiTech\/code\/mDot_AT_firmware\/\">available on mbed<\/a> where you can easily fork and customize it as needed.<\/p>\n<p>For the AT Command Reference Guide, go to the Guides section at <a href=\"https:\/\/www.multitech.net\/developer\/products\/multiconnect-mdot\/\">mDot<\/a><\/p>\n<h3>AT Command List<\/h3>\n<p>Documentation is accessible on the mDot with the <code>help<\/code> or <code>?<\/code> commands.<\/p>\n<pre class=\"brush:text\">help\r\nCommand Name       Description\r\nAT      Attention  Attention\r\nATI     Request Id Request Identification\r\nATZ     Reset CPU  Reset the CPU\r\n...<\/pre>\n<p>Get help for a single command using <code>help &lt;command&gt;<\/code>.<\/p>\n<pre class=\"brush:text\">help AT+JOIN\r\nAT+JOIN: Join network, provide argument of `1` to force join ...<\/pre>\n<h3>Using Commands<\/h3>\n<h4>Querying<\/h4>\n<p>Some commands allow you to query the current value. Enter the command name with no argument or followed by an optional ? to query a setting.<\/p>\n<ul>\n<li>Query a value.\n<pre class=\"brush:text\">AT+TXP\r\n11\r\n\r\nOK<\/pre>\n<\/li>\n<li>Query a value with optional ?.\n<pre class=\"brush:text\">AT+TXP?\r\n11\r\n\r\nOK<\/pre>\n<\/li>\n<\/ul>\n<h4>Assigning<\/h4>\n<p>Some commands allow you to assign a new value.<\/p>\n<ul>\n<li>To assign a new value pass the value as an argument.\n<pre class=\"brush:text\">AT+TXP=10\r\n\r\nOK<\/pre>\n<\/li>\n<li>To see a range of input or output values for a command give ? at the only argument.\n<pre class=\"brush:text\">AT+TXP=?\r\nAT+TXP: (0-20)\r\n\r\nOK<\/pre>\n<\/li>\n<\/ul>\n<h3>Examples<\/h3>\n<h4>Network ID and Network Key can be configured with a hexadecimal value or name\/passphrase.<\/h4>\n<ul>\n<li>To configure with a hexadecimal value provide a first argument of 0.\n<pre class=\"brush:text\">AT+NI=0,0011223344556677\r\n\r\nOK\r\nAT+NK=0,00112233445566770011223344556677\r\n\r\nOK<\/pre>\n<\/li>\n<li>To configure with a name\/passphrase value provide a first argument of 1. When using this option, the name and passphrase are converted to hexadecimal values behind the scenes.\n<pre class=\"brush:text\">AT+NI=1,MTS-LORA-1\r\n\r\nOK\r\nAT+NK=1,MTS-LORA-PASSPHRASE\r\n\r\nOK<\/pre>\n<\/li>\n<\/ul>\n<h4>Before joining to a Conduit<sup>\u00ae\u00a0<\/sup>using the US 915 band, you must set the frequency sub-band to join using the frequencies the Conduit is configured to listen on (which set of 8 from the 64 available channels).<\/h4>\n<ul>\n<li>To configure the frequency sub-band\n<pre class=\"brush:text\">AT+FSB=5\r\n\r\nOK<\/pre>\n<\/li>\n<\/ul>\n<h4>The mDot supports over-the-air (OTA) and manual join modes.<\/h4>\n<ul>\n<li>To configure for OTA join mode and connect to the network\n<pre class=\"brush:text\">AT+NJM=1\r\n\r\nOK\r\nAT+JOIN\r\n\r\nOK<\/pre>\n<\/li>\n<li>To configure for AUTO OTA join mode and connect to the network, if you are not already joined, a join attempt will be made\n<pre class=\"brush:text\">AT+NJM=2\r\n\r\nOK\r\nJoining Network... Network Joined\r\n\r\nOK<\/pre>\n<\/li>\n<li>To configure for MANUAL provisioning, change the mode, then set the network address and session keys (in OTA, the session keys are automatically created during the join process).\n<pre class=\"brush:text\">AT+NJM=0\r\n\r\nOK\r\nAT+NA=0011223344556677\r\n\r\nOK\r\nAT+DSK=00112233445566770011223344556677\r\n\r\nOK\r\nAT+NSK=00112233445566770011223344556677\r\n\r\nOK<\/pre>\n<\/li>\n<\/ul>\n<p><em>For more information, see <a href='https:\/\/www.multitech.net\/developer\/software\/mdot-software\/network-join-modes\/' title='Network Join Modes'>Network Join Modes<\/a> and <a href='https:\/\/www.multitech.net\/developer\/software\/mdot-software\/mdot-connecting-to-a-network\/' title='Connecting to a Network'>Connecting to a Network<\/a>.<\/em><\/p>\n<h4>Ensuring Network Connectivity<\/h4>\n<p>The network join status command (<code>AT+NJS<\/code>) returns a boolean value indicating network connectivity. However, the mDot can only detect a network loss by failing to receive a response from the server.\u00a0 One method is to require ACKs for each packet, but under heavy load the server may be unable to respond. The other method is to only require an ACK periodically using <code>AT+LCC<\/code> which reduces the network load but still allows the mDot to detect network failures. Additionally, the link check threshold (<code>AT+LCT<\/code>) determines how many missed responses determine a network loss. In the following examples the gateway will be powered off to simulate loss of network.<\/p>\n<ul>\n<li>Method one: require ACKs for each packet. With a threshold of one, after only one lost packet the network will no longer be joined. Increasing the value for LCT will allow some missed packets without having to rejoin the network. If AUTO OTA is enabled the device will attempt to rejoin after network is lost.\n<pre class=\"brush:text\">[Gateway Powered On]\r\nAT+JOIN\r\nSuccessfully joined network\r\n\r\nOK\r\nAT+ACK=1\r\n\r\nOK\r\nAT+LCT=1\r\n\r\nOK\r\nAT+SEND=message\r\n\r\nOK\r\n[Gateway Powered Off]\r\nAT+NJS\r\n1\r\n\r\nOK\r\nAT+SEND=message\r\nOperation Timed Out - ACK not received\r\n\r\nOK\r\nAT+NJS\r\n0\r\n\r\nOK<\/pre>\n<\/li>\n<li>Method two: only require ACKs periodically by using link checks. <code>AT+LCC<\/code> set to 2 will request a server response for every other transmitted packet. With a threshold of one, after only one missed response the network will no longer be joined. Increasing the value for LCT will allow some missed packets without having to rejoin the network. If AUTO OTA is enabled the device will attempt to rejoin after network is lost.\n<pre class=\"brush:text\">[Gateway Powered On]\r\nAT+JOIN\r\nSuccessfully joined network\r\n\r\nOK\r\nAT+LCC=2\r\n\r\nOK\r\nAT+LCT=1\r\n\r\nOK\r\nAT+SEND=message\r\n\r\nOK\r\n[Gateway Powered Off]\r\nAT+SEND=message\r\n\r\nOK\r\nAT+NJS\r\n1\r\n\r\nOK\r\nAT+SEND=message\r\nNetwork Not Joined\r\n\r\nERROR\r\nAT+NJS\r\n0\r\n\r\nOK<\/pre>\n<\/li>\n<\/ul>\n<h4>Serial Data Mode<\/h4>\n<p>The Serial Data mode is designed to work in conjunction with sleep where the mDot wakes up periodically, signals a host, reads data from the serial port, and then transmits it. The mDot can be configured to wake up on a fixed time interval or on an interrupt triggered by the DIO7 pin. When the mDot wakes up in serial data mode, it sets the XBEE_ON_SLEEP pin so the host processor knows when to start transmitting serial data.<\/p>\n<p>This is the basic setup after configuring network settings:<\/p>\n<ol>\n<li>Set to wake-up on interval (0:INTERVAL, 1:INTERRUPT)\n<pre class=\"brush:text\">AT+WM=0<\/pre>\n<\/li>\n<li>Set wake interval for 10 minutes\n<pre class=\"brush:text\">AT+WI=600<\/pre>\n<\/li>\n<li>Wait for serial data for 500 ms\n<pre class=\"brush:text\">AT+WD=500<\/pre>\n<\/li>\n<li>Timeout reading serial if no character for 20 ms\n<pre class=\"brush:text\">AT+WTO=20<\/pre>\n<\/li>\n<li>Enable auto-join mode to join on start and save session info in flash\n<pre class=\"brush:text\">AT+NJM=2<\/pre>\n<\/li>\n<li>Configure ACK\u2019s or set LCC to send periodic link checks\n<pre class=\"brush:text\">AT+ACK=4 (make 4 attempts to get response from server)\r\nor\r\nAT+LCC=5 (request response every 5 packets)<\/pre>\n<\/li>\n<li>Set number of missed responses to consider link dead and rejoin\n<pre class=\"brush:text\">AT+LCT=10<\/pre>\n<\/li>\n<li>Configure the mDot to start in Serial Data mode\n<pre class=\"brush:text\">AT+SMODE=1<\/pre>\n<\/li>\n<li>Save changes\n<pre class=\"brush:text\">AT&amp;W<\/pre>\n<\/li>\n<\/ol>\n<p>Now if you issue <code>AT+SD<\/code> or <code>ATZ<\/code> the mDot will enter the wake-read-send-sleep cycle and monitor responses from the server to stay connected.<\/p>\n<p>To escape out of serial data mode, hold <code>SHIFT<\/code> and <code>+<\/code> while pressing the reset button on the UDK. Once you see +&#8217;s being printed, press <code>ENTER<\/code>. The AT command interface should now be accessible.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>mDots\u2122\u00a0are pre-loaded with custom AT Command firmware, which turns the serial interface into a command port for configuring the mDot. You can use this firmware to test LoRa connections and to develop production applications where a host processor issues AT commands to the mDot. The AT Command Firmware is a convenient wrapper around libmDot, our [&hellip;]<\/p>\n","protected":false},"author":1235,"featured_media":0,"parent":8383,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-9894","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/9894","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/users\/1235"}],"replies":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/comments?post=9894"}],"version-history":[{"count":56,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/9894\/revisions"}],"predecessor-version":[{"id":28596,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/9894\/revisions\/28596"}],"up":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/8383"}],"wp:attachment":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/media?parent=9894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}