Some questions

Topics about the Hardware of Revolution Pi
Post Reply
limpopo
Posts: 4
Joined: 19 Oct 2023, 15:54

Some questions

Post by limpopo »

Hello! I have some questions.
1. Is it possible to decrease the RevPiIOCycle value manually?
2. I always get this warning when run the Python script, maybe you have an idea how to fix that.
/usr/lib/python3/dist-packages/revpimodio2/helper.py:622: RuntimeWarning: io refresh time of 20 ms exceeded!
RuntimeWarning
3. On MIO every input shows 10V, however, there is nothing on inputs. What can cause this problem? Otherwise, MIO seems to work correctly.

Thanks in advance.
u.biakoup
Posts: 212
Joined: 14 Apr 2022, 13:04

Re: Some questions

Post by u.biakoup »

Hello Limpopo,
Thank you, for sharing your inquiry here.

1. It is not possible to decrease the RevPiIOCycle value manually.
2. I always get this warning when run the Python script, maybe you have an idea how to fix that.
/usr/lib/python3/dist-packages/revpimodio2/helper.py:622: RuntimeWarning: io refresh time of 20 ms exceeded!
RuntimeWarning
It looks like a resource problem on the RevPi. Of course, when the CPU is busy and the system starts to be unoperable, revpimodio2 can of course no longer maintain the cycle time and these warnings are issued.
We now have to find out what is happening there.
- In the command line, for example, you could use `htop` to display CPU and RAM consumption. Then you can also find the responsible process.
If it is your Python program, I suspect that several times `revpimodio2. RevPiModIO(autorefresh=True)` is called. Only a single RevPiModIO instance may exist, old instances must be terminated cleanly by calling `.exit()`.
For more information about this kind of issue, please look here.
3. On MIO every input shows 10V, however, there is nothing on inputs. What can cause this problem? Otherwise, MIO seems to work correctly.
please have a look at this manual, which could you to troubleshoot the problem .

Best Regards,

Ulrich Kouatang Biakoup | Technical Support
limpopo
Posts: 4
Joined: 19 Oct 2023, 15:54

Re: Some questions

Post by limpopo »

thanks!

2. I have .exit() function. I have this code and still get warnings:

import revpimodio2
import time
rpi = revpimodio2.RevPiModIO(autorefresh=True)

x=0
while (x<2):
sample=rpi.io.AnalogInput_5.value
if (sample>2000):
x=x+1
if (x==1):
time.sleep(5)
print("1st turn")

print("2 turn")
rpi.exit()

3. I have checked MIO manual according to it everything seems fine, however, every input still shows 10V when there is nothing on inputs.
User avatar
nicolaiB
KUNBUS
Posts: 931
Joined: 21 Jun 2018, 10:33
Location: Berlin
Contact:

Re: Some questions

Post by nicolaiB »

You can override the cycletime attribute in revpimodio. See https://revpimodio.org/en/doc2/

Nicolai
Post Reply