pigpio-client icon indicating copy to clipboard operation
pigpio-client copied to clipboard

Timing issues with pigpio-client

Open echo-bravo-yahoo opened this issue 2 years ago • 1 comments

I've written a timing sensitive application (infrared remote emitter); it sends data on a 37KHz (~37 microsecond) carrier wave. My first go at it, I used https://github.com/fivdi/pigpio (hereafter pigpio.js), which wraps the C bindings to pigpio (hereafter pigpio.c). It works very reliably, but has lots of other unpleasant properties (can only be run as root, and doesn't support concurrent runs).

I moved the application over to pigpio-client, and it initially worked. And then stopped working. And then I'd revert back to pigpio.js, and it would work. And, interestingly enough, if I ran the pigpio.js version, then rolled the application forward to the pigpio-client version, it would work until I restarted pigpiod.c or the pi.

This makes me suspect that there's some setting / configuration pigpio.js does that I'm not doing when I start pigpiod.c without any flags.

As for the application code, the strategy is to build an array of waves, and then send them with: await gpio.waveChainTx([{ loop: false }, { waves }, { delay: 0 }, { repeat: 1 }]). My hope here is to offload all the timing sensitive parts to pigpio.c's internal wave management.

Do you have any advice on how I'd go about debugging this?

echo-bravo-yahoo avatar May 27 '22 22:05 echo-bravo-yahoo