bob_franchez
Is there any reports of the OpenPLC runtime's modbus implementation having a race condition upon startup? I'm finding about 1 in 3 times the modbus sub-system never starts when I hit Start PLC in the Web GUI.  If I just hit Stop PLC and Start PLC again, eventually the Modbus sub-system comes up. Is there anything I should be looking at in the logs to give clues as to why it does not start?

I can confirm it does not start because the WebGUI monitor page shows "Internal Server Error" when I bring it up. A 3rd party Modbus Master will also timeout on TCPIP socket connection attempt.

Background:
* OpenPLC Runtime, v3
* Hardware: Raspberry PI 3B
* OpenPLC registers used: 90 and counting, total will probably be 140

Output log from OpenPLC Runtime when not working (unrelated custom debugging logs removed, all OpenPLC Runtime logs left in order found):
OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
Warning: Persistent Storage file not found
Issued stop_dnp3() command
Issued stop_enip() command
Issued stop_pstorage() command

Output log from OpenPLC Runtime when working:
OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
Warning: Persistent Storage file not found
Issued start_modbus() command to start on port: 502
Server: Listening on port 502
Server: waiting for new client...
Issued stop_dnp3() command
Issued stop_enip() command
Issued stop_pstorage() command
Reply 0 0
thiagoralves
Never seen that happening. Which OS? Raspbian? Try a clean install on a clean Raspbian
Reply 0 0
bob_franchez
It is a clean install, one of the things already confirmed. Though has a fair bit of custom hardware_layer code added thereafter. One section of the custom code parses system information very similar to hardware_layers/neuron.cpp, and another section spawns a background thread to interface with external device very similar to hardware_layers/simulink.cpp.

lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
Reply 0 0
thiagoralves
It seems like your hardware layer is crashing at some point. Activate the blank hardware layer and check if the crash continues to happen
Reply 0 0
Reply