# 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:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam\_bruurs](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/s/dc4da7/32.png) [@sam\_bruurs](https://www.thethingsnetwork.org/forum/u/sam_bruurs)\
**Post date:** [January 10, 2016, 8:29pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/1 "2016-01-10T20:29:39Z")

</div>

Does anyone know if there is sourcecode available to connect a RFM95W (SX1276) on raspberry and use it as a node ?

---

<div class="post-metadata">

**Author:** ![ernestopace](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ernestopace/32/30510_2.png) [@ernestopace](https://www.thethingsnetwork.org/forum/u/ernestopace)\
**Post date:** [January 10, 2016, 10:59pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/2 "2016-01-10T22:59:34Z")

</div>

I made a port of the IBM LMIC code to Raspberry. It’s not fully finished, but seems to work.

It’s on [https://github.com/ernstdevreede/lmic\_pi](https://github.com/ernstdevreede/lmic_pi).

Let me know if you run into problems.

---

<div class="post-metadata">

**Author:** ![sam\_bruurs](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/s/dc4da7/32.png) [@sam\_bruurs](https://www.thethingsnetwork.org/forum/u/sam_bruurs)\
**Post date:** [January 11, 2016, 9:24pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/3 "2016-01-11T21:24:51Z")

</div>

Thanks Ernesto! Just tested and it works like a charm!

What are you planning to add ? (because you said it is not fully finished)

---

<div class="post-metadata">

**Author:** ![ernestopace](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ernestopace/32/30510_2.png) [@ernestopace](https://www.thethingsnetwork.org/forum/u/ernestopace)\
**Post date:** [January 11, 2016, 10:35pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/4 "2016-01-11T22:35:59Z")

</div>

There is an issue I have to fix with the internal clock (hal\_ticks() in hal.c) (it wraps after some hours, long-pausing or hanging the program).  
I also want to add a more realistic code example .  
I will soon add the fixes to the repo.

---

<div class="post-metadata">

**Author:** ![garymortimer](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/garymortimer/32/35697_2.png) [@garymortimer](https://www.thethingsnetwork.org/forum/u/garymortimer)\
**Post date:** [January 12, 2016, 12:00pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/5 "2016-01-12T12:00:15Z")

</div>

Could I twist your arm to add GPS… My single channel gateway running on a Pi also keeps hanging I have a sense its power glitches.

---

<div class="post-metadata">

**Author:** ![sam\_bruurs](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/s/dc4da7/32.png) [@sam\_bruurs](https://www.thethingsnetwork.org/forum/u/sam_bruurs)\
**Post date:** [January 12, 2016, 12:42pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/6 "2016-01-12T12:42:32Z")

</div>

I also have a single channel gateway running on PI for several days now. How much time before it crashes ?

Also a 2Amp power supply is best to run a PI on.

---

<div class="post-metadata">

**Author:** ![garymortimer](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/garymortimer/32/35697_2.png) [@garymortimer](https://www.thethingsnetwork.org/forum/u/garymortimer)\
**Post date:** [January 12, 2016, 12:51pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/7 "2016-01-12T12:51:31Z")

</div>

Less than 24 hours, yesterday I swapped the SD card out as well just in case it was that

---

<div class="post-metadata">

**Author:** ![sam\_bruurs](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/s/dc4da7/32.png) [@sam\_bruurs](https://www.thethingsnetwork.org/forum/u/sam_bruurs)\
**Post date:** [January 12, 2016, 1:10pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/8 "2016-01-12T13:10:03Z")

</div>

Ok, A good way to determine you have power glitches is to verify that you can use any USB devices. If not, you had a glitch. (Also the LAN network is working through the USB controller on the Raspberry)

I doubt if the SD card is using up much power.

---

<div class="post-metadata">

**Author:** ![garymortimer](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/garymortimer/32/35697_2.png) [@garymortimer](https://www.thethingsnetwork.org/forum/u/garymortimer)\
**Post date:** [January 12, 2016, 1:12pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/9 "2016-01-12T13:12:32Z")

</div>

Ah USB does hang so that’s interesting. I thought the card might be a bit dodgy rather than it was using power.

---

<div class="post-metadata">

**Author:** ![sam\_bruurs](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/s/dc4da7/32.png) [@sam\_bruurs](https://www.thethingsnetwork.org/forum/u/sam_bruurs)\
**Post date:** [January 12, 2016, 2:29pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/10 "2016-01-12T14:29:01Z")

</div>

Just power your PI with a 2 Amp adapter and you’ll be fine.

---

<div class="post-metadata">

**Author:** ![andrewl](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/andrewl/32/37697_2.png) [@andrewl](https://www.thethingsnetwork.org/forum/u/andrewl)\
**Post date:** [January 12, 2016, 6:00pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/11 "2016-01-12T18:00:44Z")

</div>

We have a Raspberry Pi board for the Pi-Zero based on the RN2483 LoRaWAN module. One of our community members is making good progress with it.

[Pi-Zero LoRaWAN](http://thethingsnetwork.org/c/thatcham/post/81)

Thanks

Andrew

---

<div class="post-metadata">

**Author:** ![IoT\_Marco](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/iot_marco/32/45432_2.png) [@IoT\_Marco](https://www.thethingsnetwork.org/forum/u/IoT_Marco)\
**Post date:** [January 12, 2016, 6:27pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/12 "2016-01-12T18:27:23Z")

</div>

Awesome Andrew, I think that’s a fine combination for a node, hope to see more soon!

---

<div class="post-metadata">

**Author:** ![garymortimer](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/garymortimer/32/35697_2.png) [@garymortimer](https://www.thethingsnetwork.org/forum/u/garymortimer)\
**Post date:** [January 14, 2016, 9:03pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/13 "2016-01-14T21:03:28Z")

</div>

@ ernestopace a noob question, how would I change the frequency to 433.175 using an RFM 98(1278)

I assume its here somewhere

#define CFG\_sx1276\_radio 1  
#define CFG\_eu868 1

Many thanks for your time

---

<div class="post-metadata">

**Author:** ![ernestopace](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ernestopace/32/30510_2.png) [@ernestopace](https://www.thethingsnetwork.org/forum/u/ernestopace)\
**Post date:** [January 14, 2016, 10:25pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/14 "2016-01-14T22:25:21Z")

</div>

The LMIC code only supports 868.1 and 915 MHz.  
The chip might be compatible with the SX1276, but I can’t help you with all the register values for specifying frequencies etc.

Good luck.

---

<div class="post-metadata">

**Author:** ![garymortimer](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/garymortimer/32/35697_2.png) [@garymortimer](https://www.thethingsnetwork.org/forum/u/garymortimer)\
**Post date:** [January 15, 2016, 3:36am UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/15 "2016-01-15T03:36:58Z")

</div>

Blast, seems like its difficult to be legal elsewhere! I guess the majority of devices as they roll out will be in the 868 or 915 range which will cause issues as those frequencies are used for other things here. Thanks for your time answering though.

---

<div class="post-metadata">

**Author:** ![garymortimer](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/garymortimer/32/35697_2.png) [@garymortimer](https://www.thethingsnetwork.org/forum/u/garymortimer)\
**Post date:** [January 15, 2016, 4:21am UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/16 "2016-01-15T04:21:15Z")

</div>

Actually looking at the ISM band plan more of the world uses 433 than 868/915 so maybe I’m wrong!

![](https://www.thethingsnetwork.org/forum/uploads/default/original/1X/04421e3a118a99326fcc2930e5e264ebffeea7d5.jpg)

---

<div class="post-metadata">

**Author:** ![raymonvdm](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/r/839c29/32.png) [@raymonvdm](https://www.thethingsnetwork.org/forum/u/raymonvdm)\
**Post date:** [March 3, 2016, 10:11am UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/17 "2016-03-03T10:11:32Z")

</div>

I`m trying to build a RaspberryPi node to test a gateway using a hello packet. But i cannot get it to work (yet)

I have an RFM95 with the following pin-out

```
3v3 = VCC
GND = GND

GPIO10 = SPI_MOSI = MOSI
GPIO9 = SPI_MISO = MISO
GPIO11 = SPI_CLK = SCK

GPIO8 = SPI_SEL = nCS

```

To play with [https://github.com/CongducPham/LowCostLoRaGw](https://github.com/CongducPham/LowCostLoRaGw). So if it is possible to use this pin out it would be nice

I`m facing some dependency issues

`root@raspberrypi:/home/beheer/lmic_pi-master/lmic# make all g++ -c -o aes.o aes.c g++ -c -o hal.o hal.c g++ -c -o lmic.o lmic.c g++ -c -o oslmic.o oslmic.c g++ -c -o radio.o radio.c radio.c:526:19: error: type ‘<lambda>’ with no linkage used to declare function ‘void<lambda>::operator()() const’ with linkage [-fpermissive] radio.c: In lambda function: radio.c:526:21: error: expected ‘{’ before ‘=’ token radio.c: At global scope: radio.c:526:21: warning: lambda expressions only available with -std=c++0x or -std=gnu++0x [enabled by default] radio.c:526:44: error: no match for ‘operator=’ in ‘{(._88)0u} = 192’ radio.c:526:44: note: candidate is: radio.c:526:19: note: <lambda()>&<lambda()>::operator=(const<lambda()>&) radio.c:526:19: note: no known conversion for argument 1 from ‘int’ to ‘const<lambda()>&’ radio.c:527:17: error: type ‘<lambda>’ with no linkage used to declare function ‘void<lambda>::operator()() const’ with linkage [-fpermissive] radio.c: In lambda function: radio.c:527:21: error: expected ‘{’ before ‘=’ token radio.c: At global scope: radio.c:527:21: warning: lambda expressions only available with -std=c++0x or -std=gnu++0x [enabled by default]`

---

<div class="post-metadata">

**Author:** ![ernestopace](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ernestopace/32/30510_2.png) [@ernestopace](https://www.thethingsnetwork.org/forum/u/ernestopace)\
**Post date:** [March 3, 2016, 10:19pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/18 "2016-03-03T22:19:15Z")

</div>

The used pins can be configured in the lmic\_pinmap struct; see for example examples/thethingsnetwork-send-v1/thethingsnetwork-send-v1.cpp.  
I used GPIO6 for CS, because GPIO8 did not work immediately. You could try to put 8 in pins.nss.  
You also need to connect the RFM95’s DIO0/1/2 pins; they are used.

But first you’ll need to get the code to compile.  
The code compiles on my Raspberry. (with g++ version 4.9/4.9.2).  
The problem could lie in the trailing comma at the end of line 528, after 0x00. That comma can safely be removed.

Did you install the wiringPi package?

Good luck.

---

<div class="post-metadata">

**Author:** ![raymonvdm](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/r/839c29/32.png) [@raymonvdm](https://www.thethingsnetwork.org/forum/u/raymonvdm)\
**Post date:** [March 4, 2016, 3:55pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/19 "2016-03-04T15:55:42Z")

</div>

I did install the wiringPi package but there seem to be something missing on the Raspian image i tested. Also tested on another Pi without success. But today i tested on another pi and it was working instantly. After reinstalling the first pi with 2016-02-26-raspbian-jessie-lite the make was fine.

`apt-get install wiringpi`

And build the example

```
https://github.com/ernstdevreede/lmic_pi/archive/master.zip
unzip master.zip
cd lmic_pi-master/lmic
make

cd /home/user/lmic_pi-master/examples/thethingsnetwork-send-v1
make
```

---

<div class="post-metadata">

**Author:** ![melvin](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/m/77aa72/32.png) [@melvin](https://www.thethingsnetwork.org/forum/u/melvin)\
**Post date:** [April 29, 2016, 6:39pm UTC](https://www.thethingsnetwork.org/forum/t/node-based-on-raspberry/1003/20 "2016-04-29T18:39:40Z")

</div>

I’m getting spurious interrupts…

`OhOh. Unknown interrupt flags for FSK`

(which I ignore) multiple times. `flags1` and `flags2` are both 0. Is my Pi or RFM95 borked? Does the wiring need special attention?

Otherwise it works great, thanks for the port!

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