jonas-hab
Posts: 1
Joined: Thu Oct 04, 2018 8:17 am

RadioHead LoRa library freezing the Raspberry

Thu Oct 04, 2018 8:25 am

Hi,

I'm trying to send data from one raspberry pi 3B+ to an other with two RFM95W LoRa boards.
I installed the RadioHead for raspberry library (https://github.com/hallard/RadioHead), compiled it and executed it.
Sadly it doesn't work like presented in the Readme file.
The client and the server version are using 100% of the CPU and making the raspberry freeze. I can't even stop the program with Ctrl+C so I must power off the raspberrys.

I've enabled SPI and did not modifyied his code. I've tested it on a Raspberry 2 and with previous versions of the library but it did the same.

Can someone help me ?

Thanks

MortenBraskJensen
Posts: 1
Joined: Thu Nov 22, 2018 10:19 pm

Re: RadioHead LoRa library freezing the Raspberry

Thu Nov 22, 2018 10:24 pm

Currently having the exact same issue. I am able to transmit a single packet with the rf95_client example and then the pi freezes completely, forcing me to do a hard shutdown. I have RPi 3B.
Cant figure out what the issue is, so as the first poster, any advice or help is appreciated

mdhahne
Posts: 1
Joined: Wed Feb 13, 2019 5:52 pm

Re: RadioHead LoRa library freezing the Raspberry

Wed Feb 13, 2019 5:59 pm

I arrived here doing research on the RadioHead library while considering using it in a non-raspy project. BUT, I did notice on the central documentation page for RadioHead (http://www.airspayce.com/mikem/arduino/RadioHead/) that it appears the radios you're using aren't compatible with the Pi?

In the "Platforms" section, it states that the Raspberry Pi is only compatible with the RH_NRF24 driver. Then scrolling back up to "Drivers" we see...

"RH_NRF24 Works with Nordic nRF24 based 2.4GHz radio modules, such as nRF24L01 and others. Also works with Hope-RF RFM73 and compatible devices (such as BK2423). nRF24L01 and RFM73 can interoperate with each other."

No mention of your RFM95W boards.

This is based on a very cursory look, so I'd certainly recommend doing some digging through the RadioHead docs yourself before making any decisions, but hopefully this gives you somewhere to look!

rolgordijn
Posts: 8
Joined: Sun Mar 26, 2017 2:06 pm

Re: RadioHead LoRa library freezing the Raspberry

Fri Apr 12, 2019 12:14 pm

Is there already a solution for this problem? I have the same issue...

User avatar
bensimmo
Posts: 4154
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: RadioHead LoRa library freezing the Raspberry

Fri Apr 12, 2019 3:08 pm

Try the CircuitPython modules from Adafruit, they are tweaked version and work for me.
Though I can't get the TTN/LoraWAN to talk to each other, plain LoRa is fine.

geosvy
Posts: 1
Joined: Mon Apr 22, 2019 7:39 pm

Re: RadioHead LoRa library freezing the Raspberry

Mon Apr 22, 2019 7:54 pm

If you are using bcm2835_gpio_ren() to detect interrupts your system will hang.

Use bcm2835_gpio_lev() instead.

TFO

omiter129
Posts: 2
Joined: Thu Jul 11, 2019 11:58 am

Re: RadioHead LoRa library freezing the Raspberry

Thu Jul 11, 2019 12:13 pm

Hi all, total noob here!

Have the same problem with the RadioHead bib and, as op, only tried using the example code for RPi. I myself am using a Raspberry Pi 3B with a Dragino LoRa/GPS hat (v1.4 and just mounted onto the RPi) and I tried using the rf95 examples.

Tried changing the code as mentioned by geosvy, i.e. changing from bcm2835-gpio-ren() to bcm2835-gpio-lev(). The example code executed as ./rf95_client then worked without problems. However, the ./rf95_server code did not work. It does not crash the RPi anymore but now no messages can be received. So the bcm2835-gpio-ren() is needed when using the server example I guess?

I tried changing the time given for the os to run other tasks which gave some results. Now the ./rf95_server code only crashes sometimes.

Its a quick fix but works quite well as a temporary solution :P

omiter129
Posts: 2
Joined: Thu Jul 11, 2019 11:58 am

Re: RadioHead LoRa library freezing the Raspberry

Tue Jul 16, 2019 9:16 am

Got it to not freeze my RPi 3 B.

I simply added

bcm2835_gpio_clr_ren(RF_IRQ_PIN);

at the bottom of the rf95_server code (right above bcm2835_close();). I also uncommented the commented lines in

/etc/dphys-swapfile

This together with the other changes previously stated in my last message got the rf95_server to work without problems. I will try this with a RPi 3 B+ also. I hope this helps someone out there which sumbles onto the same problem as I did.

Cheers!

hojo
Posts: 11
Joined: Mon Apr 18, 2016 3:54 pm

Re: RadioHead LoRa library freezing the Raspberry

Thu Jul 18, 2019 5:17 pm

I just fixed the rf95_client.cpp to use the _lev instead of _ren and it worked.
geosvy wrote: If you are using bcm2835_gpio_ren() to detect interrupts your system will hang.

Use bcm2835_gpio_lev() instead.
Is there any reference to this that we could see to know why _ren fails? I presume, at some point in time, it didn't fail.

Return to “Networking and servers”