Ok so I am trying to communicate with an Omron plc using a raspberry pi running the latest version of raspbian (bullseye in this case). I have been trying to keep it simple, so the only thing else is that I am using Python3 (3.8) and pyModbusTCP.
The trouble I am having is that when I try to communicate through the default Modbus port (502) the client will not connect. When I select a port higher than port 1023, (which port numbers 0 - 1023 apparently seem to be reserved) the client will connect, but then I get an MBAP error which per Modbus.org documentation, relates to a server failure.
Now I have tried utilizing Uncomplicated FireWall using
sudo ufw allow 502 sudo ufw enable sudo reboot
sudo ufw status
to ensure UFW was enabling communication through the port.
I tried starting the python REPL with sudo in hopes of giving it root privileges to use port 502. Additionally I have put the individual pyModbusTCP commands into a python script and gave the file chown root privielges to no avail. I may be entirely off base by thinking it is an issue with the port 502 issue, but at this point I am at an impass. Any help, sugggestions, and or direction to better informational resources would be greatly appreciated TYIA