AlexNVZ
Hello, after installing OpenPlc Runtime, I chose "Hardware" - Python on Linux (PSM). To work, you need to process Yaml files. Added "import yaml." Received execution error:
OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
PSM: Starting PSM...
Traceback (most recent call last):
File "/usr/local/etc/OpenPLC_v3/webserver/./core/psm/main.py", line 29, in <module>
import yaml
ModuleNotFoundError: No module named 'yaml'
PSM: Error while starting Python interpreter
 
Created a test file to test the operation of built-in ports:
import wiringpi
import time
import sys
import yaml
from wiringpi import GPIO

NUM = 17    #26pin
#NUM = 18   #26pin
#NUM = 20   #for Orange Pi Zero 2
#NUM = 19   #for Orange Pi 4
#NUM = 28   #40pin

wiringpi.wiringPiSetup()

for i in range(0, NUM):
    wiringpi.pinMode(i, GPIO.OUTPUT) ;


while True:
    try:
        for i in range(0, NUM):
            wiringpi.digitalWrite(i, GPIO.HIGH)
        print("Up")
        time.sleep(1)
        for i in range(0, NUM):
            wiringpi.digitalWrite(i, GPIO.LOW)
        print("Down")
        time.sleep(1)
    except KeyboardInterrupt:
        print("\nexit")
        sys.exit(0)
Under "root" the test works without errors.
root@nanopineo:/home# python3 test.py
Up
Down
Up
Down
Up
^C
exit
root@nanopineo:/home#
 
 
There is a suspicion that Openplc Runtim lacks rights.
Not found on "import wiringpi" either.
Reply 0 0
AlexNVZ
There were no errors on early versions of openPlc Runtime, the same code worked.
Reply 0 0
thiagoralves
Reply 0 0
Write a reply...
Reply