Some changes have been made by the TTN network,I have updated this project in January 15th,more info about the changes please check below links:



If you have any problem with this project,you can connact us by support@dragino.com or post the problems on the TTN forum (Special thanks to @CurlyWurly).

Over here,we will use the Lora Shileld,MEGA2560 and Raspberry Pi to build a single channel LoRaWAN gateway.

LoRa Technology is a wireless modulation for long-range, low-power, low-data-rate applications. By achieving a range of more than 15 kilometers in a suburban environment and more than 2 kilometers in a dense urban environment, LoRa technology solutions target multiple application domains, such as Internet-of-Things (IoT), metering, security, and machine-to-machine (M2M).

This single channel LoRaWAN gateway is a proof-of-concept implementation,that can be used for development and node testing. It is not a replacement for a real multi channel/multi SF gateway! It supports some LoRaWAN features, but due to its static nature (single channel) it is not fullyLoRaWAN compatible (and will never be).
By default it works with the TTN backend, for testing and development.
Refer to the summary of Thomas

Step 1: Hardwares

In this project,we use the things as followed list:

  • Two Lora Shields v95-868
  • Raspberry Pi 2(Installed Raspbian)
  • MEGA 2560
  • LED display screen
  • USB cables
  • Antennas(868MHZ)
  • Computer
  • Wireless network card
  • Mouse and keyboard
  • Dupont Lines
Hi,all,<br><br>In this project, you can see how to &quot;Use Lora Shield + Arduino set up a Lora Node&ldquo;,You can also get how to &quot;Use Lora/GPS HAT + RaspberryPi to set up a Lora Node&quot; as below:
<p><a href="http://wiki.dragino.com/index.php?title=Lora/GPS_HAT#Use_Lora.2FGPS_HAT_.2B_RaspberryPi_to_set_up_a_Lora_Node">http://wiki.dragino.com/index.php?title=Lora/GPS_HAT#Use_Lora.2FGPS_HAT_.2B_RaspberryPi_to_set_up_a_Lora_Node</a></p>
<p>How do I configure the gateway code with 915MHz in Australia?? </p>
<p>Hi David,</p><p>I just ordered my first three LoRa shield from Dragino (2 for RPi and 1 for Arduino). Before I start the project I just want to ask is it possible that I have 2 nodes sending sensor data (1 RPi + 1 Arduino) to 1 gateway (RPi) and then send the data to the internet (MQTT possibly). I ask this question because you mentioned in this tutorial that this is to develop single channel LoRaWAN gateway.</p><p>Sorry, I'm totally newbie with this LoRa things.</p><p>Thanks in advance :)</p>
<p>Yes,you can do it as what you said.</p>
<p>Hi david,</p><p>I already bought the 433MHz version. Do you have any tutorials for this version? Thanks</p>
<p>Hi, David.</p><p>I have two lora shield and newbie for internet of thing. I would like to know that is that possible to communicate/send the data to one specific Lora shield without using any internet. The lora shield is connect with RPI and sent data to another lora shield connected with arduino. Is it possible and any other methods to achieve it? </p>
<p>Some of the Gateway connections were not clear to me and without connecting 3.3V on both Shield and RPI and the 5V on both shield and RPI the radio was not recognized. </p><p>So below are the Dragino Shield pins I used to get the Gateway working:</p><p>- ICSP header pins 4, 1 &amp; 3 for MOSI, MISO and SCK (using D11, D12 &amp; D13 on the shield didn't work!)</p><p>- I used both 3.3V as well as 5V, otherwise the PWR LED didn't burn and the shield would not function at all (probably because of the level shifters) </p><p>- RFM header pins 1 and 7 to connect DIO0 and RST</p><p>- D10 for NSS</p><p>- GND for GND</p>
There,have you installed the wiringpi?
<p>Yes I've installed wiringpi.</p><p>I don't have any problems, after using the connections as described in my reply, since for me that part of your instructions were not clear.</p><p>You described to use the SPI connections (MOSI, MISO and SCK), but since you can find them on the ICSP header AND on D11, D12 &amp; D13, I found out that only the ICSP worked for me.<br></p><p>You described to use 3.3V, but I found that the level shifters needed both 5V and 3.3V.</p><p>Using the RFM header for DIO0 and RST was obvious.</p><p>NSS on D10 was not clear for me. </p><p>I've added a picture showing the connections I used.</p>
<p>You can check the hardware resource here:<a href="https://github.com/dragino/Lora" style="">https://github.com/dragino/Lora</a></p>
<p>Uhm,I think you need to follow the connections as above article and cheeck your wiring ,don't use 3.3V on the LoRa Shield </p>
<p>Hi David, In my country using 433Mhz, but in the step 5, I can't find this choice. This gateway in TTN for 868 and 915Mhz and don't have the choice for 433Mhz. Can you help me for this problem ? :(</p>
<p>The LoRaWan protocol doesn't support 433Mhz,you can click <a href="http://www.lora-alliance.org/">http://www.lora-alliance.org/</a> for more informations.</p>
<p>where can i get global_conf.json or local_conf.js file ?</p>
<p>Hi,durvesh,what the software are you using in the RPi side ?</p><p>You can find kinds of pkt_fwd on the Github,such as :</p><p><a href="https://github.com/tftelkamp/single_chan_pkt_fwd">https://github.com/tftelkamp/single_chan_pkt_fwd</a></p><p><a href="https://github.com/hallard/single_chan_pkt_fwd">https://github.com/hallard/single_chan_pkt_fwd</a></p><p><a href="https://github.com/TheThingsNetwork/packet_forwarder/tree/master/poly_pkt_fwd">https://github.com/TheThingsNetwork/packet_forwarder/tree/master/poly_pkt_fwd</a></p><p><a href="https://github.com/proffalken/single_chan_pkt_fwd">https://github.com/proffalken/single_chan_pkt_fwd</a></p>
<p>Hi David, </p><p>is there any source code in C for the GPS module? I am trying to integrate GPS and LoRa module together thanks</p>
<p><a>http://wiki.dragino.com/index.php?title=Lora/GPS_HAT#Example2_--_Getting_GPS_to_work_on_a_Raspberry_Pi</a> Have you check this link?</p>
<p>I'll check it out thanks</p>
<p>Hi, I am trying to use GPS HAT and RPi to join network with OTAA, any sample code for OTAA?? thanks. </p>
<p>Hi,guys,you can find the examples here:<a href="https://github.com/matthijskooijman/arduino-lmic/tree/master/examples">https://github.com/matthijskooijman/arduino-lmic/tree/master/examples</a></p>
It look nice!!
<p>David </p><p>I'm having problems with the TTN web. When I enter to &quot;my profile&quot; isn't the option to add a new gateway, it just say &quot;claim a gateway&quot;, as the picture shows. Some other links that you show in the instructable are broken. </p><p>On another hand, I found the console link on TTN (https://console.thethingsnetwork.org/gateways) where I can add gateways and apps but some features are different, I don't know if it will work with simple gateway software. It doesn't work for me, but I could have another problem. </p><p>Could you help me?</p><p>Thanks!</p>
Copy that,and I will update this intruction after my vacation
<p>Hi! I'm working with the libellium sx1272 ans a cooking hacks shield to connect it with the raspi. I'm having Unrecognizer transceiver problems &iquest;any suggestion?</p><p>Thanks!</p>
<p>Uhm,sorry to reply so late,how is it going?Did you check your wiring?</p>
<p>I had to chage the pins for the following:</p><p> ssPin=10; </p><p>dio0=0;</p><p>RST=7;</p><p>I have to do more tests, but for now it works</p>
<p>Ok,too busy these days,good luck!</p>
<p>Hi David, I am doing a final year project similair to this but using LoRa gateway and waspmote. I am trying to use cutecom to configure the gateway but not recieving any information packet in response to the READ command. any help ??</p>
<p>Hi,have you finished it ?And I need more details about your project</p>
<p>Hey, is it possible to run the &quot;Single channel gateway packet forward source&quot; automatic at start?</p>
<p>Yes,but you need to make sure your gateway settings is ok.</p>
<p>To make the &quot;unrecognized transceiver&quot; errors go away I had to change</p><blockquote>bool sx1272 = true;</blockquote><p>to</p><blockquote>bool sx1272 = false;</blockquote><p>in main.cpp</p>
<p>where is that ? </p>
In the folder single_chan_paket_fwd,there is a file called main.cpp
<p>Hi, David.<br>I have bought 2 lora shields. I'm a newbie for network thing, want to know that is it possible to make the multiple Lora shields to communicate/send the data to one specific Lora shield through the method introduced as above. (build a LoraWan gateway) And what if my case is without using any internet, is it any other methods to achieve it?</p>
Hi JesseW78,as what you said,you can do that,bu it's not &quot;LoRaWan&quot; anymore,and you can use the Radiohead.Uhm,tell me you email and I'll send you the sketches,david@dragino.com,hope it help~
<p>ok, my email-<br><br>jchening@gmail.com</p>
<p>Hi, there is an error when checking <a href="https://www.thethingsnetwork.org/api/v0/gateways/B827EBFFFFxxxxxxx/" rel="nofollow">https://www.thethingsnetwork.org/api/v0/gateways/B...</a></p><p>using my own ID I get:<br><br> &quot;error&quot;:&quot;Cannot connect to database!&quot;</p><p>what is wrong?</p><p>also, how can I use the lora antennas to transmit from my arduino (shield) to my rpi (hat) without all the hassle of TTN and encryption etc? They are making me run before I walk. </p><p>Thank you very much for you help</p>
<p>I am new to this , my question is what does it mean by single channel gateway?</p>
<p>I've a problem with my gateway:</p><p>I can see that the Gateway receives packages at the terminal of the RPI, but I can't see the messages at the TTN dashboard.<br>As a node I use a RN2483.</p><p>Does someone have an idea where the problem could be?</p><p>Thank you.</p>
<p>I have the same problem, the gateway receives, but i can't see the messages at hte TNN dashboard. Tried as IP but still nothig. Any Ideas?</p>
Hi FelixKunz,<br>Can you access the server via this IP? Did you have a try?<br>
<p>Problem solved, use as IP for Europe!</p>
<p>Good! If there is any problem with this project,you can contact us by e-mail.</p><p>Cheers!</p>
<p>Hi David</p><p>Thanks for your tutorial. I have one question about setting server. How can I configure my own server? What software do we need for server and also gateway?</p><p>Thanks in advance.</p>
Hi,sama moh,I think it's better to view the ttn web to get what you need
<p>Hi David, great tutorial, thanks! Is it possible to increase the rate at which data arrives from the node to the TTN message dashboard? If so, can you explain what code modifications are needed please?</p>
<p>YES,it is.you can. You need to modify the arduino sketch as the picture below,you need to uncommand some of the &quot;LMIC_setupChannel&quot;</p>

About This Instructable




More by David_Dragino:Use the LoRa Kit to build your own IoT network Dragino LoRa GPS Tracker How to get sensor data from a remote Arduino via Wireless Lora Protocol 
Add instructable to: