How to: Node with raspberry pi + dragino hat

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.

2 Likes

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).

1 Like

@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.

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

Hi

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

lmic_pi


This uses ABP Activation Method

Dragino Shield für Raspberry Pi



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:

1 Like

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.

1 Like

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

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

thanks

HH

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

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

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

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

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 ?

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…

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.

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

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

and again here:

1 Like

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

Thanks for your help

1 Like