Best/easiest way to read/write IO with Javascript (RevPi Compact)
Posted: 11 Jun 2021, 07:14
Hello from New Zealand
I just received my first RevPi Compact. I am planning to write my control program in nodejs/javascript. But I have not been able to find an example how to read, write, listen to changes of the IOs with Javascript.
What would you recommend to be the best approach and is there some example code somewhere?
One option I can see is https://github.com/erminas/noderedrevpinodes-server ... although there are no examples how to use it so I will have to go through the code to try work it out.
Another option I can see is to call the shell command from nodejs. That could work for me but I don't know what the variable names are that I am trying to read/write. Where can I find that information? For example, I have tried running , but I'm not having any luck (Cannot find variable 'RevPiLED'). Are these not the correct variable names? https://revolution.kunbus.com/tutorials ... rect=en_US
Thanks for any advice.
Shea
I just received my first RevPi Compact. I am planning to write my control program in nodejs/javascript. But I have not been able to find an example how to read, write, listen to changes of the IOs with Javascript.
What would you recommend to be the best approach and is there some example code somewhere?
One option I can see is https://github.com/erminas/noderedrevpinodes-server ... although there are no examples how to use it so I will have to go through the code to try work it out.
Another option I can see is to call the shell command
Code: Select all
piTest -r
Code: Select all
piTest -r DIn_Status
Code: Select all
piTest -r RevPiLED
Thanks for any advice.
Shea