mfthomps
Hello,
I'm running OpenPLC on Linux, built in a Docker container using git clone and install.sh
I attach via a Firefox browser (on a different Linux system) and upload the hello world program.  Returning to the dashboard, I start the PLC.  However, the dashboard does not update.  It continues to show the "Status: Stopped", however I can see the core/openplc is running.  And the PLC operates correctly, i.e., controlling my virtual slave.
I've attached the log entries from /var/log/syslog.  
Sometimes reloading the browser will update the status, but usually not.  Often, clicking another list item, e.g., "Monitoring" will update the status, but other times I have to click on "Monitoring" multiple times to get it to select it.  Once selected, the Monitoring window operates fine.

The attached log also includes a error thrown from pymodbus/client/sync.py, which occurs later while trying to stop the PLC.

I'm incorporating OpenPLC into an introductory Labtainers exercise and do not have a lot of options for different browsers.  Thanks for any insight you might offer.
--Mike
Quote 0 0
thiagoralves
It looks like either your network latency is too high or the container you set up is running on a machine with high cpu load. All pages are static, they don’t update automatically (except monitoring table and log textareas). When you click on Start/Stop, a request to update the page is sent, but due to latency or high cpu load on the target, this request is lost and your page isn’t updated
Quote 0 0
thiagoralves
It looks like either your network latency is too high or the container you set up is running on a machine with high cpu load. All pages are static, they don’t update automatically (except monitoring table and log textareas). When you click on Start/Stop, a request to update the page is sent, but due to latency or high cpu load on the target, this request is lost and your page isn’t updated
Quote 0 0
mfthomps
Thank you for the reply.  Neither the latency nor cpu load are high.  Each time the browser fails to get a response from the server  the following appears in the syslog.  This happens sometimes when clicking "stop plc" as well.

Quote:
Aug 21 16:00:49 softplc start_openplc.sh[104]: DNP3 ID manager: Starting thread (0)
Aug 21 16:00:49 softplc start_openplc.sh[104]: channel state change: OPENING
Aug 21 16:00:50 softplc start_openplc.sh[104]: 172.25.0.3 - - [21/Aug/2019 16:00:50] "GET /start_plc HTTP/1.1" 302 -
Aug 21 16:00:50 softplc start_openplc.sh[104]: getSO_ERROR: Bad file descriptor
Aug 21 16:00:50 softplc start_openplc.sh[104]: shutdown: Bad file descriptor
Aug 21 16:00:50 softplc start_openplc.sh[104]: close: Bad file descriptor


I added some diagnostics to webserver.py, and find that the call to start_enip never returns:
elif (row[0] == "Enip_port"):
   if (row[1] != "disabled"):
       if fh is not None:
          fh.write('enable Ethernet\n')
          fh.flush()
     print("Enabling EtherNet/IP on port " + str(int(row[1])))
     openplc_runtime.start_enip(int(row[1]))
    if fh is not None:
        fh.write('return from enable Ethernet\n')
        fh.flush()


On those few occasions when the page updates, the "return from enable Ethernet" diagnostic appears.
Quote 0 0
mfthomps
By disabling loadData in pages.py (just return right away), the pages load and refresh properly when starting and stopping the server.  I cannot claim to understand why loading the log data causes it to fail.  But that hack solves my problem.
Quote 0 0
thiagoralves
If you disable loadData you won't get log updates, or monitoring updates or both, depending on which function you have disabled. What browser are you using?
Quote 0 0
mfthomps
Monitoring updates work fine.  I only put a return in the loadData function, which seems focused on log entries -- which I do not need.
I'm using Firefox on Ubuntu 18.
Quote 0 0
thiagoralves
Try to use Chromium. I have no issues with Chrome and its variants.
Quote 0 0
mfthomps
Chrome behaves exactly like firefox.  Same problem.    Lots of the messages noted below. 


Interactive Server: client ID: 15 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 15...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 15
Issued runtime_logs() command
172.25.0.3 - - [28/Aug/2019 21:23:19] "GET /runtime_logs HTTP/1.1" 200 -
Interactive Server: client ID: 15 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 15...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 15
Interactive Server: client ID: 15 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 15...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 15
Issued runtime_logs() command
172.25.0.3 - - [28/Aug/2019 21:23:20] "GET /runtime_logs HTTP/1.1" 200 -
Interactive Server: client ID: 15 has closed the connection
Quote 0 0
thiagoralves
These messages are normal, it means that the logs are being requested once every second.
Quote 0 0
mfthomps
Is it possible for the log requests to result in termination of the server thread before it returns from start/stop processing.
It looks to me as though the thread is just terminating sometimes before it returns.
Quote 0 0