CaptainButter
Hello, 
 
I been having issues with running OpenPLC runtime and having the PSM activate correctly:
OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
PSM: Starting PSM...
Traceback (most recent call last):
  File "/home/plc1/OpenPLC_v3/webserver/./core/psm/main.py", line 2, in <module>
    import psm
  File "/home/plc1/OpenPLC_v3/webserver/core/psm/psm.py", line 3, in <module>
    from pymodbus.server.sync import ModbusTcpServer
ModuleNotFoundError: No module named 'pymodbus.server.sync'
PSM: Error while starting Python interpreter
Currently I have verified that the pymodbus module is installed and have uninstalled.  

[203128%2F8898913%2Fmceclip0]

I'm not sure why it cannot find the sync.py file even though it's shown in the site-packages:
[203128%2F8898922%2Fmceclip0]


I had this same issue with a different RPi4, but furthermore I had issues with the new OpenPLC Runtime recently and had to used a previous version. This is a separate issue where uploading a .st file is not consider valid eventhough updating the OpenPLC Editor.

Thanks....
 
thiagoralves
PSM uses your system python, not the venv one. Make sure you have pymodbus==2.5.3 installed in your system python (python3). As for the invalid program on the new runtime, what is the version of your OpenPLC Editor? What does the about screen show?
Reply 0 0
thiagoralves
There has been a discussion here already about PSM using system's or venv's Python. The vote for using system's python was that it would make it easier for the user to install custom libraries that could be called on the PSM code. However, after putting some thought on this, I believe that using system's python is more trouble than good. So I have just pushed a commit that makes PSM use .venv python instead: https://github.com/thiagoralves/OpenPLC_v3/commit/93cd00a838e407a486ef6a8ab18021c82ba505cf
 
Just update your runtime and it should be good to go.
Reply 1 0
CaptainButter
It would state:
Invalid program file format. Please update your OpenPLC Editor and try again Compilation finished with errors!
I have version 20240712
Reply 0 0
CaptainButter
Sorry I was being dumb and forgot to recompile the old .st files and its working
Reply 0 0
thiagoralves
I figured that was the case 🙂
 
On the PSM thing, is it fixed as well?
Reply 0 0
CaptainButter
The PSM is currently working, I just had to find the correct modules and permissions checking.

Thanks for the help!!!
Reply 0 0
Reply