joan2937 / pigpio

pigpio is a C library for the Raspberry which allows control of the General Purpose Input Outputs (GPIO).
The Unlicense
1.47k stars 410 forks source link

event_callback with 0 bytes #597

Open bflorac opened 10 months ago

bflorac commented 10 months ago

I have a pi running python in slave mode being fed from another pi running python in master mode. Both are using pigiod. I'm sending messages with 1 byte but occasionally, the slave gives me a call back with 0 bytes. Nothing is lost. I've go a scope and logic analyzer on the wires and there are no extra transmissions. This is just a spurious callback that happens right after a valid one. I checked the status value and nothing seems odd. Here is a valid packet followed by an invalid one. Notice the "count" shows the difference in ticks since the last call. The code for the call back does not do anything except print the data below

count 529626 1 transmit busy : false receive FIFO empty : true transmit FIFO full : false receive FIFO full : false transmit FIFO empty: false receive busy : false bytes in tx FIFO : 22 bytes in rx FIFO : 0 bytes copied to tx FIFO: 0 data:aa

count 1375 0 transmit busy : false receive FIFO empty : true transmit FIFO full : false receive FIFO full : false transmit FIFO empty: false receive busy : false bytes in tx FIFO : 22 bytes in rx FIFO : 0 bytes copied to tx FIFO: 0