using gpio on RevPi Connect + RevPi DIO with Node.js

Topics about the Software of Revolution Pi
Post Reply
Yaroslav
Posts: 2
Joined: 24 Jan 2019, 14:30
Answers: 0

using gpio on RevPi Connect + RevPi DIO with Node.js

Post by Yaroslav »

Hi Kunbus and everyone.

I have to read two input signals and detect which one comes the first. Time between the signals should be not less 10 ms.(like a realtime)
Do you have a solution to read a trigger signal from RevDIO for Node.js ? e.g. pigpio node for RaspberryPi https://www.npmjs.com/package/pigpio

I`am not sure that revpi node ( https://github.com/tmuellerWieland/revpi ) may not miss that signals.
Also another way is to write a C application based on piTest which polls a register and sends a trigger signal to stdout and execute it in another child processes by using one of the next nodes: spawn(), exec(), execFile() or fork().
Is the latest variant a good solution?

Thanks you for advice.
User avatar
dirk
KUNBUS
Posts: 1942
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: using gpio on RevPi Connect + RevPi DIO with Node.js

Post by dirk »

Unfortunately the system is not designed to handle interrupts. Instead the PiBridge or PiControl driver polls the data cyclic. The cycle time is not fixed. It depends on the configuration and the amount of connected modules. You may read out the cycle time in ms as follows.

Code: Select all

pi@RevPi8173:~ $ piTest -r RevPiIOCycle
1 Byte-Value of RevPiIOCycle: 4 dez (=04 hex)
1 Byte-Value of RevPiIOCycle: 3 dez (=03 hex)
Post Reply