jksc
Hello,
I am making a project with Raspberry pi B+, where I am trying to control Ws2812b LED strip. For that reason, i decided to use PSM for linux driver and i wrote the code to turn the LED strip on and off there. The problem is, when i click start PLC sometimes PSM doesn't want to start and i get a PSM error. But other times when i click start PLC, the PSM starts but then the modbus and DNP3 servers don't start and i can't see data in ScadaBR. Only when I'm lucky all the services start correctly. I am wondering if this could be an error in installation or if somebody saw something similar with their projects.

Runtime logs when PSM starts:
OpenPLC Runtime starting...
PSM: Killing previous PSM modules...
Interactive Server: Listening on port 43628
PSM: Starting PSM...
PSM: Connected to PSM
Warning: Persistent Storage file not found


Runtime logs when PSM doesn't start:
OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
PSM: Starting PSM...
Issued start_modbus() command to start on port: 502
Server: Listening on port 502
Server: waiting for new client...
Issued start_dnp3() command to start on port: 20000
DNP3 ID manager: Starting thread (0)
DNP3 ID DNP3_Server: Listening on: 0.0.0.0:20000
Issued start_enip() command to start on port: 44818
Server: Listening on port 44818
Server: waiting for new client...
Issued stop_pstorage() command
PSM: Connection to psm failed
PSM: Error connecting to psm!
PSM: PSM is disabled
Warning: Persistent Storage file not found




Thanks.



UPDATE:
I have been doing some debbuging and if i run openplc from /core directory i get the following output:
OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
Interactive Server: waiting for new client...
PSM: Starting PSM...
python3: can't open file './core/psm/main.py': [Errno 2] No such file or directory
PSM: Error while starting Python interpreter
PSM: Connection to psm failed
PSM: Error connecting to psm!
PSM: PSM is disabled
Skipping configuration of Slave Devices (mbconfig.cfg file not found)
Warning: Persistent Storage file not found
Setting main thread priority to RT
Locking main thread memory
Getting current time


Looks like python3 can't open the file './core/psm/main.py'. But the file is there and i don't know how this could happen.
Reply 0 0
thiagoralves
You shouldn't run the binary directly from core, because then it will try to open ./core/psm/ main.py with cwd (current working directory) as core, which does not exist. OpenPLC expects the cwd to be webserver, which then makes sense to open ./core/psm/ main.py (full path would be /webserver/core/psm/main.py).

Anyway, it is very likely that your problem lies on your PSM code. If you write code that hangs in any way, PSM will have trouble loading and then you will face issues like that.
Reply 0 0
Reply