Newsletter

Suppliers

RSS feed

No RSS feed added

LoRaWAN "The Things Network" Gateway for Windows IoT Core Maximize

LoRaWAN "The Things Network" Gateway for Windows IoT Core

Build your own LoRaWAN "The Things Network" packet-forwarding gateway on Windows 10 IoT Core in native .NET code.

More details

150 Items in stock

$ 81.90

On sale On sale!

» Add to my wishlist

By buying this product you can collect up to 8 loyalty points. Your cart will total 8 points that can be converted into a voucher of $ 1.60.


ProductFrom (qty)Discount
LoRaWAN "The Things Network" Gateway for Windows IoT Core10 -$ 2.00
LoRaWAN "The Things Network" Gateway for Windows IoT Core5 -$ 1.00

2 other products in the same category:

LoRaWAN "The Things Network" Gateway for Windows IoT Core <h1><span class="hckui__layout__marginRight10">Hackster</span></h1> <div> <div class="user-card media"> <h2 class="media-left"><a href="https://www.hackster.io/laserbrain"><img class="img-circle media-object" src="https://hackster.imgix.net/uploads/avatar/file/46119/800x800.jpg?auto=compress%2Cformat&amp;w=60&amp;h=60&amp;fit=min" alt="Mattias Larsson" /></a><a class="hckui__typography__link" style="font-size: 16px;" href="https://www.hackster.io/laserbrain">Mattias Larsson</a></h2> <div class="media-body"> <div class="hckui__typography__bodyS hckui__typography__pebble"><span>Published </span><span>May 8, 2017</span><span> </span><span>©</span><span> </span><a class="hckui__typography__linkPebble" href="http://opensource.org/licenses/MIT" target="_blank">MIT</a></div> <div> </div> <div>This project is from Hackster and for more details about this project pls visit: <h2 class="hckui__typography__h2 title-with-anchor">https://www.hackster.io/laserbrain/a-lorawan-the-things-network-gateway-for-windows-iot-core-441210</h2> </div> <div> <div class="project-section-title"> <h2 class="hckui__typography__h2 title-with-anchor"><span>Story</span></h2> </div> <div class="project-story collapsible-section collapsed hljs-active hljs-monokai"> <p class="hckui__typography__bodyL"><span>This tutorial describes how to build, install and run a </span><span>single-channel packet-forwarding LoRaWAN gateway</span><span> running on a </span><span>Raspberry Pi</span><span> with a </span><span>Dragino LoRa extension board</span><span>, forwarding received radio packets to </span><span style="color: #ff0000;"><a class="hckui__typography__linkBlue" href="https://www.thethingsnetwork.org/" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;The Things Network&quot;,&quot;href&quot;:&quot;https://www.thethingsnetwork.org/&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}"><span style="color: #ff0000;">The Things Network</span></a></span><span><span style="color: #ff0000;"> </span>backend. The gateway is implemented in C# (having no external dependencies) and runs on the Windows IoT Core platform.</span></p> <h3 id="toc-limitations-0" class="hckui__typography__h3 title-with-anchor"><span>Limitations</span></h3> <p class="hckui__typography__bodyL"><span>Please note that the radio expansion boards used in this tutorial are </span><em>single-channel only</em><span>, which means that you will </span><span>not </span><span>be able to create a full-fledged gateway. It does </span><span>not </span><span>fulfill the complete standard and are </span><a class="hckui__typography__linkBlue" href="https://www.thethingsnetwork.org/wiki/Hardware/Gateways/Single-Channel-Gateway" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;not LoRaWAN compliant&quot;,&quot;href&quot;:&quot;https://www.thethingsnetwork.org/wiki/Hardware/Gateways/Single-Channel-Gateway&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">not <span style="color: #ff0000;">LoRaWAN compliant</span></a><span style="color: #ff0000;">. <span style="color: #000000;">This gateway will be suitable for testing purposes only.</span></span></p> <h3 id="toc-background-1" class="hckui__typography__h3 title-with-anchor"><span>Background</span></h3> <p class="hckui__typography__bodyL"><span>The </span><a class="hckui__typography__linkBlue" href="https://www.lora-alliance.org/What-Is-LoRa/Technology" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;LoRa Alliance&quot;,&quot;href&quot;:&quot;https://www.lora-alliance.org/What-Is-LoRa/Technology&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">LoRa Alliance</a><span> describes LoRaWAN like this:</span></p> <blockquote><em><span>LoRaWAN™</span></em><em> is a Low Power Wide Area Network (LPWAN) specification intended for wireless battery operated Things in a regional, national or global network. LoRaWAN targets key requirements of Internet of Things such as secure bi-directional communication, mobility and localization services. The LoRaWAN specification provides seamless interoperability among smart Things without the need of complex local installations and gives back the freedom to the user, developer, businesses enabling the roll out of Internet of Things.</em></blockquote> <p class="hckui__typography__bodyL"><span>On top of that, </span><a class="hckui__typography__linkBlue" href="https://www.thethingsnetwork.org/" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;The Things Network&quot;,&quot;href&quot;:&quot;https://www.thethingsnetwork.org/&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">The Things Network</a><span> describes themselves like this:</span></p> <blockquote><em>We are a global community of 15235 </em><span>[2017-05-07]</span><em> people over 84 countries building a global Internet of Things data network. We use a long range and low power radio frequency protocol called LoRaWAN and for short range Bluetooth 4.2. The technology allows for things to talk to the internet without 3G or WiFi. So no WiFi codes and no mobile subscriptions.</em></blockquote> <h3 id="toc-so-what-is-a-packet-forwarding-lorawan-gateway-2" class="hckui__typography__h3 title-with-anchor"><span><br /></span></h3> <h3 class="hckui__typography__h3 title-with-anchor"><span>So what is a Packet-Forwarding LoRaWAN Gateway?</span></h3> <p class="hckui__typography__bodyL">In short; The Things Network is built up by people placing Gateways virtually all over the world that picks up LoRaWAN radio packets and forwards them to the backend of The Things Network. From there developers can access and process the data sent from their nodes in applications (living in the cloud).</p> <p class="hckui__typography__bodyL"><span>A </span><em>full-fledged</em><span> gateway can also transmit messages from the backend (i.e. from the cloud applications) over the air back to the nodes. This functionality is missing in a packet-forwarding gateway.</span></p> <p class="hckui__typography__bodyL">But it's a good start to play with the technique, anyway. And cheap.</p> <h3 id="toc-hardware-3" class="hckui__typography__h3 title-with-anchor"><span>Hardware</span></h3> <p class="hckui__typography__bodyL"><span>The C# code is developed and tested on </span><span>Raspberry Pi 3</span><span> (but version 2 would work just fine) with one of the following LoRa expansion boards:</span></p> <ul class="hckui__typography__bodyL"> <li><a class="hckui__typography__linkBlue" href="http://www.dragino.com/products/module/item/106-lora-gps-hat.html" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;Dragino LoRa/GPS HAT&quot;,&quot;href&quot;:&quot;http://www.dragino.com/products/module/item/106-lora-gps-hat.html&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">Dragino LoRa/GPS HAT</a></li> <li>Raspberry Pi 3 </li> </ul> <p class="hckui__typography__bodyL"><span>The easiest expansion board to use is the </span><span>Dragino LoRa/GPS HAT</span><span> together with a Raspberry Pi, since it’s just to plug it on top.</span></p> <div class="project-story collapsible-section collapsed hljs-active hljs-monokai"> <h3 id="toc-software-4" class="hckui__typography__h3 title-with-anchor"><span>Software</span></h3> <p class="hckui__typography__bodyL"><span>First you need to install </span><span><a class="hckui__typography__linkBlue" href="https://developer.microsoft.com/en-us/windows/iot" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;Windows IoT Core&quot;,&quot;href&quot;:&quot;https://developer.microsoft.com/en-us/windows/iot&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">Windows IoT Core</a></span><span> on your Raspberry Pi. This is done by </span><a class="hckui__typography__linkBlue" href="https://developer.microsoft.com/en-us/windows/iot/GetStarted.htm" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;following these instructions&quot;,&quot;href&quot;:&quot;https://developer.microsoft.com/en-us/windows/iot/GetStarted.htm&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">following these instructions</a><span> from Microsoft.</span></p> <p class="hckui__typography__bodyL"><span>Next you will need to get my code, either clone or download it from my </span><a class="hckui__typography__linkBlue" href="https://github.com/emmellsoft/Dragino.Lora" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;GitHub repository&quot;,&quot;href&quot;:&quot;https://github.com/emmellsoft/Dragino.Lora&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">GitHub repository</a><span>.</span></p> <p class="hckui__typography__bodyL"><span>You will also need Visual Studio, preferably </span><a class="hckui__typography__linkBlue" href="https://www.visualstudio.com/downloads/" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;Visual Studio 2017&quot;,&quot;href&quot;:&quot;https://www.visualstudio.com/downloads/&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">Visual Studio 2017</a><span>. There is a free but very competent </span><a class="hckui__typography__linkBlue" href="https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&amp;rel=15" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;community edition&quot;,&quot;href&quot;:&quot;https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community\u0026rel=15&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">community edition</a><span> which you may use.</span></p> <p class="hckui__typography__bodyL"><span>Now you open up the </span><code>Dragino.Lora.Demo.Gateway.sln</code><span> solution file from my GitHub repository in Visual Studio.</span></p> <p class="hckui__typography__bodyL"><span>In the top bar of Visual Studio, choose </span><span>Arm</span><span> as the solution platform and </span><span>Remote Machine</span><span> as target.</span></p> <p class="hckui__typography__bodyL"><span>Open up the </span><code>MainPage.xaml.cs</code><span> source code file and locate the four </span><code>YOUR EDITING IS REQUIRED HERE!</code><span> -comments.</span></p> <p class="hckui__typography__bodyL">Here's what you need to consider in those places:</p> <h3 id="toc--1--configuring-the-radio-chip-5" class="hckui__typography__h3 title-with-anchor"><span>#1. Configuring the radio chip</span></h3> <p class="hckui__typography__bodyL"><span>The first comment points out where you configure the LoRa radio chip by specifying the </span><code>LoraWanGatewaySettings</code><span> -object instance.</span></p> <p class="hckui__typography__bodyL"><span>The default is </span><code>Europe868</code><span> , but depending on where you live (and your radio chip hardware) you might need to change this.</span></p> <p class="hckui__typography__bodyL">Either use one of the predefined ones, or create a custom one. Take a look at how the predefined ones are created, if you need to create a custom!</p> <h3 id="toc--2--configuring-the-connection-to-the-lora-expansion-board-6" class="hckui__typography__h3 title-with-anchor"><span>#2. Configuring the connection to the LoRa expansion board</span></h3> <p class="hckui__typography__bodyL"><span>The second edit-comment in the MainPage code file is found in the </span><code>GetTransceiverPinSettings()</code><span> method. </span></p> <p class="hckui__typography__bodyL"><span>It's here you tell how your transceiver expansion board is wired to your Raspberry Pi. If you are using the LoRa/GPS HAT --</span></p> <p class="hckui__typography__bodyL"><span> or using an Arduino Shield with the wiring according to my schematics below -- you can leave the code as is.</span></p> <p class="hckui__typography__bodyL"><span>But if you used a </span><em>custom wiring</em><span> you will need to uncomment the last lines and specify the pin numbers yourself.</span></p> <h3 id="toc--3--using-a-gps-7" class="hckui__typography__h3 title-with-anchor"><span>#3. Using a GPS</span></h3> <p class="hckui__typography__bodyL"><span>Locate the </span><code>UseGpsManager()</code><span> method. Depending on which expansion board you have, a GPS module might be present. </span></p> <p class="hckui__typography__bodyL"><span>The default code assumes that you </span><em>have </em><span>one, and returns </span><code>true</code><span> . If you don't have a GPS module, change this to </span><code>false</code><span> .</span></p> <h3 id="toc--4--specifying-the-gateway-eui-8" class="hckui__typography__h3 title-with-anchor"><span>#4. Specifying the Gateway EUI</span></h3> <p class="hckui__typography__bodyL"><span>The last part of the code you will need to configure is the </span><span>EUI</span><span> of your gateway and is found in the </span><code>GetGatewayEui()</code><span> -method. </span></p> <p class="hckui__typography__bodyL"><span>The EUI is a globally unique ID for your gateway. Unfortunately there is no unique ID provided by the LoRa module itself,</span></p> <p class="hckui__typography__bodyL"><span> so, for instance the MAC address of the Raspberry Pi could be used instead.</span></p> <p class="hckui__typography__bodyL"><span>Using the MAC address</span></p> <p class="hckui__typography__bodyL">If you want to use the MAC address it's slightly more complicated, because there isn't (yet) an API giving you this information in Windows IoT Core.</p> <p class="hckui__typography__bodyL">There is a however workaround, and that is to call the embedded REST API (the same that you can visit in a web browser to configure your device).</p> <p class="hckui__typography__bodyL"><span>The URI that gives the MAC address information is found at </span><code>http://localhost:8080/api/networking/ipconfig</code><span> .</span></p> <p class="hckui__typography__bodyL"><span>But you must provide the user name and password to get access to this API; i.e. the credentials you used during the installation of Windows IoT Core on the device. </span></p> <p class="hckui__typography__bodyL"><span>The default in the code is </span><code>Administrator</code><span> and </span><code>p@ssw0rd</code><span> .</span></p> <p class="hckui__typography__bodyL"><span>Using a hard coded EUI</span></p> <p class="hckui__typography__bodyL"><span>You can also specify any EUI you want by removing the two top lines of this method and uncomment the last one which simply returnes a fixed value at </span><code>new GatewayEui("0123456789ABCDEF")</code><span> .</span></p> <p class="hckui__typography__bodyL"><span> Obviously you should change the </span><code>0123...EF</code><span> to your own unique hexadecimal value.</span></p> <h3 id="toc-the-things-network-9" class="hckui__typography__h3 title-with-anchor"><span>The Things Network</span></h3> <p class="hckui__typography__bodyL"><span>Now it's time to register your gateway on </span><a class="hckui__typography__linkBlue" href="https://www.thethingsnetwork.org/" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;The Things Network&quot;,&quot;href&quot;:&quot;https://www.thethingsnetwork.org/&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">The Things Network</a><span>. For this you need to </span><a class="hckui__typography__linkBlue" href="https://account.thethingsnetwork.org/register" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;create an account&quot;,&quot;href&quot;:&quot;https://account.thethingsnetwork.org/register&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">create an account</a><span> there.</span></p> <p class="hckui__typography__bodyL"><span>The next step is to </span><a class="hckui__typography__linkBlue" href="https://console.thethingsnetwork.org/gateways" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;go to the console&quot;,&quot;href&quot;:&quot;https://console.thethingsnetwork.org/gateways&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">go to the console</a><span> and click the </span><span>register gateway</span><span> link. Now register your gateway using the following setup:</span></p> <p class="hckui__typography__bodyL"><span>As </span><span>Protocol</span><span>, use </span><span>packet forwarder</span><span> since this gateway implementation is not a full-blown gateway connector.</span></p> <p class="hckui__typography__bodyL"><span>As </span><span>Gateway EUI</span><span> you enter the EUI used by your application (see above). If you decided to use the MAC address you might need to start the application once to see the EUI </span></p> <p class="hckui__typography__bodyL"><span>written in the debug console of Visual Studio (in the output window). This is written by the line that says </span><code>WriteLog("The gateway EUI: " + gatewayEui);</code></p> <p class="hckui__typography__bodyL">Place a breakpoint there, start the code and see what it prints:</p> <div data-hypernova-key="ImageCarousel" data-hypernova-id="b8f247c6-14e5-4c2e-8fb0-05f1ebed4915"> <div data-reactroot=""> <div class="image_carousel__container__hMJxn"> <div class="image_carousel__wrapper__102VA"> <div class="image_carousel__scrollContainer__3mmPE "> <div class="image_carousel__imageContainer__22WPm"> <div class="image_carousel__imageWrapper__39AG2"><img class="image_carousel__image__2-CjO " src="https://hackster.imgix.net/uploads/attachments/301361/the_gateway_eui_YppL49WMtD.png?auto=compress%2Cformat&amp;w=740&amp;h=555&amp;fit=max" alt="Stepping past the WriteLog line will reveal the EUI if it's unknown to you" /></div> </div> </div> </div> <div class="image_carousel__caption__2sZrD"><span>Stepping past the WriteLog line will reveal the EUI if it's unknown to you</span></div> </div> <div> </div> </div> </div> <p class="hckui__typography__bodyL"><span>Then you should give your gateway a name in the </span><span>Description</span><span> field, and choose the correct </span><span>Frequency Plan</span><span> depending on where you live and which radio module you are using.</span></p> <div data-hypernova-key="ImageCarousel" data-hypernova-id="79be368b-9e07-4bc2-839d-4cdedab06114"> <div data-reactroot=""> <div class="image_carousel__container__hMJxn"> <div class="image_carousel__wrapper__102VA"> <div class="image_carousel__scrollContainer__3mmPE "> <div class="image_carousel__imageContainer__22WPm"> <div class="image_carousel__imageWrapper__39AG2"><img class="image_carousel__image__2-CjO " src="https://hackster.imgix.net/uploads/attachments/301356/ttn_-_register_gateway_1_z14n9hslc6.png?auto=compress%2Cformat&amp;w=740&amp;h=555&amp;fit=max" alt="Registering your gateway" /></div> </div> </div> </div> <div class="image_carousel__caption__2sZrD"><span>Registering your gateway</span></div> </div> <div> </div> </div> </div> <p class="hckui__typography__bodyL"><span>If you like you can also click on the </span><span>map</span><span> to tell where your gateway is, and below you can specify your </span><span>Antenna Placement</span><span>.</span></p> <p class="hckui__typography__bodyL"><span>At the bottom of the page, click the </span><span>Register Gateway</span><span> button when you are finished.</span></p> <div data-hypernova-key="ImageCarousel" data-hypernova-id="2ae90494-aa18-4d79-938e-89972e784f1d"> <div data-reactroot=""> <div class="image_carousel__container__hMJxn"> <div class="image_carousel__wrapper__102VA"> <div class="image_carousel__scrollContainer__3mmPE "> <div class="image_carousel__imageContainer__22WPm"> <div class="image_carousel__imageWrapper__39AG2"><img class="image_carousel__image__2-CjO " src="https://hackster.imgix.net/uploads/attachments/301357/ttn_-_register_gateway_2_hEZsEfHtZY.png?auto=compress%2Cformat&amp;w=740&amp;h=555&amp;fit=max" alt="Your newly registered gateway" /></div> </div> </div> </div> <div class="image_carousel__caption__2sZrD"><span>Your newly registered gateway</span></div> </div> <div> </div> </div> </div> <p class="hckui__typography__bodyL"><span>Click the </span><span>Settings </span><span>button in the top right corner and set the </span><span>Router</span><span> address:</span></p> <div data-hypernova-key="ImageCarousel" data-hypernova-id="067e6ab0-768b-48e9-8b84-2bd340f01744"> <div data-reactroot=""> <div class="image_carousel__container__hMJxn"> <div class="image_carousel__wrapper__102VA"> <div class="image_carousel__scrollContainer__3mmPE "> <div class="image_carousel__imageContainer__22WPm"> <div class="image_carousel__imageWrapper__39AG2"><img class="image_carousel__image__2-CjO " src="https://hackster.imgix.net/uploads/attachments/301358/ttn_-_register_gateway_3_63IFHXKU2D.png?auto=compress%2Cformat&amp;w=740&amp;h=555&amp;fit=max" alt="Setting the Router address in the gateway settings" /></div> </div> </div> </div> <div class="image_carousel__caption__2sZrD"><span>Setting the Router address in the gateway settings</span></div> </div> <div> </div> </div> </div> <p class="hckui__typography__bodyL"><span>Click the </span><span>Update Gateway</span><span> button and then the </span><span>Overview </span><span>button to go back to the main screen.</span></p> <p class="hckui__typography__bodyL">Your gateway is now configured and The Things Network now expects it to deliver the radio packets it receives.</p> <h3 id="toc-run-the-gateway-application-10" class="hckui__typography__h3 title-with-anchor"><span>Run the Gateway application</span></h3> <p class="hckui__typography__bodyL"><span>Now you should be all set to run the gateway application. Just press </span><span>F5 </span><span>in Visual Studio (given that you have specified the target remote machine - i.e. your Raspberry Pi - in the Debug tab of the project properties).</span></p> <p class="hckui__typography__bodyL"><span>If you now look at the Overview tab in the gateway console on The Things Network site, you can see if your gateway successfully can communicate with the network. The </span><span>Last Seen</span><span> should update around every 30 seconds:</span></p> <div data-hypernova-key="ImageCarousel" data-hypernova-id="ba671f15-7f44-46a3-a24c-065482a56811"> <div data-reactroot=""> <div class="image_carousel__container__hMJxn"> <div class="image_carousel__wrapper__102VA"> <div class="image_carousel__scrollContainer__3mmPE "> <div class="image_carousel__imageContainer__22WPm"> <div class="image_carousel__imageWrapper__39AG2"><img class="image_carousel__image__2-CjO " src="https://hackster.imgix.net/uploads/attachments/301373/_7shecOexcP.tmp_file?auto=compress%2Cformat&amp;w=740&amp;h=555&amp;fit=max" alt="Your gateway is up and running" /></div> </div> </div> </div> <div class="image_carousel__caption__2sZrD"><span>Your gateway is up and running</span></div> </div> <div> </div> </div> </div> <p class="hckui__typography__bodyL"><span>The MainPage in your application has a timer that ticks every 30 seconds. When it ticks is calls the </span><code>SendStatus()</code><span> method. This makes the gateway code send a short JSON status message to the backend, basically telling it that it is still alive and kicking.</span></p> <p class="hckui__typography__bodyL"><span>The field below on the overview page is </span><span>Received Messages</span><span> (3 in my screenshot). This value goes up when the radio chip successfully receives a full packet (from </span><em>anyone </em><span>sending </span><em>anything </em><span>on your channel) and the gateway implementation succeeds in forwarding it to the backend. Depending on where you live your gateway will pick up packets more or less frequently.</span></p> <p class="hckui__typography__bodyL"><span>The </span><span>Transmitted Messages</span><span> will stay 0 since this gateway is just a packet forwarder -- it never transmit any radio messages from The Things Network.</span></p> <h3 id="toc-the-debug-output-in-visual-studio-11" class="hckui__typography__h3 title-with-anchor"><span>The debug output in Visual Studio</span></h3> <p class="hckui__typography__bodyL">When running the application, open up the Output window in Visual Studio to see some details of what's happening:</p> <p class="hckui__typography__bodyL"><span>GPS information</span></p> <p class="hckui__typography__bodyL"><span>Having a GPS chip on your LoRa expansion board will show all serial communication data received from that module. Those lines starts with </span><code>GPS:</code><span>in the log window.</span></p> <p class="hckui__typography__bodyL"><span>Please note that even though your GPS coordinates </span><em>are </em><span>sent to The Things Network in the JSON status message, your gateway configuration will not be updated by The Things Network backend. I don't know why.</span></p> <p class="hckui__typography__bodyL"><span>Note: </span><span>Since you are probably now sitting indoors, trying out this project, you may need to place your Raspberry Pi (or at least the LoRa expansion board) in a window frame for it to successfully receive GPS signals.</span></p> <p class="hckui__typography__bodyL">A blue led will start flashing on the LoRa expansion board when the GPS receives signals from the satellites.</p> <p class="hckui__typography__bodyL"><span>Sending status information</span></p> <p class="hckui__typography__bodyL">Every 30 seconds, when the main page calls the SendStatus method, you will see a line saying something like:</p> <p class="hckui__typography__bodyL"><code>Packages: 10 / 4 / 4</code></p> <p class="hckui__typography__bodyL">The first number tells how many radio packets the LoRa chip has received. The second number how many of those that were OK (correct CRC and no timeout). The last number tells how many packets the gateway has forwarded to backend of The Things Network. In my example (10/4/4) only 4 packets were perfectly fine and 6 packets was not received correctly and was discarded.</p> <p class="hckui__typography__bodyL">The line after shows the JSON message that will be sent, and it will look something like this:</p> <p class="hckui__typography__bodyL"><code>Sending JSON: {"stat":{"time":"2017-05-07 16:21:39 GMT","lati":55.597447,"long":12.958467,"alti":-7,"rxnb":0,"rxok":0,"rxfw":0,"ackr":100,"dwnb":0,"txnb":0}}</code></p> <p class="hckui__typography__bodyL">After that you will see the same JSON message as it is actually transferred to the backend, as a series of bytes transferred over the UDP protocol:</p> <p class="hckui__typography__bodyL"><code>UDP sending (to "router.eu.thethings.network"): 01, F6, 29, 00, 19, C6, 83, A9, 64, 9B, 61, 29, 7B, 22, 73, 74, 61, 74, 22, 3A, 7B, 22, 74, 69, 6D, 65, 22, 3A, 22, 32, 30, 31, 37, 2D, 30, 35, 2D, 30, 37, 20, 31, 36, 3A, 32, 31, 3A, 33, 39, 20, 47, 4D, 54, 22, 2C, 22, 6C, 61, 74, 69, 22, 3A, 35, 35, 2E, 35, 39, 37, 34, 34, 37, 2C, 22, 6C, 6F, 6E, 67, 22, 3A, 31, 32, 2E, 39, 35, 38, 34, 36, 37, 2C, 22, 61, 6C, 74, 69, 22, 3A, 2D, 37, 2C, 22, 72, 78, 6E, 62, 22, 3A, 30, 2C, 22, 72, 78, 6F, 6B, 22, 3A, 30, 2C, 22, 72, 78, 66, 77, 22, 3A, 30, 2C, 22, 61, 63, 6B, 72, 22, 3A, 31, 30, 30, 2C, 22, 64, 77, 6E, 62, 22, 3A, 30, 2C, 22, 74, 78, 6E, 62, 22, 3A, 30, 7D, 7D (155 byte(s)).</code></p> <p class="hckui__typography__bodyL">Lastly, if everything worked as it should, you will see a short acknowledge from the backend, basically saying that it has received your message:</p> <p class="hckui__typography__bodyL"><code>UDP receiving (from "52.169.76.203"): 01, F6, 29, 01 (4 byte(s)).</code></p> <p class="hckui__typography__bodyL"><span>Receiving a packet successfully</span></p> <p class="hckui__typography__bodyL">When a radio packet is received successfully you will see something like this in the debug log:</p> <p class="hckui__typography__bodyL"><span>[1] </span><code>Packet RSSI: -104, RSSI: -102, SNR: 56.2, Length: 26</code></p> <p class="hckui__typography__bodyL"><span>[2] </span><code>Message Received: CRC OK, Rssi=-102, PacketRssi=-104, PacketSnr=56.2, Buffer:[40, 3f, 16, 01, 26, 80, 12, 00, 01, a3, ba, da, b8, b0, 59, 14, 67, 5b, 11, 55, 40, 06, fa, e7, ad, 4a], 2017-05-07 17:00:27</code></p> <p class="hckui__typography__bodyL"><span>[3] </span><code>Received: CRC OK, Rssi=-102, PacketRssi=-104, PacketSnr=56.2, Buffer:[40, 3f, 16, 01, 26, 80, 12, 00, 01, a3, ba, da, b8, b0, 59, 14, 67, 5b, 11, 55, 40, 06, fa, e7, ad, 4a], 2017-05-07 17:00:27</code></p> <p class="hckui__typography__bodyL"><span>[4] </span><code>Sending JSON: {"rxpk":[{"time":"2017-05-07T17:00:27.1374110Z","tmst":2387966326,"freq":868.1,"chan":0,"rfch":0,"stat":1,"modu":"LORA","datr":"SF7BW125",</code></p> <p class="hckui__typography__bodyL"><code>"codr":"4/5","rssi":-104,"lsnr":56.200000762939453,"size":26,"data":"QD8WASaAEgABo7rauLBZFGdbEVVABvrnrUo="}]}</code></p> <p class="hckui__typography__bodyL"><span>[5] </span><code>UDP sending (to "router.eu.thethings.network"): 01, 19, FD, 00, 19, C6, 83, A9, 64, 9B, 61, 29, 7B, 22, 72, 78, 70, 6B, 22, 3A, 5B, 7B, 22, 74, 69, 6D, 65, 22, 3A, 22, 32, 30, 31, 37, 2D, 30, 35, 2D, 30, 37, 54, 31, 37, 3A, 30, 30, 3A, 32, 37, 2E, 31, 33, 37, 34, 31, 31, 30, 5A, 22, 2C, 22, 74, 6D, 73, 74, 22, 3A, 32, 33, 38, 37, 39, 36, 36, 33, 32, 36, 2C, 22, 66, 72, 65, 71, 22, 3A, 38, 36, 38, 2E, 31, 2C, 22, 63, 68, 61, 6E, 22, 3A, 30, 2C, 22, 72, 66, 63, 68, 22, 3A, 30, 2C, 22, 73, 74, 61, 74, 22, 3A, 31, 2C, 22, 6D, 6F, 64, 75, 22, 3A, 22, 4C, 4F, 52, 41, 22, 2C, 22, 64, 61, 74, 72, 22, 3A, 22, 53, 46, 37, 42, 57, 31, 32, 35, 22, 2C, 22, 63, 6F, 64, 72, 22, 3A, 22, 34, 2F, 35, 22, 2C, 22, 72, 73, 73, 69, 22, 3A, 2D, 31, 30, 34, 2C, 22, 6C, 73, 6E, 72, 22, 3A, 35, 36, 2E, 32, 30, 30, 30, 30, 30, 37, 36, 32, 39, 33, 39, 34, 35, 33, 2C, 22, 73, 69, 7A, 65, 22, 3A, 32, 36, 2C, 22, 64, 61, 74, 61, 22, 3A, 22, 51, 44, 38, 57, 41, 53, 61, 41, 45, 67, 41, 42, 6F, 37, 72, 61, 75, 4C, 42, 5A, 46, 47, 64, 62, 45, 56, 56, 41, 42, 76, 72, 6E, 72, 55, 6F, 3D, 22, 7D, 5D, 7D (259 byte(s)).</code></p> <p class="hckui__typography__bodyL"><span>[6] </span><code>UDP receiving (from "52.169.76.203"): 01, 19, FD, 01 (4 byte(s)).</code></p> <p class="hckui__typography__bodyL"><span>Line </span><span>[1]</span><span> tells some overall information about the packet. </span><span>RSSI</span><span> means </span><em><a class="hckui__typography__linkBlue" href="https://en.wikipedia.org/wiki/Received_signal_strength_indication" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;Received Signal Strength Indicator&quot;,&quot;href&quot;:&quot;https://en.wikipedia.org/wiki/Received_signal_strength_indication&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">Received Signal Strength Indicator</a></em><a class="hckui__typography__linkBlue" href="https://en.wikipedia.org/wiki/Received_signal_strength_indication" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;,&quot;,&quot;href&quot;:&quot;https://en.wikipedia.org/wiki/Received_signal_strength_indication&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">,</a><span> </span><span>SNR</span><span> is the </span><em><a class="hckui__typography__linkBlue" href="https://en.wikipedia.org/wiki/Signal-to-noise_ratio" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;Signal-to-Noise Ratio&quot;,&quot;href&quot;:&quot;https://en.wikipedia.org/wiki/Signal-to-noise_ratio&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">Signal-to-Noise Ratio</a></em><a class="hckui__typography__linkBlue" href="https://en.wikipedia.org/wiki/Signal-to-noise_ratio" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;.&quot;,&quot;href&quot;:&quot;https://en.wikipedia.org/wiki/Signal-to-noise_ratio&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">.</a><span> </span><span>Length</span><span> is the number of bytes received.</span></p> <p class="hckui__typography__bodyL"><span>Line </span><span>[2]</span><span> and </span><span>[3]</span><span> tells the same thing as the first line, but in more detail; including the actual bytes received.</span></p> <p class="hckui__typography__bodyL"><span>Line </span><span>[4]</span><span> shows the composed JSON message that will be sent to The Things Network to inform about the received packet.</span></p> <p class="hckui__typography__bodyL"><span>Line </span><span>[5]</span><span> is the JSON as it actually will be transferred, and line </span><span>[6]</span><span> is the acknowledge from the backend of The Things Network.</span></p> <p class="hckui__typography__bodyL"><span>Receiving a bad radio packet</span></p> <p class="hckui__typography__bodyL">Sometimes a packet is not received correctly. The reason could be bad reception (a distant transmitter) or collisions with other messages.</p> <p class="hckui__typography__bodyL">You will see something like this in the debug output:</p> <p class="hckui__typography__bodyL"><code>Message Received: Bad CRC, Rssi=-94, PacketRssi=-102, PacketSnr=59.2, Buffer:[40, 3f, 1a, 01, 26, 80, 04, 00, 01, fb, 75, 0b, 03, a7, 30, 17, a8, 05, 6e, b0, 29, 89, 6e, 81, b8, 7d], 2017-05-07 16:45:01</code></p> <p class="hckui__typography__bodyL">You will still get access to the packet data in the MainPage (if you would like to do some analysis or further processing), but it will not be forwarded to The Things Network.</p> <h3 id="toc-resources-12" class="hckui__typography__h3 title-with-anchor"><span>Resources</span></h3> <p class="hckui__typography__bodyL">I have had great help creating this project from the following resources:</p> <ul class="hckui__typography__bodyL"> <li><a class="hckui__typography__linkBlue" href="http://wiki.dragino.com/index.php?title=Lora/GPS_HAT" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;The Dragino LoRa/GPS wiki&quot;,&quot;href&quot;:&quot;http://wiki.dragino.com/index.php?title=Lora/GPS_HAT&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">The Dragino LoRa/GPS wiki</a></li> </ul> <ul class="hckui__typography__bodyL"> <li><a class="hckui__typography__linkBlue" href="http://www.airspayce.com/mikem/arduino/RadioHead/" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;RadioHead Packet Radio library&quot;,&quot;href&quot;:&quot;http://www.airspayce.com/mikem/arduino/RadioHead/&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">RadioHead Packet Radio library</a></li> </ul> <ul class="hckui__typography__bodyL"> <li><a class="hckui__typography__linkBlue" href="http://www.semtech.com/wireless-rf/rf-transceivers/sx1276/" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;Semtech SX1276 datasheet&quot;,&quot;href&quot;:&quot;http://www.semtech.com/wireless-rf/rf-transceivers/sx1276/&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">Semtech SX1276 datasheet</a></li> </ul> <ul class="hckui__typography__bodyL"> <li><a class="hckui__typography__linkBlue" href="https://www.thethingsnetwork.org/forum/uploads/default/original/1X/4fbda86583605f4aa24dcedaab874ca5a1572825.pdf" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;LoRaWAN Network Server Demonstration: Gateway to Server Interface Definition&quot;,&quot;href&quot;:&quot;https://www.thethingsnetwork.org/forum/uploads/default/original/1X/4fbda86583605f4aa24dcedaab874ca5a1572825.pdf&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">LoRaWAN Network Server Demonstration: Gateway to Server Interface Definition</a></li> </ul> <ul class="hckui__typography__bodyL"> <li><a class="hckui__typography__linkBlue" href="http://www.microchip.ua/simcom/GPS/Application%20Notes/MT3339%20Platform%20NMEA%20Message%20Specification_V1.00.pdf" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;GPS: MT3339 NMEA Message Specification&quot;,&quot;href&quot;:&quot;http://www.microchip.ua/simcom/GPS/Application%20Notes/MT3339%20Platform%20NMEA%20Message%20Specification_V1.00.pdf&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">GPS: MT3339 NMEA Message Specification</a></li> </ul> <ul class="hckui__typography__bodyL"> <li><a class="hckui__typography__linkBlue" href="https://www.thethingsnetwork.org/forum/" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;The Things Network Forum&quot;,&quot;href&quot;:&quot;https://www.thethingsnetwork.org/forum/&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">The Things Network Forum</a></li> </ul> <ul class="hckui__typography__bodyL"> <li><a class="hckui__typography__linkBlue" href="https://github.com/tftelkamp/single_chan_pkt_fwd" rel="nofollow" data-ha="{&quot;eventName&quot;:&quot;Clicked link&quot;,&quot;customProps&quot;:{&quot;value&quot;:&quot;The single_chan_pkt_fwd source code&quot;,&quot;href&quot;:&quot;https://github.com/tftelkamp/single_chan_pkt_fwd&quot;,&quot;type&quot;:&quot;story&quot;,&quot;location&quot;:&quot;story&quot;},&quot;clickOpts&quot;:{&quot;delayRedirect&quot;:true}}">The single_chan_pkt_fwd source code</a></li> </ul> <p class="hckui__typography__bodyL">...and countless of other online resources from here &amp; there...</p> <div class="media-left"> </div> <div> </div> </div> <p class="hckui__typography__bodyL"><span><br /></span></p> <p class="hckui__typography__bodyL"><span style="color: #ff0000;"><span style="color: #000000;"><br /></span></span></p> <p class="hckui__typography__bodyL"><span style="color: #ff0000;"><br /></span></p> <p class="hckui__typography__bodyL"><span><br /></span></p> </div> </div> </div> </div> </div>
$ 81.90

Hackster

Mattias LarssonMattias Larsson

Published May 8, 2017 © MIT
 
This project is from Hackster and for more details about this project pls visit:

https://www.hackster.io/laserbrain/a-lorawan-the-things-network-gateway-for-windows-iot-core-441210

Story

Write your review

LoRaWAN "The Things Network" Gateway for Windows IoT Core

LoRaWAN "The Things Network" Gateway for Windows IoT Core

Build your own LoRaWAN "The Things Network" packet-forwarding gateway on Windows 10 IoT Core in native .NET code.

Write your review