I have done a few fresh installs of Raspbian Bullseye, and consistently see that pymodbus is not available to psm.
Install steps:
1. Raspberry Pi Imager, selecting Raspbian Bullseye Lite x64.
2. sudo apt update, sudo apt full-upgrade, reboot
5. Start openplc service
6. Login at raspberrypi:8080
7. Change hardware to psm
8. Start PLC
Logs:
OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
PSM: Starting PSM...
Traceback (most recent call last):
File "/home/openplc/OpenPLC_v3/webserver/./core/psm/main.py", line 27, in <module>
import psm
File "/home/openplc/OpenPLC_v3/webserver/core/psm/psm.py", line 3, in <module>
from pymodbus.server.sync import ModbusTcpServer
ModuleNotFoundError: No module named 'pymodbus'
PSM: Error while starting Python interpreter
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
Skipping configuration of Slave Devices (mbconfig.cfg file not found)
Warning: Persistent Storage file not found
I had a look within the OpenPLC install script, and it appears that the python dependencies are installed within a venv in the OpenPLC_v3 folder.
`pip freeze` after activating the venv shows pymodbus==2.5.3 is installed.
I had a look within the OpenPLC source code. I don't know c++, but I searched for "python" and found, within psm.cpp the following function.

The image shows the error message I see in the log, and also seems to show the psm.cpp isn't using the python executable from the venv, which is where all the dependencies are installed?
Please correct me, I very much expect to have missed something important somewhere!
Assuming I am wrong about this, please can someone help me fix my problem here?
Edit:
To be clear, I am using the blank_program and the default psm script.
Also, I have just tested on Raspbian 11 x86 and I get the same issue.