input status

Moderator: RevPiModIO

Post Reply
pmdevigne
Posts: 5
Joined: 28 Mar 2019, 15:33
Answers: 0

input status

Post by pmdevigne »

Hello

How do I know if an I / O extension module is no longer responding? When I remove the bridge between the CPU and an input / output module, the input values seems frozen with revpimodio2. Is there a status that indicates that an extension module is no longer responding?
zhan
Posts: 52
Joined: 16 Apr 2019, 13:31
Answers: 0

Re: input status

Post by zhan »

There's a global counter of PiBridge i/o errors in the input portion of the RevPi Core's (or Connect's) process image.

Type "piTest -d" to retrieve a list of devices. Look for device 0 and the value specified as "input offset". The error counter has an additional offset of 2, so if the "input offset" is given as 113, the error counter is at 115. You can then retrieve the error counter with "piTest -r 115,1,d". If this returns 255, communication to at least one of the modules has broken down.

In addition you'll get messages like this repeatedly in /var/log/kern.log:

Code: Select all

[ 7091.067477] piControl: too many communication errors -> set inputs to default 0 255 0 0   0 0 0 0
This gives you a clue which of the devices on the PiBridge is no longer reachable. In this is case it's the second device (as listed by "piTest -d").
Simon
pmdevigne
Posts: 5
Joined: 28 Mar 2019, 15:33
Answers: 0

Re: input status

Post by pmdevigne »

Thank you for your reply.
It seems that you can also get this from python using

Code: Select all

print (rpi.core.ioerrorcount)
It gives the information that there is a problem on the piBridge.

But how to find which module is faulty ?
piControl knows it, because it write it in /var/log/kern.log.

And also, why the inputs (DI or analog) retain their values ​​and do not fall back?
zhan
Posts: 52
Joined: 16 Apr 2019, 13:31
Answers: 0

Re: input status

Post by zhan »

thanks for your information and question.

Yes, you are right, the information can be obtained with python or any other programming languages.
Currently the presentation of faulty of specific module is not provided, it is under development, will be provided in future.
Right now, I think you can get them by parsing the log file.

The inputs should be fall back when the pribridge failed.
We are going to confirm it, if it's indeed a problem, we are going to fix it in next version.

Best regards,
Simon
Simon
User avatar
RevPiModIO
KUNBUS
Posts: 322
Joined: 20 Jan 2017, 08:44
Answers: 0
Contact:

Re: input status

Post by RevPiModIO »

Well, I think each IO module has got its own "Status" and "Output_Status" Input. So check the names in piCtory (if you use more than one IO-Module) and get the status with python.

Code: Select all

# For example
rpi = revpimodio2.RevPiModIO(autorefresh=True, direct_output=True)
print(rpi.io.Status.value)
print(rpi.io.Output_Status.value)
You should rename them in piCtory for each IO module...

Did they change, if a module is gone?

Regards, Sven
python3-RevPiModIO - https://revpimodio.org/ || Der RevPi ist das Beste, was passieren konnte!
Post Reply