thiagoralves
Hi all,

I'm happy to announce that OpenPLC v3 beta 1 was released today! This first release is almost a complete rework on OpenPLC runtime code, and brings nice features like:

   Dashboard - View information about your current program in real time
   Programs list - All programs uploaded to the runtime are available on a list and are reloaded with just a click
   Hardware config - Change the current driver without having to reinstall OpenPLC
   Custom driver - Write code that will enhance your current hardware layer driver, ex: read digital temperature sensor, proximity sensor, etc
   User management - Setup users to access the graphical interface
   SCADA Settings - Start, stop and configure the SCADA protocols (Modbus and DNP3)

Monitoring and Slave Devices are not available yet. They will be available soon on a next release.


To install:

git clone https://github.com/thiagoralves/OpenPLC_v3.git
cd OpenPLC_v3
./install.sh [platform]

where [platform] can be win, linux or rpi.

Please test this beta version on your devices, and let me know of any bugs or issues.


Have fun!

Thiago Alves

   
Quote 1 0
thiagoralves
Oh, I forgot to tell you how to start it. After installing OpenPLC v3, just launch the start script

./start_openplc.sh


The web interface will be available at localhost:8080 as always. The default username : password is openplc : openplc
Quote 0 0
thiagoralves
One more thing. If you're on Windows 7 32-bit and while installing OpenPLC you got errors such as: "address space needed by [some .dll file here] is already occupied", this is a problem related to the fork() implementation of Cygwin. This error will prevent OpenPLC to get started, with an error saying that flask module could not be loaded. To fix this, open cygwin terminal and type:

rebase-trigger fullrebase

Then close Cygwin and run Cygwin Setup again (setup-x86.exe). This will launch Cygwin installation. Just click on next, next, next... until it finishes. Since Cygwin is already installed, all it is going to do is rebase at the end. Once the setup is finished, open Cygwin terminal and type:

pip install flask
pip install flask-login

This should fix the errors and will allow OpenPLC to run. You don't have to install OpenPLC again if you have already installed it.
Quote 0 0
jean-jean
Yahoo! 
I was waiting for it since our last conversation! 
Thank you very much! 
(perhaps an article on hackaday soon!) 
Quote 0 0
jean-jean
Hi Thiago!
The web interface look great!

I have a first issue, the Modbus Server seems to not start whereas it is enable on the settings.
Do you have any idea?

OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
Issued start_modbus() command to start on port: 502
Modbus Server: error binding socket => Permission denied
Modbus Server: waiting for new client...
Issued start_dnp3() command to start on port: 20000
DNP3 ID manager: Starting thread (0)
DNP3 ID DNP3_Server: Listening on: 0.0.0.0:20000

I'm on a Rspi Zero and event if the web server tells me that it is listening on 0.0.0.0:8080, I still can access on my lan.
Quote 0 0
thiagoralves
You’re getting a permission denied because Linux won’t allow you to use lower ports (like 502 in case of Modbus) unless you’re a super user. Start OpenPLC with sudo and it will work.

sudo ./start_openplc.sh

About the 0.0.0.0 that’s correct. It means that the server is accepting connections from any interface. If it wasn’t 0.0.0.0 you probably wouldn’t be able to access it from your lan
Quote 0 0
jean-jean
Ok, great, thanks a lot.
I'm a newbie with linux and rasp.
I bought this to improve my skill, I hope it'll works:
https://www.kickstarter.com/projects/elecrow/crowpi-lead-you-go-from-zero-to-hero-with-raspberr/posts/2213537?ref=backer_project_update

Maybe you could do a kickstarter for your platform.
For your information, another one will be interesting for plc when the driver will be ready:
https://www.kickstarter.com/projects/mbeffa/stackable-8-relay-card-for-raspberry-pi-2-3-zero?ref=email
Quote 0 0
jean-jean
Strangely it doesn't start with sudo:

pi@Serveur3:~/OpenPLC_v3 $ ./start_ openplc.sh
* Serving Flask app "webserver" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)

^Cpi@Serveur3:~/OpenPLC_v3 $ sudo ./start_ openplc.sh
Traceback (most recent call last):
File "webserver.py", line 11, in <module>
import flask
ImportError: No module named flask
pi@Serveur3:~/OpenPLC_v3 $
Quote 0 0
thiagoralves
Wow, you were one of the first ones to download this right?! A few hours after I pushed the code to GitHub I found this flaw that it wasn’t starting as sudo. I came up with the fix and pushed it back to GitHub. You probably have the very first version before the fix. But don’t worry, this is a two-liner fix. Just type:

sudo pip install flask
sudo pip install flask-login
Quote 0 0
jean-jean
I'm glad to be one of the firsts, but I still have the issue, even with sudo:

OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
Issued start_modbus() command to start on port: 502
Modbus Server: Listening on port 502
Modbus Server: waiting for new client...
Issued stop_dnp3() command

Do you think I should reinstall everything?
Quote 0 0
thiagoralves
Well, from the logs it seems that it is working. It says that it is listening on port 502. Aren't you being able to connect? Could it be a firewall, maybe? Also, it wouldn't hurt to reinstall if you want to. At least you will be sure you're getting the right codebase. What software are you using to connect to OpenPLC via Modbus?
Quote 0 0
jean-jean
Unfortunately, I'm not able to connect through ScadaBR, whereas I'm able to connect with OpenPLC-V2 that is on an other folder of the Rpi.

I'll reinstall Monday. I just have to delete the v3 folder and start again?

Thanks.
Quote 0 0
jean-jean
I've just reboot everything and now it seems to be working!

Great! Thank you again for all your work and support.

Did you receive my tip?
Quote 0 0
thiagoralves
jean-jean wrote:
Did you receive my tip?

I did! Thank you jean-jean!!

I'm glad it worked. I was going to ask you to try to use a different port, like 5020 or something else, and then configure the same port on ScadaBR to see if it works. Sometimes ScadaBR can be a little annoying when devices connect and disconnect too often.
Quote 0 0
schlumpf
Is it already possible to use ModbusTCP slave devices with Beta1?
Quote 0 0