<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>seeeduino &#8211; Squix &#8211; TechBlog</title>
	<atom:link href="https://blog.squix.org/tag/seeeduino/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.squix.org</link>
	<description></description>
	<lastBuildDate>Sun, 26 Nov 2017 07:10:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.8</generator>
<site xmlns="com-wordpress:feed-additions:1">121913304</site>	<item>
		<title>Using Seeeduino LoRaWAN with GPS and Loriot.io</title>
		<link>https://blog.squix.org/2017/11/using-seeeduino-lorawan-with-gps-and-loriot-io.html</link>
					<comments>https://blog.squix.org/2017/11/using-seeeduino-lorawan-with-gps-and-loriot-io.html#comments</comments>
		
		<dc:creator><![CDATA[Daniel Eichhorn]]></dc:creator>
		<pubDate>Wed, 22 Nov 2017 15:46:16 +0000</pubDate>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[LoRaWAN]]></category>
		<category><![CDATA[lorawan]]></category>
		<category><![CDATA[loriot]]></category>
		<category><![CDATA[seeedstudio]]></category>
		<category><![CDATA[seeeduino]]></category>
		<guid isPermaLink="false">https://blog.squix.org/?p=3784</guid>

					<description><![CDATA[In the first blog post blog post in this series I showed you how can configure the Seeeduino LoRaWAN module to connect it to TheThingsNetwork (TTN). The second post showed you how the LoRaWAN message can be sent to a Google Spreadsheet. Now this post goes one ... <p><a class="read-more btn btn-secondary" href="https://blog.squix.org/2017/11/using-seeeduino-lorawan-with-gps-and-loriot-io.html">Read More</a></p>]]></description>
										<content:encoded><![CDATA[<p>In the <a href="https://blog.squix.org/2017/07/seeeduino-lora-gps-getting-started-with-lorawan-and-ttn.html" target="_blank" rel="noopener">first blog post blog</a> post in this series I showed you how can configure the <a href="https://blog.squix.org/go/seeedstudio-lorawan-gps" target="_blank" rel="noopener">Seeeduino LoRaWAN module</a> to connect it to TheThingsNetwork (TTN). The <a href="https://blog.squix.org/2017/07/thethingsnetwork-how-to-use-google-spreadsheet-to-log-data.html" target="_blank" rel="noopener">second post</a> showed you how the LoRaWAN message can be sent to a Google Spreadsheet. Now this post goes one step further and uses the GPS module in the Seeeduino to post the coordinates together with humidity and temperature to a Google Spreadsheet. We then visualize the coordinates on Google Maps. To make it even more interesting decided to replace the TTN backend with the backend of a Swiss startup called Loriot.io. They offer a free service where you have to connect one LoRaWAN gateway in order to participate.</p>
<p><span id="more-3784"></span></p>
<h2>Setting up a Loriot.io Account</h2>
<p>Loriot.io is a cool Swiss startup located close to Zurich and they are proving the infrastructure for LoRaWAN applications. Beside their commercial offerings they also have a service which doesn&#8217;t cost you anything. But in return you have to contribute to the network by connecting your own LoRaWAN gateway. I&#8217;m not going into detail here how to do that but here is some additional information: I configured my existing TTN gatway with a Raspberry Pi Zero W and a IMST IC880A concentrator to forward packages also to the Loriot network. In order to do that I just had to alter the local_conf.json file: Loriot uses a slightly different gateway ID (with FFFF in the middle, the default with TTN is FFFE). I also had to add the Loriot servers to the same configuration file:</p>
<pre>{
        "gateway_conf": {
                "gateway_ID": "XXXXXXFFFFXXXXXX",
                "servers": [
                  {
                        "server_address": "router.eu.thethings.network",
                        "serv_port_up": 1700,
                        "serv_port_down": 1700,
                        "serv_enabled": true
                },
                {
                        "server_address": "eu1.loriot.io",
                        "serv_port_up": 1780,
                        "serv_port_down": 1780,
                        "serv_enabled": true,
                        "keepalive_interval": 10,
                        "stat_interval": 30,
                        "push_timeout_ms": 100,

                        "forward_crc_valid": true,
                        "forward_crc_error": false,
                        "forward_crc_disabled": false
                }],
                "ref_latitude": 0,
                "ref_longitude": 0,
                "ref_altitude": 0,
                "contact_email": "",
                "description": "ttn-ic880a"
        }
}
</pre>
<p>After that you can create a free account on the <a href="https://loriot.io/" target="_blank" rel="noopener">Loriot.io page</a>. Now setup the gateway and place the created ID in the local_conf.json file, assuming that you are using a similar setup like mine (I&#8217;m using a semtek packet forwarder). Now you can switch to the &#8220;Application&#8221; menu and select the &#8220;Sample Application&#8221;. Now click on &#8220;Enroll device&#8221;:</p>
<p><a href="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.22.55.png?ssl=1"><img data-recalc-dims="1" fetchpriority="high" decoding="async" data-attachment-id="3786" data-permalink="https://blog.squix.org/2017/11/using-seeeduino-lorawan-with-gps-and-loriot-io.html/screen-shot-2017-11-22-at-16-22-55" data-orig-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.22.55.png?fit=3330%2C1030&amp;ssl=1" data-orig-size="3330,1030" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Loriot Device enrolment" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.22.55.png?fit=300%2C93&amp;ssl=1" data-large-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.22.55.png?fit=730%2C226&amp;ssl=1" class="alignnone wp-image-3786 size-large" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.22.55.png?resize=730%2C226&#038;ssl=1" alt="" width="730" height="226" srcset="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.22.55.png?resize=1024%2C317&amp;ssl=1 1024w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.22.55.png?resize=300%2C93&amp;ssl=1 300w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.22.55.png?resize=768%2C238&amp;ssl=1 768w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.22.55.png?w=1460&amp;ssl=1 1460w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.22.55.png?w=2190&amp;ssl=1 2190w" sizes="(max-width: 730px) 100vw, 730px" /></a></p>
<p>Enter your device ID in the form field and click &#8220;Enroll OTAA / ABP device&#8221;. In the first post I showed you how to figure out the device ID. Now navigate to &#8220;Devices&#8221; and click on the newly created device. Here you can find the DevEUI, AppEUI and AppKey which you&#8217;ll have to use in the next paragraph.</p>
<p>&nbsp;</p>
<h2>Setting up the Seeeduino Code</h2>
<p>In order to have the Seeeduino read out the GPS coordinates and the temperature and humidity we have to install two libraries. Download the TinyGpsPlus library from <a href="http://arduiniana.org/libraries/tinygpsplus/">http://arduiniana.org/libraries/tinygpsplus/</a> Then install also the DHT library from Adafruit from the library manager under Sketch &gt; Include Library &gt; Library Manager&#8230; Menu. Copy the code you previously generated in the Loriot.io interface when adding a new device.</p>
<pre>//Download http://arduiniana.org/libraries/tinygpsplus/
#include &lt;TinyGPS++.h&gt;
#include &lt;LoRaWan.h&gt;
#include "DHT.h"


TinyGPSPlus gps;
#define DHTPIN A0 // what pin we're connected to

#define DHTTYPE DHT11 // DHT 11
 
DHT dht(DHTPIN, DHTTYPE);
char buffer[256];


void setup(void)
{
    SerialUSB.begin(115200);
    Serial.begin(9600);
    
    lora.init();
    
    memset(buffer, 0, 256);
    lora.getVersion(buffer, 256, 1);
    SerialUSB.print(buffer); 
    
    memset(buffer, 0, 256);
    lora.getId(buffer, 256, 1);
    SerialUSB.print(buffer);
    SerialUSB.println("That was the id");
    // void setId(char *DevAddr, char *DevEUI, char *AppEUI);
    lora.setId(NULL, "XXX", "XXX");
    // setKey(char *NwkSKey, char *AppSKey, char *AppKey);
    lora.setKey(NULL, NULL, "XXX");
    
    lora.setDeciveMode(LWOTAA);
    lora.setDataRate(DR0, EU868);
    
    lora.setChannel(0, 868.1);
    lora.setChannel(1, 868.3);
    lora.setChannel(2, 868.5);
    lora.setChannel(3, 867.1);
    lora.setChannel(4, 867.3);
    lora.setChannel(5, 867.5);
    lora.setChannel(6, 867.7);
    
    lora.setReceiceWindowFirst(0);
    lora.setReceiceWindowSecond(869.5, DR3);
    lora.setAdaptiveDataRate(false);
    
    lora.setPower(20);
    
    while(!lora.setOTAAJoin(JOIN, 20000));
    SerialUSB.println("After OTAA join");

    // Start DHT sensor
    dht.begin();
}

void loop(void)
{   
    while (Serial.available() &gt; 0) {
      gps.encode(Serial.read());
    }
    if (gps.altitude.isUpdated()) {
      SerialUSB.println(gps.altitude.meters());
      SerialUSB.print("LAT=");  SerialUSB.println(gps.location.lat(), 6);
      SerialUSB.print("LONG="); SerialUSB.println(gps.location.lng(), 6);
      SerialUSB.print("ALT=");  SerialUSB.println(gps.altitude.meters());
      long latEncoded = (gps.location.lat() * 8388606) / 90;
      long lonEncoded = (gps.location.lng() * 8388606) / 180;
      SerialUSB.print("Lat encoded: "); 
      SerialUSB.println(latEncoded);
      SerialUSB.print("Lon encoded: "); 
      SerialUSB.println(lonEncoded);
      float h = dht.readHumidity();
      float t = dht.readTemperature();
      SerialUSB.print("Humidity is: ");
      SerialUSB.print(h);
      SerialUSB.print(", Temperature: ");
      SerialUSB.print(t);
      bool result = false;
      byte data[10] = {0};
      data[0] = h;
      data[1] = t + 100;
      data[2] = (byte) (latEncoded &gt;&gt; 16);
      data[3] = (byte) (latEncoded &gt;&gt; 8);
      data[4] = (byte) latEncoded;
      
      data[5] = (byte) (lonEncoded &gt;&gt; 16);
      data[6] = (byte) (lonEncoded &gt;&gt; 8);
      data[7] = (byte) lonEncoded;

      result = lora.transferPacket(data, 10);
      //result = lora.transferPacket(data, 10, 10);
      
      if(result)
      {
          short length;
          short rssi;
          
          memset(buffer, 0, 256);
          length = lora.receivePacket(buffer, 256, &amp;rssi);
          
          if(length)
          {
              SerialUSB.print("Length is: ");
              SerialUSB.println(length);
              SerialUSB.print("RSSI is: ");
              SerialUSB.println(rssi);
              SerialUSB.print("Data is: ");
              for(unsigned char i = 0; i &lt; length; i ++)
              {
                  SerialUSB.print("0x");
                  SerialUSB.print(buffer[i], HEX);
                  SerialUSB.print(" ");
              }
              SerialUSB.println();
          }
          delay(1000 * 60 * 5);
      }
    }
    
}


</pre>
<h2>Setting Up the Spreadsheet</h2>
<p>Log into your Google Docs account and create an new Spreadsheet</p>
<p>Give the Spreadsheet a meaningful name, e.g. LoriotLogger</p>
<p>You might also want to add the column headers:</p>
<table dir="ltr" border="1" cellspacing="0" cellpadding="0">
<colgroup>
<col width="100" />
<col width="100" />
<col width="171" />
<col width="235" />
<col width="100" />
<col width="100" />
<col width="100" />
<col width="100" />
<col width="100" />
<col width="100" />
<col width="100" />
<col width="100" />
<col width="100" />
<col width="100" />
<col width="100" />
<col width="100" />
<col width="100" /></colgroup>
<tbody>
<tr>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;rssi&quot;}">rssi</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;seqno&quot;}">seqno</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;data&quot;}">data</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;humidity&quot;}">humidity</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;temp&quot;}">temp</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;lat&quot;}">lat</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;lon&quot;}">lon</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;freq&quot;}">freq</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;ack&quot;}">ack</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;fcnt&quot;}">fcnt</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;dr&quot;}">dr</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;bat&quot;}">bat</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;port&quot;}">port</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;snr&quot;}">snr</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;EUI&quot;}">EUI</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;cmc&quot;}">cmc</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;ts&quot;}">ts</td>
</tr>
</tbody>
</table>
<p>Copy/paste them from here and insert them before all other rows.</p>
<p>Then go to Tools &gt; Script Editor&#8230;</p>
<p><a href="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ToolsScriptEditor.png?ssl=1"><img data-recalc-dims="1" decoding="async" data-attachment-id="2738" data-permalink="https://blog.squix.org/2017/07/thethingsnetwork-how-to-use-google-spreadsheet-to-log-data.html/toolsscripteditor" data-orig-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ToolsScriptEditor.png?fit=1120%2C602&amp;ssl=1" data-orig-size="1120,602" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ToolsScriptEditor" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ToolsScriptEditor.png?fit=300%2C161&amp;ssl=1" data-large-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ToolsScriptEditor.png?fit=730%2C392&amp;ssl=1" class="size-medium wp-image-2738 alignnone" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ToolsScriptEditor.png?resize=300%2C161&#038;ssl=1" alt="" width="300" height="161" srcset="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ToolsScriptEditor.png?resize=300%2C161&amp;ssl=1 300w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ToolsScriptEditor.png?resize=768%2C413&amp;ssl=1 768w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ToolsScriptEditor.png?resize=1024%2C550&amp;ssl=1 1024w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ToolsScriptEditor.png?w=1120&amp;ssl=1 1120w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Replace the few lines of code with the code below:</p>
<pre>// 2017 by Daniel Eichhorn, https://blog.squix.org
// Inspired by https://gist.github.com/bmcbride/7069aebd643944c9ee8b
// Create or open an existing Sheet and click Tools &gt; Script editor and enter the code below
// 1. Enter sheet name where data is to be written below
var SHEET_NAME = "Sheet1";
// 2. Publish &gt; Deploy as web app
//    - enter Project Version name and click 'Save New Version'
//    - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously)
// 3. Copy the 'Current web app URL' and post this in your form/script action

var SCRIPT_PROP = PropertiesService.getScriptProperties(); // new property service

// If you don't want to expose either GET or POST methods you can comment out the appropriate function
function doGet(e){
  return handleResponse(e);
}

function doPost(e){
  return handleResponse(e);
}

function handleResponse(e) {
  Logger.log("arrived in handleResponse");
  var jsonData = JSON.parse(e.postData.contents);
  
  try {
    // next set where we write the data - you could write to multiple/alternate destinations
    var doc = SpreadsheetApp.openById(SCRIPT_PROP.getProperty("key"));
    var sheet = doc.getSheetByName(SHEET_NAME); 

    var nextRow = sheet.getLastRow()+1; // get next row
    var row = [];
    var headerRow = [];

    row.push(jsonData.rssi);
    row.push(jsonData.seqno);
    row.push(jsonData.data);
    var humidityHex = jsonData.data.substring(0, 2);
    row.push(parseInt(humidityHex, 16));
    var tempHex = jsonData.data.substring(2, 4);
    row.push(parseInt(tempHex, 16) - 100);
    var latHex = jsonData.data.substring(4, 10);
    var lonHex = jsonData.data.substring(10, 16);
    var latEncoded = parseInt(latHex, 16);
    var lonEncoded = parseInt(lonHex, 16);
    row.push((latEncoded / 8388606) * 90);
    row.push((lonEncoded / 8388606) * 180);

    row.push(jsonData.freq);
    row.push(jsonData.ack);
    row.push(jsonData.fcnt);
    row.push(jsonData.dr);
    row.push(jsonData.bat);
    row.push(jsonData.port);
    row.push(jsonData.snr);
    row.push(jsonData.EUI);
    row.push(jsonData.cmd);
    row.push(jsonData.ts);

    // more efficient to set values as [][] array than individually
    sheet.getRange(nextRow, 1, 1, row.length).setValues([row]);
    // return json success results
    return ContentService
          .createTextOutput(JSON.stringify({"result":"success", "row": nextRow}))
          .setMimeType(ContentService.MimeType.JSON);
  } catch(e) {
    // if error return this
    return ContentService
          .createTextOutput(JSON.stringify({"result":"error", "error": e}))
          .setMimeType(ContentService.MimeType.JSON);
  } 
}


</pre>
<p><a href="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANLoggerScriptEditor.png?ssl=1"><img data-recalc-dims="1" decoding="async" data-attachment-id="2737" data-permalink="https://blog.squix.org/2017/07/thethingsnetwork-how-to-use-google-spreadsheet-to-log-data.html/lorawanloggerscripteditor" data-orig-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANLoggerScriptEditor.png?fit=2396%2C968&amp;ssl=1" data-orig-size="2396,968" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="LoRaWANLoggerScriptEditor" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANLoggerScriptEditor.png?fit=300%2C121&amp;ssl=1" data-large-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANLoggerScriptEditor.png?fit=730%2C295&amp;ssl=1" class="alignnone wp-image-2737 size-large" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANLoggerScriptEditor.png?resize=730%2C295&#038;ssl=1" alt="" width="730" height="295" srcset="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANLoggerScriptEditor.png?resize=1024%2C414&amp;ssl=1 1024w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANLoggerScriptEditor.png?resize=300%2C121&amp;ssl=1 300w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANLoggerScriptEditor.png?resize=768%2C310&amp;ssl=1 768w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANLoggerScriptEditor.png?w=1460&amp;ssl=1 1460w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANLoggerScriptEditor.png?w=2190&amp;ssl=1 2190w" sizes="(max-width: 730px) 100vw, 730px" /></a></p>
<p>Publish &gt; Deploy as web app</p>
<ul>
<li>enter Project Version name and click &#8216;Save New Version&#8217;</li>
<li>set security level and enable service (most likely execute as &#8216;me&#8217; and access &#8216;anyone, even anonymously)</li>
<li>Copy the &#8216;Current web app URL&#8217; and post this in your form/script action</li>
</ul>
<p><a href="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/PublishDialog.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" data-attachment-id="2736" data-permalink="https://blog.squix.org/2017/07/thethingsnetwork-how-to-use-google-spreadsheet-to-log-data.html/publishdialog" data-orig-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/PublishDialog.png?fit=918%2C836&amp;ssl=1" data-orig-size="918,836" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="PublishDialog" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/PublishDialog.png?fit=300%2C273&amp;ssl=1" data-large-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/PublishDialog.png?fit=730%2C665&amp;ssl=1" class="size-medium wp-image-2736 alignnone" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/PublishDialog.png?resize=300%2C273&#038;ssl=1" alt="" width="300" height="273" srcset="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/PublishDialog.png?resize=300%2C273&amp;ssl=1 300w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/PublishDialog.png?resize=768%2C699&amp;ssl=1 768w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/PublishDialog.png?w=918&amp;ssl=1 918w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Give permissions to the script:</p>
<p><a href="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ReviewPermissions.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" data-attachment-id="2735" data-permalink="https://blog.squix.org/2017/07/thethingsnetwork-how-to-use-google-spreadsheet-to-log-data.html/reviewpermissions" data-orig-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ReviewPermissions.png?fit=1022%2C358&amp;ssl=1" data-orig-size="1022,358" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ReviewPermissions" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ReviewPermissions.png?fit=300%2C105&amp;ssl=1" data-large-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ReviewPermissions.png?fit=730%2C256&amp;ssl=1" class="size-medium wp-image-2735 alignnone" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ReviewPermissions.png?resize=300%2C105&#038;ssl=1" alt="" width="300" height="105" srcset="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ReviewPermissions.png?resize=300%2C105&amp;ssl=1 300w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ReviewPermissions.png?resize=768%2C269&amp;ssl=1 768w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/ReviewPermissions.png?w=1022&amp;ssl=1 1022w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Copy the URL:</p>
<p><a href="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/DeployAsWebAppURL.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" data-attachment-id="2734" data-permalink="https://blog.squix.org/2017/07/thethingsnetwork-how-to-use-google-spreadsheet-to-log-data.html/deployaswebappurl" data-orig-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/DeployAsWebAppURL.png?fit=910%2C558&amp;ssl=1" data-orig-size="910,558" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="DeployAsWebAppURL" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/DeployAsWebAppURL.png?fit=300%2C184&amp;ssl=1" data-large-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/DeployAsWebAppURL.png?fit=730%2C448&amp;ssl=1" class="size-medium wp-image-2734 alignnone" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/DeployAsWebAppURL.png?resize=300%2C184&#038;ssl=1" alt="" width="300" height="184" srcset="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/DeployAsWebAppURL.png?resize=300%2C184&amp;ssl=1 300w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/DeployAsWebAppURL.png?resize=768%2C471&amp;ssl=1 768w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/DeployAsWebAppURL.png?resize=908%2C558&amp;ssl=1 908w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/DeployAsWebAppURL.png?w=910&amp;ssl=1 910w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>&nbsp;</p>
<h2>Connecting Loriot with your Google Spreadsheet</h2>
<p>Switch again to the Loriot page in your browser. Navigate to the Sample App &gt; Output page:</p>
<p><a href="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.31.23.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" data-attachment-id="3787" data-permalink="https://blog.squix.org/2017/11/using-seeeduino-lorawan-with-gps-and-loriot-io.html/screen-shot-2017-11-22-at-16-31-23" data-orig-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.31.23.png?fit=2050%2C1002&amp;ssl=1" data-orig-size="2050,1002" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2017-11-22 at 16.31.23" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.31.23.png?fit=300%2C147&amp;ssl=1" data-large-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.31.23.png?fit=730%2C357&amp;ssl=1" class="alignnone wp-image-3787 size-large" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.31.23.png?resize=730%2C357&#038;ssl=1" alt="" width="730" height="357" srcset="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.31.23.png?resize=1024%2C501&amp;ssl=1 1024w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.31.23.png?resize=300%2C147&amp;ssl=1 300w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.31.23.png?resize=768%2C375&amp;ssl=1 768w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.31.23.png?w=1460&amp;ssl=1 1460w" sizes="(max-width: 730px) 100vw, 730px" /></a></p>
<p>Click on the &#8220;Change button&#8221; and select HTTP Push. Now enter the address from Google Docs, when you published the app. Done, Loriot should now send the data to Google Docs! <strong>One Note:</strong> I was logged into two google accounts at the same time, so my URL generated had an additional &#8220;/u/1&#8221; and it started with https://script.google.com/macros/u/1/XXX. If your URL looks like this then remove the /u/1/ from the URL.</p>
<p>&nbsp;</p>
<h2>Starting the Seeduino</h2>
<p>Now let&#8217;s see if the data arrives!</p>
<p><a href="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.36.31.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" data-attachment-id="3788" data-permalink="https://blog.squix.org/2017/11/using-seeeduino-lorawan-with-gps-and-loriot-io.html/screen-shot-2017-11-22-at-16-36-31" data-orig-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.36.31.png?fit=2144%2C1002&amp;ssl=1" data-orig-size="2144,1002" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2017-11-22 at 16.36.31" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.36.31.png?fit=300%2C140&amp;ssl=1" data-large-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.36.31.png?fit=730%2C341&amp;ssl=1" class="alignnone wp-image-3788 size-large" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.36.31.png?resize=730%2C341&#038;ssl=1" alt="" width="730" height="341" srcset="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.36.31.png?resize=1024%2C479&amp;ssl=1 1024w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.36.31.png?resize=300%2C140&amp;ssl=1 300w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.36.31.png?resize=768%2C359&amp;ssl=1 768w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.36.31.png?w=1460&amp;ssl=1 1460w" sizes="(max-width: 730px) 100vw, 730px" /></a></p>
<p>Hurray!</p>
<p>&nbsp;</p>
<h2>Visualize the data on Google Maps</h2>
<p>Now to the finishing: let&#8217;s put the markers on a map! Google Spreadsheets only have very simple maps so navigate to <a href="https://www.google.com/maps/d/u/0/" target="_blank" rel="noopener">https://www.google.com/maps/d/u/0/</a>.</p>
<p>In the left menu select &#8220;Import&#8221; and select your Spreadsheet from Google drive.</p>
<p><a href="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.40.58.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" data-attachment-id="3789" data-permalink="https://blog.squix.org/2017/11/using-seeeduino-lorawan-with-gps-and-loriot-io.html/screen-shot-2017-11-22-at-16-40-58" data-orig-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.40.58.png?fit=626%2C742&amp;ssl=1" data-orig-size="626,742" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2017-11-22 at 16.40.58" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.40.58.png?fit=253%2C300&amp;ssl=1" data-large-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.40.58.png?fit=626%2C742&amp;ssl=1" class="alignnone size-medium wp-image-3789" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.40.58.png?resize=253%2C300&#038;ssl=1" alt="" width="253" height="300" srcset="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.40.58.png?resize=253%2C300&amp;ssl=1 253w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.40.58.png?w=626&amp;ssl=1 626w" sizes="(max-width: 253px) 100vw, 253px" /></a></p>
<p>Now select the &#8220;lat&#8221; and &#8220;lon&#8221; column as the coordinate columns and the seqno column for the title. Create the map and you get a wonderful representation of your geo fixes, sent over LoRaWan to Loriot.io, from there to a App Script instance, which inserted the data into a spreadsheet, and from there you imported the data into a map! Wow! If you got it to work you really made it!</p>
<p><a href="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.45.16.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" data-attachment-id="3790" data-permalink="https://blog.squix.org/2017/11/using-seeeduino-lorawan-with-gps-and-loriot-io.html/screen-shot-2017-11-22-at-16-45-16" data-orig-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.45.16.png?fit=2318%2C1344&amp;ssl=1" data-orig-size="2318,1344" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2017-11-22 at 16.45.16" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.45.16.png?fit=300%2C174&amp;ssl=1" data-large-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.45.16.png?fit=730%2C423&amp;ssl=1" class="alignnone wp-image-3790 size-large" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.45.16.png?resize=730%2C423&#038;ssl=1" alt="" width="730" height="423" srcset="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.45.16.png?resize=1024%2C594&amp;ssl=1 1024w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.45.16.png?resize=300%2C174&amp;ssl=1 300w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.45.16.png?resize=768%2C445&amp;ssl=1 768w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.45.16.png?w=1460&amp;ssl=1 1460w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-16.45.16.png?w=2190&amp;ssl=1 2190w" sizes="(max-width: 730px) 100vw, 730px" /></a></p>
<p>Do you have questions about this post? Go over to <a href="https://support.squix.org" target="_blank" rel="noopener">https://support.squix.org</a> and place it there so everyone can profit!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.squix.org/2017/11/using-seeeduino-lorawan-with-gps-and-loriot-io.html/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3784</post-id>	</item>
		<item>
		<title>Seeeduino LoRa GPS: Getting Started with LoRaWAN (and TTN)</title>
		<link>https://blog.squix.org/2017/07/seeeduino-lora-gps-getting-started-with-lorawan-and-ttn.html</link>
					<comments>https://blog.squix.org/2017/07/seeeduino-lora-gps-getting-started-with-lorawan-and-ttn.html#comments</comments>
		
		<dc:creator><![CDATA[Daniel Eichhorn]]></dc:creator>
		<pubDate>Mon, 24 Jul 2017 19:17:36 +0000</pubDate>
				<category><![CDATA[IoT Products]]></category>
		<category><![CDATA[LoRaWAN]]></category>
		<category><![CDATA[gateway]]></category>
		<category><![CDATA[lorawan]]></category>
		<category><![CDATA[seeeduino]]></category>
		<category><![CDATA[thethingsnetwork]]></category>
		<category><![CDATA[ttn]]></category>
		<guid isPermaLink="false">https://blog.squix.org/?p=2698</guid>

					<description><![CDATA[In the last couple of months I had the chance to play around with LoRaWAN. In case you have never heard of LoRaWAN, it is THE radio communication protocol for the Internet of Things (IoT). It is long range (thus LoRa) and consumes only little ... <p><a class="read-more btn btn-secondary" href="https://blog.squix.org/2017/07/seeeduino-lora-gps-getting-started-with-lorawan-and-ttn.html">Read More</a></p>]]></description>
										<content:encoded><![CDATA[<p>In the last couple of months I had the chance to play around with LoRaWAN. In case you have never heard of LoRaWAN, it is THE radio communication protocol for the Internet of Things (IoT). It is long range (thus LoRa) and consumes only little energy when transmitting. This guide will help you to get a <a href="https://blog.squix.org/go/seeedstudio-lorawan-gps" target="_blank" rel="noopener">Seeedstudio Seeeduino LoRa GPS</a> to TheThingsNetwork.<span id="more-2698"></span></p>
<p>TheThingsNetwork (TTN) is a community driven communication infrastructure currently using the LoRaWAN protocol. This means that instead of paying fees for your local Telecom provider you can connect your devices for free to the internet. Provided that there is already coverage of TTN in your area. <a href="https://www.thethingsnetwork.org/map" target="_blank" rel="noopener">This map</a> can give you an indication if you already have coverage. Otherwise don&#8217;t worry, for little money you can become a infrastructure provider yourself. You can build a &#8220;real&#8221; multi-channel gateway (something like a WiFi access point) for about 200-300$. And a single channel gateway can be built for as little as USD $15 (watch <a href="https://www.youtube.com/watch?v=ZV_ZY-0Q1lo" target="_blank" rel="noopener">this Video</a> from my fellow countryman Andreas Spiess). But this post is not about the infrastructure, it is about getting one specific LoRa hardware connected and this is more complicated than you think (the first time).</p>
<p>&nbsp;</p>
<h2>Arduino IDE setup</h2>
<p>This chapter is all about getting the programming environment ready for the Seeeduino. Since this might change you probably find most up-to-date information on the Seeeduino Wiki: <a href="http://wiki.seeed.cc/Seeeduino_LoRAWAN/" target="_blank" rel="noopener">http://wiki.seeed.cc/Seeeduino_LoRAWAN/</a>. Here a few quick steps:</p>
<ol>
<li>Download the latest Arduino IDE: <a href="https://www.arduino.cc/en/main/software" target="_blank" rel="noopener">https://www.arduino.cc/en/main/software</a></li>
<li>Go the preferences/settings and under &#8220;Additional Board Manager URLs&#8221; add the following URL: <a href="https://raw.githubusercontent.com/Seeed-Studio/Seeed_Platform/master/package_seeeduino_boards_index.json">https://raw.githubusercontent.com/Seeed-Studio/Seeed_Platform/master/package_seeeduino_boards_index.json</a> If you already have one add the new one separated by a comma</li>
<li>Now head to Tools &gt; Board &gt; Boards Manager and install the Seeeduino SAMD board.</li>
<li>On Windows you&#8217;ll have to install a Serial driver as well. On my Mac this wasn&#8217;t necessary</li>
<li>Now select in Tools &gt; Board the &#8220;Seeeduino LoRaWAN&#8221; board</li>
<li>Under File &gt; Examples &gt; LoRaWAN select the OTAA sample</li>
</ol>
<p>&nbsp;</p>
<h2>TheThingsNetwork setup</h2>
<p>As mentioned earlier TheThingsNetwork is your telecom provider you are going to use in this setup. There might be other providers in your country. In Switzerland we have <a href="http://lpn.swisscom.ch/e/">Swisscom LPN</a>, <a href="https://loriot.io/" target="_blank" rel="noopener">Loriot.io</a> (a cool Swiss startup with world wide infrastructure) and TTN. In this post we&#8217;re going to use TTN since it is free to use and relatively easy to setup.</p>
<p>LoRaWAN devices send with a broadcast, which means all LoRaWAN antennas from all providers are going to pick up your (encrypted) message. Only the provider with which the device is registered will forward the message to your application. The others will discard the message. The following steps show you how to register the Seeeduino with TTN. First create an account, then create an application and then register your device within this application:</p>
<ol>
<li>Go to <a href="https://www.thethingsnetwork.org/" target="_blank" rel="noopener">https://www.thethingsnetwork.org/</a> and register an account</li>
<li>Go to <a href="https://console.thethingsnetwork.org/" target="_blank" rel="noopener">https://console.thethingsnetwork.org/</a> and select &#8220;Application&#8221;</li>
<li>On the next screen click &#8220;+add application&#8221;</li>
<li>In the next screen pick a meaning full name for your application in lowercase letters for Application ID and write something in Description. Under Handler Registration pick your region, for Europe I have picked ttn-handler-eu</li>
<li>On the next screen click &#8220;register device&#8221;</li>
<li>For &#8220;Device ID&#8221; pick a meaningful name in lowercase letters</li>
<li>On the left side of the DevEUI field click on the arrow icons. The icon changes into a pen and this will cause the ID to be generated. This is necessary since the API doesn&#8217;t offer a way to read out the devices MAC address. See image below</li>
<li>In App EUI pick the ID of the application we created earlier</li>
</ol>
<p><a href="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/TTNAddApplication.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" data-attachment-id="2709" data-permalink="https://blog.squix.org/2017/07/seeeduino-lora-gps-getting-started-with-lorawan-and-ttn.html/ttnaddapplication" data-orig-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/TTNAddApplication.png?fit=2152%2C1164&amp;ssl=1" data-orig-size="2152,1164" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TTNAddApplication" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/TTNAddApplication.png?fit=300%2C162&amp;ssl=1" data-large-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/TTNAddApplication.png?fit=730%2C395&amp;ssl=1" class="aligncenter size-medium wp-image-2709" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/TTNAddApplication.png?resize=300%2C162&#038;ssl=1" alt="" width="300" height="162" srcset="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/TTNAddApplication.png?resize=300%2C162&amp;ssl=1 300w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/TTNAddApplication.png?resize=768%2C415&amp;ssl=1 768w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/TTNAddApplication.png?resize=1024%2C554&amp;ssl=1 1024w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/TTNAddApplication.png?resize=635%2C346&amp;ssl=1 635w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/TTNAddApplication.png?w=1460&amp;ssl=1 1460w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>&nbsp;</p>
<p><a href="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/RegisterSeeeduino.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" data-attachment-id="2713" data-permalink="https://blog.squix.org/2017/07/seeeduino-lora-gps-getting-started-with-lorawan-and-ttn.html/registerseeeduino" data-orig-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/RegisterSeeeduino.png?fit=1357%2C803&amp;ssl=1" data-orig-size="1357,803" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="RegisterSeeeduino" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/RegisterSeeeduino.png?fit=300%2C178&amp;ssl=1" data-large-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/RegisterSeeeduino.png?fit=730%2C432&amp;ssl=1" class="aligncenter size-medium wp-image-2713" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/RegisterSeeeduino.png?resize=300%2C178&#038;ssl=1" alt="" width="300" height="178" srcset="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/RegisterSeeeduino.png?resize=300%2C178&amp;ssl=1 300w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/RegisterSeeeduino.png?resize=768%2C454&amp;ssl=1 768w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/RegisterSeeeduino.png?resize=1024%2C606&amp;ssl=1 1024w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/RegisterSeeeduino.png?w=1357&amp;ssl=1 1357w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<h2>Adapting &amp; Running the Code</h2>
<p>Now it&#8217;s time to adapt the OTAA code. Replace the line lora.setKey(..) with the values below. I copied here also the signature of the two methods so you know which value you have to put there. setId(NULL, DevEUI, AppEUI) and setKey(NULL, NULL, AppKey):</p>
<pre>    // void setId(char *DevAddr, char *DevEUI, char *AppEUI);
    lora.setId(NULL, "12409E2345695432", "70B3D57EF0006593");
    // setKey(char *NwkSKey, char *AppSKey, char *AppKey);
    lora.setKey(NULL, NULL, "47BDA77B6D7B4DDA7DC182E54295FE4E");
</pre>
<p>Now make sure to select the Seeeduino under Tools &gt; Port and upload the sketch. If you are not owning a LoRaWAN gateway yourself but you think that one should be close then remove obstacles between you and that gateway. LoRaWAN can penetrate walls but how deep into the house the signal is strong enough depends on many factors. Upload the code and open the serial monitor. If everything worked out well your output should look something like this:</p>
<pre>+VER: 2.0.10
+ID: DevAddr, 26:01:3A:44
+ID: DevEui, 12:40:9E:23:45:69:54:32
+ID: AppEui, 70:B3:D5:7E:F0:00:65:93
+ID: DevEui, 12:40:9E:23:45:69:54:32
+ID: AppEui, 70:B3:D5:7E:+KEY: APPKEY 47 BD A7 7B 6D 7B 4D DA 7D C1 82 E5 42 95 FE 4E 
+MODE: LWOTAA
+DR: EU868
+DR: DR0
+DR: EU868 DR0  SF12 BW125K 
+CH: 0,868100000,DR0:DR5
+CH: 1,868300000,DR0:DR5
+CH: 2,868500000,DR0:DR5
+RXWIN1: OFF; 3; 0,868100000; 1,868300000; 2,868500000; 
+RXWIN2: 869500000,DR3
+POWER: 20
+JOIN: Start
+JOIN: NORMAL
+JOIN: Network joined
+JOIN: NetID 000013 DevAddr 26:01:21:52
+JOIN: Done
+MSG: Start
+MSG: TX "Hello World!"
+MSG: Done
</pre>
<p>Now you can also go back to your TTN console (website) and see if the packages have arrived there.</p>
<p><a href="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANPackagesReceived.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" data-attachment-id="2707" data-permalink="https://blog.squix.org/2017/07/seeeduino-lora-gps-getting-started-with-lorawan-and-ttn.html/lorawanpackagesreceived" data-orig-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANPackagesReceived.png?fit=2152%2C764&amp;ssl=1" data-orig-size="2152,764" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="LoRaWANPackagesReceived" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANPackagesReceived.png?fit=300%2C107&amp;ssl=1" data-large-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANPackagesReceived.png?fit=730%2C259&amp;ssl=1" class="aligncenter wp-image-2707 size-large" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANPackagesReceived.png?resize=730%2C259&#038;ssl=1" alt="" width="730" height="259" srcset="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANPackagesReceived.png?resize=1024%2C364&amp;ssl=1 1024w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANPackagesReceived.png?resize=300%2C107&amp;ssl=1 300w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANPackagesReceived.png?resize=768%2C273&amp;ssl=1 768w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/LoRaWANPackagesReceived.png?w=1460&amp;ssl=1 1460w" sizes="(max-width: 730px) 100vw, 730px" /></a></p>
<p>&nbsp;</p>
<h2>Where to buy</h2>
<p>You can buy the Seeeduino LoRaWAN with GPS module from Seeedstudio:<br />
<a href="https://blog.squix.org/go/seeedstudio-lorawan-gps" target="_blank" rel="noopener">Seeedstudio LoRaWAN w/GPS</a></p>
<p>&nbsp;</p>
<h2>Summary</h2>
<p>This post showed you how you can connect the <a href="https://blog.squix.org/go/seeedstudio-lorawan-gps" target="_blank" rel="noopener">Seeeduino LoRaWAN w/GPS</a> to TheThingsNetwork. This is just half the rent. In one of my next posts I want to show you how you can use the GPS module on the device to send the Seeeduino&#8217;s location over LoRaWAN. And finally we also want to receive the data in our own application. So a future post will show you how to do that as well.</p>
<p><a href="No categories https://blog.squix.org/go/seeedstudio-lorawan-gps"><img data-recalc-dims="1" loading="lazy" decoding="async" data-attachment-id="2699" data-permalink="https://blog.squix.org/2017/07/seeeduino-lora-gps-getting-started-with-lorawan-and-ttn.html/biru-wp-20170724t185204gmt0200-jpg" data-orig-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/BIRU-WP-20170724T185204GMT0200.jpg?fit=1280%2C1280&amp;ssl=1" data-orig-size="1280,1280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;2.2&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;iPhone 6s&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1500922324&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;4.15&quot;,&quot;iso&quot;:&quot;160&quot;,&quot;shutter_speed&quot;:&quot;0.03030303030303&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="Zürich / Zürich / Switzerland &#8211; 7/24/17" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/BIRU-WP-20170724T185204GMT0200.jpg?fit=300%2C300&amp;ssl=1" data-large-file="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/BIRU-WP-20170724T185204GMT0200.jpg?fit=730%2C730&amp;ssl=1" class="aligncenter size-medium wp-image-2699" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/BIRU-WP-20170724T185204GMT0200.jpg?resize=300%2C300&#038;ssl=1" alt="" width="300" height="300" srcset="https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/BIRU-WP-20170724T185204GMT0200.jpg?resize=300%2C300&amp;ssl=1 300w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/BIRU-WP-20170724T185204GMT0200.jpg?resize=150%2C150&amp;ssl=1 150w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/BIRU-WP-20170724T185204GMT0200.jpg?resize=768%2C768&amp;ssl=1 768w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/BIRU-WP-20170724T185204GMT0200.jpg?resize=1024%2C1024&amp;ssl=1 1024w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/BIRU-WP-20170724T185204GMT0200.jpg?resize=180%2C180&amp;ssl=1 180w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/BIRU-WP-20170724T185204GMT0200.jpg?resize=200%2C200&amp;ssl=1 200w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/BIRU-WP-20170724T185204GMT0200.jpg?resize=450%2C450&amp;ssl=1 450w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/BIRU-WP-20170724T185204GMT0200.jpg?resize=120%2C120&amp;ssl=1 120w, https://i0.wp.com/blog.squix.org/wp-content/uploads/2017/07/BIRU-WP-20170724T185204GMT0200.jpg?w=1280&amp;ssl=1 1280w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.squix.org/2017/07/seeeduino-lora-gps-getting-started-with-lorawan-and-ttn.html/feed</wfw:commentRss>
			<slash:comments>10</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2698</post-id>	</item>
		<item>
		<title>ESP8266: Using a seeeduino to talk to the ESP8266 module directly</title>
		<link>https://blog.squix.org/2014/12/esp8266-using-seeeduino-to-talk-to.html</link>
					<comments>https://blog.squix.org/2014/12/esp8266-using-seeeduino-to-talk-to.html#respond</comments>
		
		<dc:creator><![CDATA[Daniel Eichhorn]]></dc:creator>
		<pubDate>Sat, 06 Dec 2014 13:00:00 +0000</pubDate>
				<category><![CDATA[Common]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[FTDI]]></category>
		<category><![CDATA[low cost wifi shield]]></category>
		<category><![CDATA[seeeduino]]></category>
		<category><![CDATA[serial-to-usb adapter]]></category>
		<guid isPermaLink="false">http://blog.squix.org/2014/12/06/esp8266-using-seeeduino-to-talk-to/</guid>

					<description><![CDATA[I recently received two of these shiny new Wifi modules from China and had to test them out. In many posts around the web they say you should use a serial-to-usb adapter to send some AT commands to the module and set it up with ... <p><a class="read-more btn btn-secondary" href="https://blog.squix.org/2014/12/esp8266-using-seeeduino-to-talk-to.html">Read More</a></p>]]></description>
										<content:encoded><![CDATA[<div dir="ltr" style="text-align: left;" trbidi="on">
I recently received two of these shiny new Wifi modules from China and had to test them out. In many posts around the web they say you should use a serial-to-usb adapter to send some AT commands to the module and set it up with your local access point. My problem was: I didn&#8217;t have such an adapter, or so I thought. It turns out you can use some types of Arduino&#8217;s for the job just fine. I had a Seeeduino V3.0 laying around and that piece of hardware really has a few features built in that I wasn&#8217;t aware of before. This is a short explanation on how to setup the Seeeduino to talk to the ESP8266:</p>
<ol style="text-align: left;">
<li>Upload the following sketch to your Seeeduino:
<pre>void setup()
{
pinMode(0,INPUT);
pinMode(1,INPUT);
}
void loop()
{
}
</pre>
</li>
<li>Open the serial console of the Arduino IDE and set the baudrate to 115200</li>
<li>Now wire the ESP to your arduino:<br />
<img data-recalc-dims="1" decoding="async" border="0" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2014/12/ESP8266_pinout-1.png?w=730&#038;ssl=1" /></p>
<table border="1">
<thead>
<tr>
<td>ESP8266</td>
<td>Seeeduino</td>
</tr>
</thead>
<tbody>
<tr>
<td>GND</td>
<td>GND</td>
</tr>
<tr>
<td>VCC+CH_PD</td>
<td>V3.3</td>
</tr>
<tr>
<td>URXD</td>
<td>RX (pin 1)</td>
</tr>
<tr>
<td>UTXD</td>
<td>TX (pin 2)</td>
</tr>
</tbody>
</table>
</li>
<li>Now send some AT commands for testing (bold is the request, light comments and response):
<pre><b>AT</b>
OK
<b>AT+RST         </b>// resets the module<b>
</b> ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
[..]
csum 0xbd
<b>AT+CWLAP       </b>// lists all access points <b>    </b>
+CWLAP:(0,"",0)
+CWLAP:(3,"ap1",-90)
+CWLAP:(0,"ap2",-87)
<b>AT+CWJAP="ap1","mypwd"     </b>// join access point ap1 with password mypwd
OK
<b>AT+CWJAP? </b>    // show connected access point
+CWJAP:"ap1"
</pre>
</li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.squix.org/2014/12/esp8266-using-seeeduino-to-talk-to.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">76</post-id>	</item>
	</channel>
</rss>
