Getting Started with RevPi RO

Rund um die Software von Revolution Pi
Post Reply
yoann.v
Posts: 1
Joined: 17 Apr 2024, 12:00

Getting Started with RevPi RO

Post by yoann.v »

Hi all,

I put this here as it can help others, I dealt with support by mail, but I open a thread here for the community.
here is my original post :

I've recently purchased a revPi Connect 4 and a revPi RO. I am new to the revPi world, but I've managed to play around the revPi connect, its LEDs, and the code I need to run is done, so far so good.
I couldn't find much documentation or support on the RevPi RO though, other than https://revolutionpi.com/en/tutorials/revpi-ro. And no luck on the Forum, it looks like the product is pretty new on the market.

Anyhow, I believe I have configured the Pictory :
Screenshot from 2024-04-16 16-14-47.png
I did the Save as (and created a project with name) + reset driver + reboot
I also did the checklist: cleared everything + started afresh + Save as Start-config. + reset driver + reboot.

However I get this:
Screenshot from 2024-04-16 16-26-24.png
I can play with the RelayOutput_1 variable, but nothing happens physically, the relay doesn't switch, the revPi RO's leds don't change, and I have no connectivity changes on the output of the NO relay
All I can say is that the Module is connected somehow, and the variables are available, but I can't seem to be able to manage them really.
Also do you have a Python API for the RO module? I'm not so sure how to use the f.seek(offset) for the relay, all the Relay output have the same offset

What I believe and tested is :
f=open("/dev/piControl0","wb+",0)
f.seek(14)
f.write(b'1') #set value of RelayOutput_1 to 1

I tested:
f.write(b'0') opens all RelayOutput
f.write(b'1') closes RelayOutput_1
f.write(b'2') closes RelayOutput_2
f.write(b'3') closes RelayOutput_1 and RelayOutput_2
f.write(b'4') closes RelayOutput_3
f.write(b'5') closes RelayOutput_1 and RelayOutput_3
f.write(b'6') closes RelayOutput_2 and RelayOutput_3
f.write(b'7') closes RelayOutput_1 and RelayOutput_2 and RelayOutput_3
f.write(b'8') closes RelayOutput_4

How can I close all 4 together?


Note: both modules are powered in 24V on their X4 connector, and both have the Power Led green.

Please advise.




To which Dirk (from the tutorial videos ^^) answered :

Are you already familiar with the useful RevPiModIO library?
Revolution Pi Python Introduction
RevPiModIO FAQ


>I had seen the lib on the website, but figured it was for the Analog and digital IO modules, not for the RO! Good to know, thanks!

Is the hardware configuration equal to the PiCtory Configuration? I mean in PiCtory I can see that the RO Module is right of the RevPi Core 4 module. Maybe you have to switch?
Update your system via “sudo apt update; sudo apt upgrade” and “sudo reboot”. Then take a look if the message disappears.


> I did just that : update and upgrade, I was sure I had done it, I guess not. THIS SOLVE THE ISSUE, the RO module is now recognised and the relays are now switching (I didn't need to redo the Pictory config), Thanks.

The output of "piTest -d" shows that there is an "unknown module" error. There is some need to fix that first. I think, that is a consequential error.


and regarding the question on how to set the relay all at the same time rather than one by one, Dirk's answer was :
Well, there are several options to perform this
  • In RevPiModIO with the method: “.writeprocimg()" together with “autorefresh=False” so that this works.

https://revpimodio.org/en/doc2/

  • You can switch a rare known feature in PiCtory to that you access the relais instead with different bool vairables at onces via a 1 byte variable, see here.
unnamed.png
  • Don’t forget to “save as default configuration” and “reset driver” afterward
  • Then you can just switch all relays on together by writing the value 15 to RelayOutputs which equals 0b00001111 or 0x0F, i.e.

piTest -w RelayOutputs=15
User avatar
nicolaiB
KUNBUS
Posts: 897
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: Getting Started with RevPi RO

Post by nicolaiB »

Hi

Thanks for the detailed description. From the output of piTest I assume that your device is missing the latest updates which are required to use the RevPi RO. Please install the updates and check again.

Nicolai
Post Reply