elioelkazzi
Hello,

I got a problem with PSM on linux (hardware tab), while starting PLC i got error that connection to PSM failed then its disabled.
The error is: no module named 'pymodbus'. I installed this module several times, using pip, pip3 and manually from git. Even in the terminal when i start python3.7, i can import pymodbus and i can print the version: 2.5.2 so it's already installed.
I rebooted my raspberry pi several times, with uninstalling the module and re-installing it but no results...
PS: My openPLC is installed in raspberry pi 4.

Any advices?

Thank you.
Reply 0 0
NWT.Stuff
@wch705 are you getting this error ?

Traceback (most recent call last):
  File "./core/psm/main.py", line 7, in <module>
    import psm
  File "/home/pi/OpenPLC_v3/webserver/core/psm/psm.py", line 3, in <module>
    from pymodbus.server.sync import ModbusTcpServer
ImportError: No module named 'pymodbus'
Reply 0 0
NWT.Stuff
@thiagoralves is pymodbus installed as part of the OpenPLC Installation ?

 
Reply 0 0
wch705
Yes, I am having the exact error. pymodbus is specified in requirements.txt and is installed successfully

Here is the install_log and I don't see anything suspicious except for the line

`sudo: pip3: command not found`
 
Reply 0 0
wch705
For someone who is also facing the problem(most likely all of the Raspbian users). Here are the missing steps during installation

sudo apt install python3-pip
sudo pip3 install -r /home/pi/OpenPLC_v3/requirements.txt


For some reason, pip3 wasn't installed at all.
https://github.com/thiagoralves/OpenPLC_v3/blob/master/background_installer.sh#L23
and hence this line will fail  https://github.com/thiagoralves/OpenPLC_v3/blob/master/background_installer.sh#L37
Reply 2 0
thiagoralves
Thanks for pointing out the issue. Pip3 was missing from the background installer, I assumed the distro would have it installed already. Perhaps most recent versions of Raspbian removed it, so that's why it stopped working. The script is fixed now, so anyone cloning master from now on should have PSM working out of the box.
Reply 2 0
NWT.Stuff
@thiagoralves I think it does depend on the distro but I have noticed some other Python stuff getting left off some of the raspbian distros so very good that @wch705 found the "root cause"  🙂
Reply 0 0
DJKalian
Thanks for pointing out the issue. Pip3 was missing from the background installer, I assumed the distro would have it installed already. Perhaps most recent versions of Raspbian removed it, so that's why it stopped working. The script is fixed now, so anyone cloning master from now on should have PSM working out of the box.
Thiago, I just wanted to point out, this is still an issue as of today, I have this issue on a RPi 5 install and a Linux install on WIndows/WSL. I was able to solve the issue on Windows/WSL using @wch705 root cause fix, I will try on RPi as soon as I can access my devices at work. Thank and the forum members for all of your hard work.
Reply 0 0
thiagoralves
The installer is significantly different today when compared to 3 years ago. Most likely the issue you’re facing is something else 
Reply 0 0
Reply