<?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>loriot &#8211; Squix &#8211; TechBlog</title>
	<atom:link href="https://blog.squix.org/tag/loriot/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>
	</channel>
</rss>
