How to: Node with raspberry pi + dragino hat


(Philip V.) #1

Hi all,

Taking my first steps with lora and the ttn. I'm using a "Dragino Lora/GPS HAT" with a raspberry pi 3 model b.
I've read through the dragino wiki and tried to build a gateway and a node like described here: http://wiki.dragino.com/index.php?title=Use_Lora/GPS_HAT_%2B_RaspberryPi_to_set_up_a_Lora_Node

The gateway seems to work. I added him in the ttn production environment console. It seems that this dragino wiki page is already a bit outdated. I couldn't build a node, because in my opinion the example is not working with the production environment.

Now I'm searching for a tutorial to build a node (raspberry pi + dragino hat), which works with the production environment. Does anyone know a good tutorial or could someone already successfully create a lora node with raspberry pi and dragino?

Many many thanks, already in advance for any help or helpful tips.


Dragino Lora node With Raspberry Pi 3
#2

The good news is that the wiki is mostly OK. In the end you can get ABP to work OK between an "Arduino/Dragino shield" node and R.Pi/Dragino Hat gateway to the TTN Prod environment - but like all "single channel" solutions (I think), not all messages will get through - (N.B. they would if you had a "multiple channel" solution)

It seems you are using 2 x R.Pi? The following is more for R.Pi and Arduino, but hopefully it proves useful

For the single channel packet forwarder code

For the Arduino code,

  • Remember to use the LMIC library and use the following formats in TTN
    DEVADDR - HEX
    NWKSKEY - MSB
    APPSKEY - MSB

  • Check that you are using the following pin mapping
    const lmic_pinmap lmic_pins = {
    .nss = 10,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = 9,
    .dio = {2, 6, 7},
    };

  • Temporarily change the timeout from 60 to 1 e.g. const unsigned TX_INTERVAL = 1;
    but even though you have set this extremely low, a message only turns up in the TTN backend about once a minute and lots of messages are ignored. Once you have proved connectivity, set the timeout back to 60 and you will get a higher percentage of messages being received (up to 1 in 3 getting though).

(Philip V.) #3

@CurlyWurly

Tanks for your answer. Finally I got this working. Falsely I used OTAA to connect to ttn. This isn't working with single channel gateway. So I switched to ABP and now it works.


(Adil Hidayat) #4

Did you encounter any errors while compiling the code? I'm running an exactly similar setup but i'm getting the following error:

root@my6:~/single_chan_pkt_fwd-master# make
g++ -c -Wall base64.c
g++ -c -Wall main.cpp
main.cpp:166:1: error: expected ‘,’ or ‘;’ before ‘void’
 void die(const char *s)
 ^
main.cpp: In function ‘void sendudp(char*, int)’:
main.cpp:324:23: error: ‘die’ was not declared in this scope
         die("sendto()");
                       ^
main.cpp: In function ‘int main()’:
main.cpp:553:21: error: ‘die’ was not declared in this scope
         die("socket");
                     ^
Makefile:14: recipe for target 'main.o' failed
make: *** [main.o] Error 1
root@my6:~/single_chan_pkt_fwd-master# nano main.cpp

#5

Hi

I made a GPS TTN_sender with ABP Activation Method from this 2 projects:

lmic_pi

https://github.com/ernstdevreede/lmic_pi
This uses ABP Activation Method

Dragino Shield für Raspberry Pi
https://github.com/verschwoerhaus/ttn-ulm-doku/wiki/Dragino-Shield-f%C3%BCr-Raspberry-Pi
https://github.com/verschwoerhaus/ttn-ulm-node-dragino
This uses OTAA (Over-the-air activation)

You can use it with any LoRa gateway. I use it with this:

Build Lora gateway using Raspberry Pi 3 model B and Dragino Lora shield v95
http://www.mobilefish.com/developer/lorawan/lorawan_quickguide_build_lora_gateway.html

You can download it from here:
https://github.com/abszolut/opensource/tree/master/DraginoLoRaGPShat


(Sandgroper) #6

TTN made changes on Last week (March 17) and as a result the Single Channel Gateway software for the Pi, linked in your post, no longer works with TTN.


(Hsn548) #7

Hi all,
I am trying to make a node with dragino and raspberry pi3 but i am not sure where to start, can somebody please guide me? or if someone has a sample code of a node to send dummy values to a gateway? I wil be really thankful.

Thanks


(Hsn548) #8

Hi Csabagod, can you provide me the code to just send the hello world to the gateway? i will be really thankful.

thanks

HH


(Hsn548) #9

Hi all,
I am new to Lora and i find it to confusing as i havent worked with anything similar to lora before. I hve two dragino lora hat v1.4 . I want to send some random values to a gateway every 1 or 2 minutes. But i am not sure where to start. I have seen some tutorials for the lora gateway with raspberry pi3 but i havent seen any tutorial for the lora node with raspberry pi3. Can somebody guide where to start? Which will be the good starting point? or if somebody has an example to make a lora node with raspberry pi3 and dragino. thanks


#10

do you own a gateway or have a gateway in range ?
what did you try yourself ?

did you see this http://wiki.dragino.com/index.php?title=Use_Lora/GPS_HAT_%2B_RaspberryPi_to_set_up_a_Lora_Node


(Hsn548) #11

Hi Borroz,
Thanks for your reply.i made a gateway with the help of same tutorial you have mentioned but i am not able to get the node running. its showing the following errors …
Unknown interrupt flags for FSK
FAILURE
radio.c:630


(Hsn548) #12

I changed the NSS pin from Pin24 to Pin22 and It starts working and showing this output
OhOh. Unknown interrupt flags for FSK

Event EV_TXCOMPLETE, time: 6
[634ff] (1513260661) Thu Dec 13 …

Is this a right output?
But i dont get anything at TTN and after some of this output my RPI get stucks and i have to restart it again…

Thanks


#13

sorry I don’t have a dragino RPI shield, hope someone else can help you.
You registered your gateway, you registered an application with that node ?


(Hsn548) #14

Are you using some other hat for raspberry pi ? if yes then which one?
and yes i already have registered,
gateway is showing as connected. but application status is never seen… i dont know whether i have done the TTN configuration wrong or there is some problem at the dragino end…

what does that error mean? “OhOh. Unknown interrupt flags for FSK”

and is this a right respone? "[634ff] (1513260661) Thu Dec 13 …"
if some one else can help me in this regard…


#15

understand that you build a single channel gateway with an RPI and Dragino hat.
these are only advised for tests and do not have the full functionality on the TTN network.

so if you build a node, in your case also with a dragino hat, make sure that node and gateway are set to the same frequency.


(Hsn548) #16

Yes you r right.
I am also having problem in understanding the DEVEUI, DEVKEY, and DEVADDR. Where to get these? or we can assign some random?
I know we can get The APPEUI and ARTKEY from the TTN registered application and i am using that from the TTN but i am not sure about the DEVEUI, KEY and DEVADDR.
thanks


#17

info on device registration (your new node) can be found here:
https://www.thethingsnetwork.org/docs/devices/registration.html

and again here:


(Hsn548) #18

Hi Borroz,
Its working now,i were actually using ABP in my code but in the application it was OTA.

Thanks for your help


(Brady Aiello) #19

I’m trying to do something similar with US915. What exactly did you modify to get it working?


(Jtisaacs) #20

Hi hsn548,

I am trying to use the Dragino Lora/GPS Hat as an end-node with OTAA. Did you use OTAA or ABP?

If OTAA, how did you determine the Device EUI?

Thank you for your help.