Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4696

C/C++ • Using pigpiod with multiple threads

$
0
0
Hello,

I have a multiple thread application running on the RaspberryPi CM4 communicating with a DWM3000 module over SPI. I have one thread periodically reading data from DWM into a buffer and setting a flag once data is available. The main thread checks the flag and starts processing the stored data. I am currently using the pigpio library for controlling the GPIOs and it is working fine.

However, I am now trying to switch to using the pigpio daemon so that I don't need to use sudo anymore for starting the application. I replaced all function calls from pigpio.h with calls from pigpio_if2.h, but the reading thread is not getting data anymore. If I try to read from the main thread without creating a separate thread then the reading works again.

I am starting the threads using the start_thread() / stop_thread() functions. Do I need to call the pigpio_start() function in the new thread as well? Or do I miss something on how the daemon should be used?

Thank you!

Statistics: Posted by nano2 — Mon Apr 22, 2024 9:01 am — Replies 0 — Views 8



Viewing all articles
Browse latest Browse all 4696

Trending Articles