plcnut
Here is the result of clicking the upload button from Firefox on my PC when uploading the Hello_World project downloaded from the OpenPLC website:

pi@raspberrypi:~/OpenPLC_v2 $ sudo nodejs server.js
Working on port 8080
Stopping OpenPLC Software...
Starting OpenPLC Software...
HelloWorld.st is starting ...
HelloWorld.st uploaded to  st_files/HelloWorld.st
finishing old program...
compiling new program...
POUS.c
POUS.h
LOCATED_VARIABLES.h
VARIABLES.csv
Config0.c
Config0.h
Res0.c
 
Program compiled successfully
moving files...
compiling OpenPLC...
stdout: Generating object files...
Generating glueVars.cpp
varName: __IX0_0        varType: BOOL
varName: __QX0_0        varType: BOOL
Compiling main program
 
stderr:
compiled without errors
Starting OpenPLC Software...


The browser window just sticks on the uploadStatus page.
If I open a new tab and navigate to the Home page, then the OpenPLC 'seems' to be working normally (I do not have any physical IO connected right now to use for testing).
Our circumstances don't determine who we are, they only reveal it.
Quote 0 0
thiagoralves
Oh, thats the correct behaviour. The project compiled fine and apparently started executing. The browser should display the compilation results and then when it's finished the title right under OpenPLC server should change to "Program compiled successfully". You can try using a modbus software to poll the OpenPLC IO to know if it's working properly. Did you use the RaspberryPi driver when you installed the OpenPLC?
Quote 0 0
thiagoralves
I just found an issue with the OpenPLC on raspberry pi related to the libmodbus shared library. It can prevent the OpenPLC from running correctly. I updated the code on github to fix the issue, however, you don't need to download the new code. Just type:

sudo ldconfig

on your terminal to update the shared library cache and you'll be good to go. Then try running OpenPLC again.
Quote 0 0
plcnut
I will try again when I get a chance tomorrow. Thanks!
Our circumstances don't determine who we are, they only reveal it.
Quote 0 0
plcnut
I did some more testing, and found a minor problem in the server.js code.
In the compileOpenPLC() function, right after the
compilationSuccess = true;
. there needs to be a
compilationEnded = true; 

This is what tells the page that the compiler is actually done.
I also added
compilationOutput += '\r\n<button type="button" onclick="location.href=\'/\';">Home</button>';

So that I have a direct link back to the Home page when the compile is done.

Very cool project!
Thank you for all your work on it!
Our circumstances don't determine who we are, they only reveal it.
Quote 0 0
plcnut
OK. I found that you had already made the correction on git.
I ran the following code from inside my OpenPLC_v2 directory in order to get the update:

git fetch origin
git reset --hard origin/master
Our circumstances don't determine who we are, they only reveal it.
Quote 0 0
thiagoralves
plcnut wrote:
OK. I found that you had already made the correction on git.


I found out that there was a problem when you told me that the program never stopped uploading. I have done it correctly on the windows version of the server (server_win.js), but when I copied and paste the code for the new server on the linux version I forgot to update the compilationEnded variable.

Let me know if you find any other bug.


Thanks!
Quote 0 0