Problems with interrupts in pi4j

49 views
Skip to first unread message

Rudolf Ziegaus

unread,
Aug 26, 2020, 9:45:10 AM8/26/20
to Pi4J
Hello,

I have problems using interrupts in pi4j. I want to develop a library for a Wiegand Reader and I am almost there, but I experience some problems with pi4j.

I want to read the data from the Wiegand Device in a loop and use interrupts to get the data. The protocol consists of 34 bits (1 parity bit, 32 data bits, 1 parity bit).
When I do the first run in the loop everything is fine, I get all 34 bits and everything is correct.
However later runs tend to fail, sometimes I get only 30 up to 33 bits, sometimes I get all 34 bits. I'd estimate every second or third run has problems.

That problem is present right away from beginning (meaning on the second or third run at latest). However if I stop my etst application and restart it again, it never fails on the first run. So perhaps it is an initialization problem, but I do not know in which direction to go. I attach my source code, perhaps can somebody with expierence in pi4j have a look at it.

My test program runs on a raspberrypi 4. Before the raspberry 4 I tried with a raspberry pi 3B+ but that was too slow. I never had a chance to get the full 34 bits I always got stuck with 26 up to 28 bits.

Hopefully somebody has an idea what to do.






WiegandControllerMain.java
Reply all
Reply to author
Forward
0 new messages