Page 1 of 1

input status

Posted: 28 Mar 2019, 15:49
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?

Re: input status

Posted: 22 May 2019, 16:10
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").

Re: input status

Posted: 27 May 2019, 16:51
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?

Re: input status

Posted: 03 Jun 2019, 11:25
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

Re: input status

Posted: 02 Sep 2019, 21:32
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