Connect4 a problem in slicing bytes! for variable x2out and some led colors
Posted: 13 Sep 2024, 11:19
Hello, my name is Ayman,
I'm new to Revolution PI, I managed to get a connect4 with DIO module 28 inputs/outputs. I'm trying to control the 5 Status LEDs on the Revolution PI Connect4, there's maybe a problem in the library revpimodio2 especially device.py file, when I looked on configuration of the class and the class itself, there were function for every LEDs to set a value to it, or get its state, Except for x2in and x2out.
Also, for in creating the objects for the WD, x2in and x2out there also was a problem:
You can see easily that WD is not defined at all, and also for x2out which I think must take the parameter "self._slc_output" instead "self._slc_led" to write the byte of the relay, because I looked the byte of RevPiLED and and RevPiOutput they were different from each other, so that what got me to think that the parameter which is passed to self.x2out objects is not the right one!
I tried also to activate the 'wd' object by using this script from the forum RevPiModIO/RevPiModIO and that was the question in German "Watchdog bei einem Connect 4 mit RevPiModIO toggeln?" and Sven respond with that script :
So, I used it and I got error "AttributeError: 'Connect4' object has no attribute 'wd_toggle'". So, which pretty normal for me, because the object wasn't created in the Connect4 class under the file device.py!!
So, I tried to toggle the relay be typing this command directly to the terminal 'piTest -w 119.0.1' I got message Length must be one of 1|2|4. So, I type again 'piTest -w 119.1.1' and the relay is closed, and 'piTest -w 119.1.0' to open it again.
Also, I figured out that when you use the alternative '.core.A1 = revpimodio2.GREEN' that you proposed on the website 'https://revpimodio.org/en/doc2/core/#connect' the led actually goes red instead of green, and if you type '.core.A1 = revpimodio2.RED' you get green !!
So I hope I get a quick answer and explanation about these problems or maybe I am wrong about something and I don't see where
I'm new to Revolution PI, I managed to get a connect4 with DIO module 28 inputs/outputs. I'm trying to control the 5 Status LEDs on the Revolution PI Connect4, there's maybe a problem in the library revpimodio2 especially device.py file, when I looked on configuration of the class and the class itself, there were function for every LEDs to set a value to it, or get its state, Except for x2in and x2out.
Also, for in creating the objects for the WD, x2in and x2out there also was a problem:
Code: Select all
# IO Objekte für WD und X2 in/out erzeugen
self.x2in = IOBase(
self,
["core.x2in", 0, 1, self._slc_statusbyte.start, exp_x2in, None, "Connect_X2_IN", "6"],
INP,
"little",
False,
)
self.x2out = IOBase(
self,
["core.x2out", 0, 1, self._slc_led.start, exp_x2out, None, "Connect_X2_OUT", "6"],
OUT,
"little",
False,
)
I tried also to activate the 'wd' object by using this script from the forum RevPiModIO/RevPiModIO and that was the question in German "Watchdog bei einem Connect 4 mit RevPiModIO toggeln?" and Sven respond with that script :
Code: Select all
import revpimodio2
rpi = revpimodio2.RevPiModIO(autorefresh=True)
rpi.core.wd_toggle()
rpi.exit()
So, I tried to toggle the relay be typing this command directly to the terminal 'piTest -w 119.0.1' I got message Length must be one of 1|2|4. So, I type again 'piTest -w 119.1.1' and the relay is closed, and 'piTest -w 119.1.0' to open it again.
Also, I figured out that when you use the alternative '.core.A1 = revpimodio2.GREEN' that you proposed on the website 'https://revpimodio.org/en/doc2/core/#connect' the led actually goes red instead of green, and if you type '.core.A1 = revpimodio2.RED' you get green !!
So I hope I get a quick answer and explanation about these problems or maybe I am wrong about something and I don't see where