ernstdevreede / lmic_pi

Raspberry Pi port LoRaMAC in C / LoRaWAN in C http://www.research.ibm.com/labs/zurich/ics/lrsc/lmic.html
55 stars 29 forks source link

High system load as no blocking calls are used #4

Open wklenk opened 7 years ago

wklenk commented 7 years ago

Hi,

maybe you had your reasons not to "sleep" in the code or to blocking wait for interrupts on DIO0, DIO1 and DIO2, but the current code puts a very high load on the system, as the main loop runs continously.

ernstdevreede commented 7 years ago

Hi Wolfgang,

I noticed that too. I think I ported an Arduino version to the Pi. This had the interrupt waiting loops. I did a few tests with the wiringPi "interrupt" functionality, but it didn't work, so I sticked with the waiting loops. They should only be called every now and then. I noticed the high load, but never noticed any bad effects of that load, the Pi was still usable, so I let it rest.

Ernst

Op 1/25/2017 om 19:57 schreef Wolfgang Klenk:

Hi,

maybe you had your reasons not "sleep" in the code or to blocking wait for interrupts on DIO0, DIO1 and DIO2, but the current code puts a very high load on the system, as the main loop runs continously.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ernstdevreede/lmic_pi/issues/4, or mute the thread https://github.com/notifications/unsubscribe-auth/AI1pMTbLWuYTQMB_VrBN8IuiyY3rcAPgks5rV5sHgaJpZM4Lt3Jc.

wklenk commented 7 years ago

Hi Ernst,

thanks for your porting efforts. I am currently also playing around, but did not manage to join against a LoRa gateway up to now.

From my point of view, the WiringPi interrupt functionality lacks the functionality to wait for a raising edge on all of the 3 DIO pins simultaneously. So I wrote my own stuff, manually „exporting“ the GPIO pins to /sys/class/gpio and did a „poll“ call on all 3 pins.

Okay, but I still have unsolved issues … so stay tuned. I think I will inform you as soon as I have a working HAL implementation :)

Best regards, Wolfgang

Am 25.01.2017 um 23:12 schrieb Ernst de Vreede notifications@github.com:

Hi Wolfgang,

I noticed that too. I think I ported an Arduino version to the Pi. This had the interrupt waiting loops. I did a few tests with the wiringPi "interrupt" functionality, but it didn't work, so I sticked with the waiting loops. They should only be called every now and then. I noticed the high load, but never noticed any bad effects of that load, the Pi was still usable, so I let it rest.

Ernst

Op 1/25/2017 om 19:57 schreef Wolfgang Klenk:

Hi,

maybe you had your reasons not "sleep" in the code or to blocking wait for interrupts on DIO0, DIO1 and DIO2, but the current code puts a very high load on the system, as the main loop runs continously.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ernstdevreede/lmic_pi/issues/4, or mute the thread https://github.com/notifications/unsubscribe-auth/AI1pMTbLWuYTQMB_VrBN8IuiyY3rcAPgks5rV5sHgaJpZM4Lt3Jc.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ernstdevreede/lmic_pi/issues/4#issuecomment-275249293, or mute the thread https://github.com/notifications/unsubscribe-auth/AFxHljDZaV13MjxvfSaPXI49dZtk2l7zks5rV8ixgaJpZM4Lt3Jc.