# Node based on Raspberry?

**URL:** <https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003>\
**Category:** End Devices (Nodes)\
**Created:** [January 10, 2016, 8:29pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003 "2016-01-10T20:29:39Z")\
**Posts on this page:** 14\
**Page:** 5

<div class="post-metadata">

**Author:** ![itacos](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/i/b4bc9f/32.png) [@itacos](https://www.thethingsnetwork.org/forum/u/itacos)\
**Post date:** [April 14, 2017, 2:41pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/83 "2017-04-14T14:41:02Z")

</div>

Hi @wklenk,

Thank you very much for your **Dragino LoRa/GPS HAT** Hardware Abstraction Layer for the IBM LMIC library.

I’m trying to use it on my rPi 3 and Dragino HAT but I encounter some problems

I thing I have all prerequisites to run your `Hello` example but unfortunately it doesn’t work 😏

```auto
# ./build/hello.out
000000000 HAL: Initializing ...
000000001 HAL: Set radio RST pin to 0x00
000000001 HAL: Wait until 000000002 ms
000000002 HAL: Set radio RST pin to 0x02
000000002 HAL: Wait until 000000007 ms
000000008 HAL: Failed. Aborting.

```

I’m suspecting a pin problems …

I hope, you (or someone else here 😊) can help me to get it work.

Here is an output of `gpio readall` just a reboot :

```auto
 +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+
 | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | | | 3.3v | | | 1 || 2 | | | 5v | | |
 | 2 | 8 | SDA.1 | ALT0 | 1 | 3 || 4 | | | 5v | | |
 | 3 | 9 | SCL.1 | ALT0 | 1 | 5 || 6 | | | 0v | | |
 | 4 | 7 | GPIO. 7 | IN | 0 | 7 || 8 | 1 | ALT5 | TxD | 15 | 14 |
 | | | 0v | | | 9 || 10 | 0 | ALT5 | RxD | 16 | 15 |
 | 17 | 0 | GPIO. 0 | IN | 1 | 11 || 12 | 0 | IN | GPIO. 1 | 1 | 18 |
 | 27 | 2 | GPIO. 2 | IN | 0 | 13 || 14 | | | 0v | | |
 | 22 | 3 | GPIO. 3 | IN | 0 | 15 || 16 | 0 | IN | GPIO. 4 | 4 | 23 |
 | | | 3.3v | | | 17 || 18 | 0 | IN | GPIO. 5 | 5 | 24 |
 | 10 | 12 | MOSI | ALT0 | 0 | 19 || 20 | | | 0v | | |
 | 9 | 13 | MISO | ALT0 | 0 | 21 || 22 | 1 | IN | GPIO. 6 | 6 | 25 |
 | 11 | 14 | SCLK | ALT0 | 0 | 23 || 24 | 1 | OUT | CE0 | 10 | 8 |
 | | | 0v | | | 25 || 26 | 1 | OUT | CE1 | 11 | 7 |
 | 0 | 30 | SDA.0 | IN | 1 | 27 || 28 | 1 | IN | SCL.0 | 31 | 1 |
 | 5 | 21 | GPIO.21 | IN | 1 | 29 || 30 | | | 0v | | |
 | 6 | 22 | GPIO.22 | IN | 1 | 31 || 32 | 0 | IN | GPIO.26 | 26 | 12 |
 | 13 | 23 | GPIO.23 | IN | 0 | 33 || 34 | | | 0v | | |
 | 19 | 24 | GPIO.24 | IN | 0 | 35 || 36 | 0 | IN | GPIO.27 | 27 | 16 |
 | 26 | 25 | GPIO.25 | IN | 0 | 37 || 38 | 0 | IN | GPIO.28 | 28 | 20 |
 | | | 0v | | | 39 || 40 | 0 | IN | GPIO.29 | 29 | 21 |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
 +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+

```

SPI is activated with `raspi config` here is an `lsmod` output :

```auto
Module Size Used by
evdev 11396 2
brcmfmac 186403 0
brcmutil 5661 1 brcmfmac
cfg80211 428871 1 brcmfmac
rfkill 16037 2 cfg80211
hid_apple 4925 0
spi_bcm2835 6678 0
i2c_bcm2708 4834 0
bcm2835_gpiomem 3040 0
bcm2835_wdt 3225 0
uio_pdrv_genirq 3164 0
uio 8000 1 uio_pdrv_genirq
i2c_dev 5859 0
ipv6 347556 32

```

I just have a doubt about `spidev` I don’t know how to activate it, a `modprobe spidev` do nothing …

`Wiringpi` and `bcm2835` are installed too.

Thanks for your help 🙂

Regards

---

<div class="post-metadata">

**Author:** ![ccadic](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ccadic/32/32636_2.png) [@ccadic](https://www.thethingsnetwork.org/forum/u/ccadic)\
**Post date:** [April 16, 2017, 2:47pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/84 "2017-04-16T14:47:28Z")

</div>

![](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/f/f4a896e2edd2dc8c246896fd4ec5555b16941657.jpg)

I’m currently testing my RPi Zero W TTN Shield

More on:

> <https://twitter.com/pwavrobot/status/853612326020411393>

---

<div class="post-metadata">

**Author:** ![robg66](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@robg66](https://www.thethingsnetwork.org/forum/u/robg66)\
**Post date:** [April 24, 2017, 7:15am UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/85 "2017-04-24T07:15:38Z")

</div>

@itacos did you got it working?

---

<div class="post-metadata">

**Author:** ![ccadic](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ccadic/32/32636_2.png) [@ccadic](https://www.thethingsnetwork.org/forum/u/ccadic)\
**Post date:** [April 24, 2017, 8:28am UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/86 "2017-04-24T08:28:03Z")

</div>

Yes. Working perfectly. 1 week uptime now with no issue.

![](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/c/c164e53c6ab1337063ffb96d01a5d13987b014f1.jpg)

> **[Raspberry PI0W Lora Shield with I2C and OLED by ElectronicTricks on Tindie](https://www.tindie.com/products/electronictrik/raspberry-pi0w-lora-shield-with-i2c-and-oled/)**
>
> RPI0w shield to help you create 868/430/905 Mhz Lora Internet Of Things devices on a Raspberry PI Zero classic of Wifi

---

<div class="post-metadata">

**Author:** ![itacos](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/i/b4bc9f/32.png) [@itacos](https://www.thethingsnetwork.org/forum/u/itacos)\
**Post date:** [April 30, 2017, 9:19pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/87 "2017-04-30T21:19:30Z")

</div>

Hello,

After some advanced tests, i can say that joining with OTAA and transmit data on my gateways works.

Sometimes, some segmentation faults occurred, randomly at the begin or after some minutes of execution, but I did not identified the root cause yet.

---

<div class="post-metadata">

**Author:** ![bauvill](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/b/71c47a/32.png) [@bauvill](https://www.thethingsnetwork.org/forum/u/bauvill)\
**Post date:** [June 4, 2018, 2:15pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/88 "2018-06-04T14:15:28Z")

</div>

Hi Wklenk,  
thanks for your awesome solution . I tested the code you provided and the uplink tx seems to work perfectly( I could test only the uplink since my gateway is a single channel based on the modified version of the dual\_chan\_pkt\_fwd). However, my single channel gateway offers a function to send downstream data.  
I would like to test is with your implementation of the LMIC v1.6 using the ABP activation method. The point is that I want to send downlink data to my node ( running your software) at a random time and see if the node receives the data. I wanted to modify the periodic example so that it uses the APB method to send data to my local server over my gateway. Can you please guide me on this?

---

<div class="post-metadata">

**Author:** ![wklenk](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/wklenk/32/44682_2.png) [@wklenk](https://www.thethingsnetwork.org/forum/u/wklenk)\
**Post date:** [June 4, 2018, 3:27pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/89 "2018-06-04T15:27:06Z")

</div>

Hi,

some clarifications first:

- Whether you use OTAA or ABP for activation does have nothing to do with sending download data. It is just the method how to “join” the network. The examples I provide use OTAA. First task would be to get them working using ABP.
- You cannot send “data to your node at a random time”. With LoRa Class A devices, you can only **receive** data after you have **sent** data. But let’s say you get the “periodic” example running with ABP, e.g. sending some dummy data every 5 minutes, and you manage to send something back in the TTN backend, then it should be possible to receive data.
- But I have made bad experiences with these “single channel” gateways. Are you really sure that it supports downlink messages?

---

<div class="post-metadata">

**Author:** ![bauvill](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/b/71c47a/32.png) [@bauvill](https://www.thethingsnetwork.org/forum/u/bauvill)\
**Post date:** [June 4, 2018, 4:59pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/90 "2018-06-04T16:59:14Z")

</div>

Thanks for your prompt reply and also thanks for the clarifications.  
The issue is that I tried your LMIC v1.6 code on my Lora Node (RPI+Dragino) and my gateway based on the same components as my node runs the dual channel packet forwarder from ([https://github.com/bokse001/dual\_chan\_pkt\_fwd](https://github.com/bokse001/dual_chan_pkt_fwd)).  
During the test, I realized that server replies to uplinks message but my node never receives them.  
Since it is a thesis project, I wanted to make sure that it is not possible to send downlink messages using the RPI+DRAGINO HAT as the gateway. I would like to have your advice on this. That is why I have the following questions:

Q1- Is it possible to have uplink and downlink message on a single channel gateway sending in both directions on the same frequency ( e.g 868.1) and also configuring the client to send then listen on the same frequency?

**Note: It is obviously far from being LoRaWAN compliant**

---

<div class="post-metadata">

**Author:** ![brady\_aiello](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/brady_aiello/32/27724_2.png) [@brady\_aiello](https://www.thethingsnetwork.org/forum/u/brady_aiello)\
**Post date:** [June 12, 2018, 7:47pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/91 "2018-06-12T19:47:59Z")

</div>

I have not been able to get this to work with the Raspberry Pi 3 B+ (esp. for the US). I have it running, but it doesn’t show up in the TTN console (never seen). I did the following:

1. Change config.h to have: #define CFG\_us915 1
2. Change line 764 of lmic.c to LMIC.channelMapp[channel/16] &= ~(1\<\<(channel&0F));
3. Added in all session keys, eui’s and dev address.

Also doesn’t show up in gateway traffic, though it is running.

What am I missing?

---

<div class="post-metadata">

**Author:** ![stic-ttn](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/stic-ttn/32/25844_2.png) [@stic-ttn](https://www.thethingsnetwork.org/forum/u/stic-ttn)\
**Post date:** [June 24, 2018, 12:57am UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/92 "2018-06-24T00:57:52Z")

</div>

hello melvin i have always the same probleme with the 0h0h Unknown interrupt flags for Fsk, did you find the solution? and i’m trying to send the message with boucle while did you get it? because once i made run the message will be sended juste one time .

thank you

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [June 24, 2018, 7:29am UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/94 "2018-06-24T07:29:37Z")

</div>

you realize that this topic is 2 years old ??

[0#90]

---

<div class="post-metadata">

**Author:** ![stic-ttn](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/stic-ttn/32/25844_2.png) [@stic-ttn](https://www.thethingsnetwork.org/forum/u/stic-ttn)\
**Post date:** [June 24, 2018, 11:03am UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/95 "2018-06-24T11:03:30Z")

</div>

i know but i didn’t find another example to send message to the things network. can u help me plz if you know or have an idea.

thank you

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [June 24, 2018, 11:15am UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/96 "2018-06-24T11:15:49Z")

</div>

start searching this forum

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [June 24, 2018, 11:20am UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/97 "2018-06-24T11:20:07Z")

</div>



[Previous page](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003.md?page=4)
