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

   
Reply 5 0
thiagoralves
This means that you already have something running on port 8080 (ScadaBR maybe?). Try disabling all your services and run again. Preferably, use the installer version as it is prebuilt to work properly on Windows. Also make sure you’re using the right installer for your architecture, which in your case is 64-bit
Reply 0 0
plclearner
Glad to hear the news about OpenPLC Version 3. But an error occurred when I tried to install OpenPLC v3.
Terminal are posted below.
Quote:
asus@asus-pc OpenPLC_v3 (master) $ ./ install.sh linux
Installing OpenPLC on Linux
Ign http://mirrors.163.com trusty InRelease
Hit http://mirrors.163.com trusty Release.gpg
Hit http://mirrors.163.com trusty Release
Hit http://mirrors.163.com trusty/main Sources
Hit http://mirrors.163.com trusty/restricted Sources
Hit http://mirrors.163.com trusty/universe Sources
Hit http://mirrors.163.com trusty/multiverse Sources
Hit http://mirrors.163.com trusty/main amd64 Packages
Hit http://mirrors.163.com trusty/restricted amd64 Packages
Hit http://mirrors.163.com trusty/universe amd64 Packages
Hit http://mirrors.163.com trusty/multiverse amd64 Packages
Hit http://mirrors.163.com trusty/main i386 Packages
Hit http://mirrors.163.com trusty/restricted i386 Packages
Hit http://mirrors.163.com trusty/universe i386 Packages
Hit http://mirrors.163.com trusty/multiverse i386 Packages
Hit http://mirrors.163.com trusty/main Translation-en
Hit http://ppa.launchpad.net trusty InRelease
Hit http://mirrors.163.com trusty/multiverse Translation-en
Hit http://mirrors.163.com trusty/restricted Translation-en
Hit http://mirrors.163.com trusty/universe Translation-en
Ign http://mirrors.163.com trusty/main Translation-en_US
Ign http://mirrors.163.com trusty/multiverse Translation-en_US
Ign http://mirrors.163.com trusty/restricted Translation-en_US
Ign http://mirrors.163.com trusty/universe Translation-en_US
Hit http://ppa.launchpad.net trusty/main amd64 Packages
Hit http://ppa.launchpad.net trusty/main i386 Packages
Hit http://ppa.launchpad.net trusty/main Translation-en
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
autoconf is already the newest version.
automake is already the newest version.
bison is already the newest version.
build-essential is already the newest version.
cmake is already the newest version.
flex is already the newest version.
libtool is already the newest version.
make is already the newest version.
pkg-config is already the newest version.
python-pip is already the newest version.
python2.7 is already the newest version.
python2.7 set to manually installed.
git is already the newest version.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
sqlite3 : Depends: libsqlite3-0 (= 3.8.2-1ubuntu2) but 3.8.2-1ubuntu2.1 is to be installed
E: Unable to correct problems, you have held broken packages.
Requirement already satisfied (use --upgrade to upgrade): flask in /usr/local/lib/python2.7/dist-packages
Cleaning up...
Requirement already satisfied (use --upgrade to upgrade): flask-login in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): Flask in /usr/local/lib/python2.7/dist-packages (from flask-login)
Cleaning up...
Requirement already satisfied (use --upgrade to upgrade): flask in /usr/local/lib/python2.7/dist-packages
Cleaning up...
Requirement already satisfied (use --upgrade to upgrade): flask-login in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): Flask in /usr/local/lib/python2.7/dist-packages (from flask-login)
Cleaning up...

[MATIEC COMPILER]
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/home/asus/OpenPLC_v3/utils/matiec_src/config/missing: Unknown `--is-lightweight' option
Try `/home/asus/OpenPLC_v3/utils/matiec_src/config/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for bison... bison -y
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for ranlib... ranlib
checking for gawk... (cached) mawk
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking float.h usability... yes
checking float.h presence... yes
checking for float.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking for unistd.h... (cached) yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for inline... inline
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for int8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for alarm... yes
checking for working mktime... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for clock_gettime... yes
checking for memset... yes
checking for pow... no
checking for strcasecmp... yes
checking for strdup... yes
checking for strtoul... yes
checking for strtoull... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating absyntax/Makefile
config.status: creating absyntax_utils/Makefile
config.status: creating stage1_2/Makefile
config.status: creating stage3/Makefile
config.status: creating stage4/Makefile
config.status: creating stage4/generate_c/Makefile
config.status: creating stage4/generate_iec/Makefile
config.status: creating config/config.h
config.status: config/config.h is unchanged
config.status: executing depfiles commands
Making all in absyntax
make[1]: Entering directory `/home/asus/OpenPLC_v3/utils/matiec_src/absyntax'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/asus/OpenPLC_v3/utils/matiec_src/absyntax'
Making all in absyntax_utils
make[1]: Entering directory `/home/asus/OpenPLC_v3/utils/matiec_src/absyntax_utils'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/asus/OpenPLC_v3/utils/matiec_src/absyntax_utils'
Making all in stage1_2
make[1]: Entering directory `/home/asus/OpenPLC_v3/utils/matiec_src/stage1_2'
make all-am
make[2]: Entering directory `/home/asus/OpenPLC_v3/utils/matiec_src/stage1_2'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/home/asus/OpenPLC_v3/utils/matiec_src/stage1_2'
make[1]: Leaving directory `/home/asus/OpenPLC_v3/utils/matiec_src/stage1_2'
Making all in stage3
make[1]: Entering directory `/home/asus/OpenPLC_v3/utils/matiec_src/stage3'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/asus/OpenPLC_v3/utils/matiec_src/stage3'
Making all in stage4
make[1]: Entering directory `/home/asus/OpenPLC_v3/utils/matiec_src/stage4'
Making all in generate_c
make[2]: Entering directory `/home/asus/OpenPLC_v3/utils/matiec_src/stage4/generate_c'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/asus/OpenPLC_v3/utils/matiec_src/stage4/generate_c'
Making all in generate_iec
make[2]: Entering directory `/home/asus/OpenPLC_v3/utils/matiec_src/stage4/generate_iec'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/asus/OpenPLC_v3/utils/matiec_src/stage4/generate_iec'
make[2]: Entering directory `/home/asus/OpenPLC_v3/utils/matiec_src/stage4'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/home/asus/OpenPLC_v3/utils/matiec_src/stage4'
make[1]: Leaving directory `/home/asus/OpenPLC_v3/utils/matiec_src/stage4'
make[1]: Entering directory `/home/asus/OpenPLC_v3/utils/matiec_src'
make[1]: Leaving directory `/home/asus/OpenPLC_v3/utils/matiec_src'

[ST OPTIMIZER]

[GLUE GENERATOR]

[OPEN DNP3]
creating swapfile...
dd: failed to open ‘swapfile’: Text file busy
Setting up swapspace version 1, size = 1023996 KiB
no label, UUID=00c128e9-d63c-4ded-9fd3-9426ca17c2c5
swapon: swapfile: swapon failed: Device or resource busy
CMake build is: Release
CMake Error at cmake/inc/posix.cmake:29 (message):
opendnp3 requires g++ 4.9 or greater
Call Stack (most recent call first):
cmake/settings.cmake:4 (include)
CMakeLists.txt:18 (include)


-- Configuring incomplete, errors occurred!
See also "/home/asus/OpenPLC_v3/utils/dnp3_src/CMakeFiles/CMakeOutput.log".
See also "/home/asus/OpenPLC_v3/utils/dnp3_src/CMakeFiles/CMakeError.log".
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target `install'. Stop.
Error installing OpenDNP3
OpenPLC was NOT installed!
asus@asus-pc OpenPLC_v3 (master) $


I am using Ubuntu 14.04 and I have upgrade g++ to 4.9.4.

Quote:
asus@asus-pc OpenPLC_v3 (master) $ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.9.4-2ubuntu1~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.4 (Ubuntu 4.9.4-2ubuntu1~14.04.1)
Reply 0 0
rodrigo_rolle
This means that you already have something running on port 8080 (ScadaBR maybe?). Try disabling all your services and run again. Preferably, use the installer version as it is prebuilt to work properly on Windows. Also make sure you’re using the right installer for your architecture, which in your case is 64-bit


Well, you were right. I still don't know what service was using my 8080, but I could close it and then run the OpenPLC successfully. If someone else has this problem, here's how I solved it using Windows command prompt (cmd) as administrator:

netstat -ano | findstr 8080

Then I got the following string:

TCP       0.0.0.0:8080          0.0.0.0                 LISTENING                 4704

It means that the process whose PID is 4704 was using (listening to) the 8080 port and it needed to be closed. Then I typed:

taskkill /F /pid  4704

and it closed the process that was running on my 8080. After that, I typed the first command again and I got blank response, which means that nothing was using the 8080 port.
After that, OpenPLC worked fine.

Thank you!
Reply 1 0
thiagoralves
plclearner wrote:
Glad to hear the news about OpenPLC Version 3. But an error occurred when I tried to install OpenPLC v3.
Terminal are posted below.

It seems that cmake is not being able to get the version of your GCC correctly. Someone else had this problem also and the solution is at the opendnp3 forum: https://groups.google.com/forum/#!topic/automatak-dnp3/BYOqY-QuKBY

However, from the logs it seems that apt-get failed to install some packages as well. It seems that your system is too old and unsupported. You probably will be able to pass through opendnp3 with the solution above, but there are high chances of OpenPLC not even starting afterwards. Maybe doing an apt-get upgrade before trying to install again could be useful...
Reply 0 0
plclearner

It seems that cmake is not being able to get the version of your GCC correctly. Someone else had this problem also and the solution is at the opendnp3 forum: https://groups.google.com/forum/#!topic/automatak-dnp3/BYOqY-QuKBY

However, from the logs it seems that apt-get failed to install some packages as well. It seems that your system is too old and unsupported. You probably will be able to pass through opendnp3 with the solution above, but there are high chances of OpenPLC not even starting afterwards. Maybe doing an apt-get upgrade before trying to install again could be useful...


Thanks for your quick reply. After commenting out Line 29(file: OpenPLC_v3/utils/dnp3_src/cmake/inc/posix.cmake, use symbol # to comment), I successfully installed OpenPLC v3. 
OpenPLC v3 can also be started and it works fine so far. No error was found.

I will test functions of OpenPLC v3 later on if I have time. 

Thanks for your excellent job. 
Reply 0 0
Stensig
Hi
I'm having some troubles on uploading a new program in the web interface.
First when uploading from pc to the web interface i got an error, which made me think that the program was not being uploaded.
But when I got to the "program" tab it was uploaded anyway.
Now when trying to chose the uploaded program bi clicking on this a new error page shows up saying:

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

It needs to be said that i have mounted a relay board on top of my rpi which uses four fixed pins (7, 15, 31 and 37) for activation of the relays. Therefore I have changed pin numbers in the "hardware.cpp" file so that these pins are outputs. Don't know if it had been better to do theese changes in the "Hardware layre cod box"?

Also the tab "Users" does not work, it returns same error message as above.



The log from the rpi terminal window shows following:

pi@raspberrypi:~ $ cd OpenPLC_v3
pi@raspberrypi:~/OpenPLC_v3 $ sudo ./start_ openplc.sh
* Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)
192.168.1.107 - - [29/Jun/2018 21:02:50] "GET /programs HTTP/1.1" 302 -
192.168.1.107 - - [29/Jun/2018 21:02:50] "GET /login HTTP/1.1" 200 -
192.168.1.107 - - [29/Jun/2018 21:02:58] "POST /login HTTP/1.1" 302 -
192.168.1.107 - - [29/Jun/2018 21:02:58] "GET /dashboard HTTP/1.1" 200 -
192.168.1.107 - - [29/Jun/2018 21:02:59] "GET /runtime_logs HTTP/1.1" 200 -
192.168.1.107 - - [29/Jun/2018 21:03:00] "GET /runtime_logs HTTP/1.1" 200 -
192.168.1.107 - - [29/Jun/2018 21:03:01] "GET /runtime_logs HTTP/1.1" 200 -
192.168.1.107 - - [29/Jun/2018 21:03:02] "GET /runtime_logs HTTP/1.1" 200 -
192.168.1.107 - - [29/Jun/2018 21:03:03] "GET /runtime_logs HTTP/1.1" 200 -
192.168.1.107 - - [29/Jun/2018 21:03:04] "GET /runtime_logs HTTP/1.1" 200 -
192.168.1.107 - - [29/Jun/2018 21:03:05] "GET /runtime_logs HTTP/1.1" 200 -
192.168.1.107 - - [29/Jun/2018 21:03:06] "GET /programs HTTP/1.1" 200 -
[2018-06-29 21:03:08,108] ERROR in app: Exception on /reload-program [GET]
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "webserver.py", line 559, in reload_program
return_str += "<label for='prog_descr'><b>Description</b></label><textarea type='text' rows='10' style='resize:vertical' id='prog_descr' name='program_descr' disabled>" + str(row[2]) + "</textarea>"
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe6' in position 3: ordinal not in range(128)
192.168.1.107 - - [29/Jun/2018 21:03:08] "GET /reload-program?table_id=16 HTTP/1.1" 500 -
[2018-06-29 21:03:58,608] ERROR in app: Exception on /reload-program [GET]
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "webserver.py", line 559, in reload_program
return_str += "<label for='prog_descr'><b>Description</b></label><textarea type='text' rows='10' style='resize:vertical' id='prog_descr' name='program_descr' disabled>" + str(row[2]) + "</textarea>"
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe6' in position 3: ordinal not in range(128)
192.168.1.107 - - [29/Jun/2018 21:03:58] "GET /reload-program?table_id=19 HTTP/1.1" 500 -
[2018-06-29 21:04:00,304] ERROR in app: Exception on /reload-program [GET]
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "webserver.py", line 559, in reload_program
return_str += "<label for='prog_descr'><b>Description</b></label><textarea type='text' rows='10' style='resize:vertical' id='prog_descr' name='program_descr' disabled>" + str(row[2]) + "</textarea>"
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe6' in position 3: ordinal not in range(128)
192.168.1.107 - - [29/Jun/2018 21:04:00] "GET /reload-program?table_id=18 HTTP/1.1" 500 -
[2018-06-29 21:04:01,658] ERROR in app: Exception on /reload-program [GET]
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "webserver.py", line 559, in reload_program
return_str += "<label for='prog_descr'><b>Description</b></label><textarea type='text' rows='10' style='resize:vertical' id='prog_descr' name='program_descr' disabled>" + str(row[2]) + "</textarea>"
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe6' in position 3: ordinal not in range(128)
192.168.1.107 - - [29/Jun/2018 21:04:01] "GET /reload-program?table_id=17 HTTP/1.1" 500 -
[2018-06-29 21:04:03,629] ERROR in app: Exception on /reload-program [GET]
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "webserver.py", line 559, in reload_program
return_str += "<label for='prog_descr'><b>Description</b></label><textarea type='text' rows='10' style='resize:vertical' id='prog_descr' name='program_descr' disabled>" + str(row[2]) + "</textarea>"
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe6' in position 3: ordinal not in range(128)
192.168.1.107 - - [29/Jun/2018 21:04:03] "GET /reload-program?table_id=16 HTTP/1.1" 500 -
192.168.1.107 - - [29/Jun/2018 21:04:21] "GET /programs?list_all=1 HTTP/1.1" 200 -
OpenPLC Runtime starting...
Setting main thread priority to RT
Locking main thread memory
Getting current time
Interactive Server: Listening on port 43628
Interactive Server: waiting for new client...
Openning database
Enabling Modbus on port 502
Interactive Server: Client accepted! Creating thread for the new client ID: 8...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 8
Interactive Server: client ID: 8 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 8...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 8
Issued start_modbus() command to start on port: 502
Enabling DNP3 on port 20000
Interactive Server: Client accepted! Creating thread for the new client ID: 9...
Modbus Server: Listening on port 502
Modbus Server: waiting for new client...
Interactive Server: Thread created for client ID: 9
Interactive Server: client ID: 8 has closed the connection
Terminating interactive server connections
Interactive Server: waiting for new client...
Interactive Server: Client accepted! Creating thread for the new client ID: 8...
Interactive Server: waiting for new client...
Interactive Server: client ID: 9 has closed the connection
Terminating interactive server connections
Interactive Server: Thread created for client ID: 8
Issued start_dnp3() command to start on port: 20000
Interactive Server: client ID: 8 has closed the connection
Terminating interactive server connections
DNP3 ID manager: Starting thread (0)
channel state change: OPENING
DNP3 ID DNP3_Server: Listening on: 0.0.0.0:20000
DNP3 Enabled
192.168.1.107 - - [29/Jun/2018 21:04:34] "GET /start_plc HTTP/1.1" 302 -
Interactive Server: Client accepted! Creating thread for the new client ID: 14...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 14
Interactive Server: client ID: 14 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 12...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 12
Interactive Server: client ID: 12 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 12...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 12
Interactive Server: client ID: 12 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 12...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 12
Interactive Server: client ID: 12 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 14...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 14
Interactive Server: Client accepted! Creating thread for the new client ID: 12...
Interactive Server: client ID: 14 has closed the connection
Terminating interactive server connections
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 12
Interactive Server: client ID: 12 has closed the connection
Terminating interactive server connections
192.168.1.107 - - [29/Jun/2018 21:04:35] "GET /dashboard HTTP/1.1" 200 -
Interactive Server: Client accepted! Creating thread for the new client ID: 12...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 12
Interactive Server: client ID: 12 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 12...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 12
Issued runtime_logs() command
Interactive Server: client ID: 12 has closed the connection
Terminating interactive server connections
192.168.1.107 - - [29/Jun/2018 21:04:35] "GET /runtime_logs HTTP/1.1" 200 -
Interactive Server: Client accepted! Creating thread for the new client ID: 12...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 12
Interactive Server: client ID: 12 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 14...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 14
Issued runtime_logs() command
Interactive Server: client ID: 14 has closed the connection
Terminating interactive server connections
192.168.1.107 - - [29/Jun/2018 21:04:37] "GET /runtime_logs HTTP/1.1" 200 -
Interactive Server: Client accepted! Creating thread for the new client ID: 14...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 14
Interactive Server: client ID: 14 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 14...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 14
Issued runtime_logs() command
Interactive Server: client ID: 14 has closed the connection
Terminating interactive server connections
192.168.1.107 - - [29/Jun/2018 21:04:38] "GET /runtime_logs HTTP/1.1" 200 -
Interactive Server: Client accepted! Creating thread for the new client ID: 12...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 12
Interactive Server: client ID: 12 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 12...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 12
Issued runtime_logs() command
Interactive Server: client ID: 12 has closed the connection
Terminating interactive server connections
192.168.1.107 - - [29/Jun/2018 21:04:40] "GET /runtime_logs HTTP/1.1" 200 -
Interactive Server: Client accepted! Creating thread for the new client ID: 12...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 12
Interactive Server: client ID: 12 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 12...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 12
Issued runtime_logs() command
Interactive Server: client ID: 12 has closed the connection
Terminating interactive server connections
192.168.1.107 - - [29/Jun/2018 21:04:41] "GET /runtime_logs HTTP/1.1" 200 -
Interactive Server: Client accepted! Creating thread for the new client ID: 12...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 12
Interactive Server: client ID: 12 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 14...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 14
Issued runtime_logs() command
Interactive Server: client ID: 14 has closed the connection
Terminating interactive server connections
192.168.1.107 - - [29/Jun/2018 21:04:43] "GET /runtime_logs HTTP/1.1" 200 -
Interactive Server: Client accepted! Creating thread for the new client ID: 14...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 14
Interactive Server: client ID: 14 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 12...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 12
Interactive Server: client ID: 12 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 12...
Interactive Server: waiting for new client...
Interactive Server: Client accepted! Creating thread for the new client ID: 14...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 14
Interactive Server: Thread created for client ID: 14
Interactive Server: client ID: 14 has closed the connection
Terminating interactive server connections
Interactive Server: client ID: 14 has closed the connection
getSO_ERROR: Bad file descriptor
shutdown: Bad file descriptor
close: Bad file descriptor
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
Interactive Server: client ID: 15 has closed the connection
Terminating interactive server connections
192.168.1.107 - - [29/Jun/2018 21:04:44] "GET /runtime_logs HTTP/1.1" 200 -
Interactive Server: Client accepted! Creating thread for the new client ID: 14...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 14
Interactive Server: client ID: 14 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 14...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 14
Issued runtime_logs() command
Interactive Server: client ID: 14 has closed the connection
Terminating interactive server connections
192.168.1.107 - - [29/Jun/2018 21:04:46] "GET /runtime_logs HTTP/1.1" 200 -
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: 14...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 14
Interactive Server: client ID: 14 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
192.168.1.107 - - [29/Jun/2018 21:04:47] "GET /programs HTTP/1.1" 200 -
Interactive Server: Client accepted! Creating thread for the new client ID: 14...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 14
Interactive Server: client ID: 14 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 14...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 14
Interactive Server: client ID: 14 has closed the connection
Terminating interactive server connections
Interactive Server: Client accepted! Creating thread for the new client ID: 14...
Interactive Server: waiting for new client...
Interactive Server: Thread created for client ID: 14
Interactive Server: client ID: 14 has closed the connection
Terminating interactive server connections
[2018-06-29 21:04:50,126] ERROR in app: Exception on /reload-program [GET]
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "webserver.py", line 559, in reload_program
return_str += "<label for='prog_descr'><b>Description</b></label><textarea type='text' rows='10' style='resize:vertical' id='prog_descr' name='program_descr' disabled>" + str(row[2]) + "</textarea>"
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe6' in position 3: ordinal not in range(128)
192.168.1.107 - - [29/Jun/2018 21:04:50] "GET /reload-program?table_id=16 HTTP/1.1" 500 -



Hope that someone can help, thanks.


 
Reply 0 0
thiagoralves
To me it looks like v3 beta is having trouble handling non-english characters. Did you setup you user (and your programs) with characters like ç ñ é ü ... etc? You probably will need a reinstall to fix things up. Remove OpenPLC_v3 folder and clone it again from git. Then run the install.sh script again to install everything and try using only english characters. See if that works. Meanwhile I'll see if I can come with a fix for that soon.

By the way, if you have an error uploading a program, post the error here so I can understand better what is wrong.

Thanks!
Reply 0 0
Stensig

Hi Thiago

Thank you, I had done some commenting in the hardware.cpp file in my ovn language (Danish) which contained "ø").
I changed this letter to "oe" which seemed to solve the errors.

As written above I have mounted a relay board on top of my rpi which uses four fixed RPI pins (7, 15, 31 and 37) for activation of the relays. Therefore I have changed pin numbers in the "hardware.cpp" file so that these pins are outputs.
However It does not work out for me.
In PLCOpen editor I have named the four new outputs with the adresses: %QX1.3, %QX1.4, %QX1.5 and %QX1.6.  

Is this not possible to convert the default inputs to outputs and visa versa?
Don't know if it had been better to do theese changes in the "Hardware layer code box"?

Reply 0 0
Stensig
Attached is my modified hardware.ccp file.

Maybe it is possible to locate the fault in this. 
Reply 0 0
thiagoralves
I've just skimmed through your code and to me it seems to be correct. However, ideally those changes should have been made in the hardware layer code box. That's exacltly the purpose of that code box, to change the original behavior of any driver. If you put your code in there, it will be permanent, even if you change the driver later.

Anyway, a few notes about your changes: If you changed the hardware_layer.cpp file inside the /core folder, you need to recompile your program for the changes to take effect. If you choose another driver, your changes will be gone, even if you switch back to the raspberry pi driver later. If you changed the raspberrypi.cpp file inside the /core/hardware_layers/ folder (preferred) you will need to reapply the raspberry pi driver for the changes to take effect.
Reply 0 0
laughton.andrew
Just installed on a Kubuntu box.  Seems to work OK except that;
Slave devices link to http://0.0.0.0:8080/modbus returns a not found web page.
Monitoring button to link http://0.0.0.0:8080/monitoring returns a not found web page.

I have nothing connected so it is not surprising, just letting you know.
Reply 0 0
thiagoralves

Monitoring and Slave Devices are not available yet. They will be available soon on a next release.
Reply 0 0
Helman Gonzalez
Hi, Thiago, Basically, I am fairly new with OpenPLC, I have an extend experience in Industrial automation. I am fascinated with this software. I am using it with Raspberry. I want to test the software, and I will let you know if here are bug, or improvements to do.
Reply 0 0
Helman Gonzalez
Hi, How Can I see the Arduino driver in OpenPLC?
I am using the new version Open PLC V3. How can I load the Arduino driver  on this version?
Reply 0 0
thiagoralves
Hi Helman, v3 is still a work in progress. The Arduino driver will be available on the slave devices page. For now it is not working yet. I’m hoping that on the next few weeks I’ll be able to finish coding this functionality. You can use arduino with v2. The installation instructions are on git: http://www.github.com/thiagoralves/OpenPLC_v2
Reply 0 0
Reply