Moderator: miprotek

 
User avatar
miprotek
Posts: 159
Joined: 20 Jan 2017, 08:44
Contact:

Re: communication between RevolutionPi and RaspberryPi using revpimodio

23 Aug 2018, 16:34

GOT IT!

If you use ACL Level 0 in your aclplcslave.conf and connect without monitoing=True THAN the RuntimeWarnings occur (could reproduce it)!

The problem is: the error message :?

If you use RevPiNetIO without monitoring=True, than the module wants write permission for the process image! But the backend (revpipyload) checks the ACL which say 0 (read only) and the connection is disconnected. Now RevPiNetIO should not float RuntimeWarnings, but tells you "write access to the process image is not permitted - use monitoring=True or check aclplcslave.conf on RevPi and reload revpipyload!".

1) I just want to leave autorefresh=True for debugging to prevent float RuntimeWarnings. You should use it now with the monitoring=True and your system will work! Including showing the right value for A1 (If you do not use autorefresh=True, you have to .readprocimg() each time to sync the process image. If you don't, the value of A1 will never change)
import revpimodio2
rpi = revpimodio2.RevPiNetIO("169.254.59.10", autorefresh=True, monitoring=True)

# There should be no RuntimeWarnings now!

2) Leave logiCAD disabled. If you change the ACL value for 169.254.*.*,0 to 169.254.*.*,1 via shell and not RevPiPyControl, you have to reload the configuration on the RevPi!
sudo systemctl reload revpipyload
to activate the new ACL settings. Now this should work without RuntimeWarnings:
import revpimodio2
rpi = revpimodio2.RevPiNetIO("169.254.59.10", autorefresh=True)

rpi.core.A1 = revpimodio2.GREEN
rpi.core.A1 = revpimodio2.RED
rpi.core.A1 = revpimodio2.OFF

# There should be no RuntimeWarnings now!

Please check log file /var/log/revpipyload for errors.


I fixed this problems. It would be very nice if you have some time to test the new version of RevPiModIO 2.2.3 on your RaspberryPi and RevPiPyLoad 0.6.8 on your RevolutionPi :D

You have to download an install the packages via dpkg -i by hand, they are not in the repositories right now!

I hope the problem is solved now!

Regards, Sven
python3-RevPiModIO - https://revpimodio.org/ || Der RevPi ist das Beste, was passieren konnte!
 
User avatar
Frido
Topic Author
Posts: 10
Joined: 21 Apr 2018, 10:47

Re: communication between RevolutionPi and RaspberryPi using revpimodio

27 Aug 2018, 16:00

Hey Sven,

thank you very much! Now everything works as expected, I can read variables from the RevPi even when autorefresh=True.
  • with the old versions RevPiModIO 2.2.2 and RevPiPyLoad 0.6.7:
    In /etc/revpipyload/aclplcslave.conf I have
    169.254.*.*,0
    When I do
    rpi = revpimodio2.RevPiNetIO("169.254.59.10", autorefresh=True, monitoring=True)
    , I have no warnings at all.
  • with the new versions RevPiModIO 2.2.3 and RevPiPyLoad 0.6.8:
    I purged the old versions, installed the new ones and set the correct parameters in /etc/revpipyload/revpipyload.conf and in /etc/revpipyload/aclplcslave.conf.
    It works as expected, too! :)
    When I change /etc/revpipyload/aclplcslave.conf to
    169.254.*.*,1
    , stop my logiCAD program and disable the service logi.RTS via the RevPi-WebPage, I can write as well, e.g. this works perfectly:
    import revpimodio2
    rpi = revpimodio2.RevPiNetIO("169.254.59.10", autorefresh=True)
    
    rpi.core.A1 = revpimodio2.GREEN
    rpi.core.A2 = revpimodio2.RED
    rpi.core.A1 = revpimodio2.OFF
    
Thank you so much! Now I can start programming the graphical interface on my RasPi with which I want to show some state variables of my control program on the RevPi. Perfect!

Best,
Frido

Who is online

Users browsing this forum: No registered users and 1 guest