plc_ingenieur_ger
I wrote a simple program and tried to upload it on my raspberry pi 4. I can access the raspberry via webserver and upload the program. But after uploading it, i press "Start PLC". It just refreshes and the state is still "Status: Stopped".
What can be the problem?
 
My Program is following:
IF PB1 THEN
    LED := TRUE;  (* Wenn PB1 TRUE ist, setze LED auf TRUE *)
ELSE
    LED := FALSE; (* Andernfalls setze LED auf FALSE *)
END_IF;
 
I declared the variables PB1 and LED as Bool and the Adress for PB1 is %IX0.0 and for LED %QX0.0.
Reply 0 0
thiagoralves
Something is preventing the runtime from starting. Does it run if you switch the hardware layer to Blank Linux? If it does, I suspect the problem might be with WiringPi. Make sure you have WiringPi installed and working
Reply 0 0
plc_ingenieur_ger
When i change to blank and then Start PLC, i get this message:

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.

 

I tried to install wirepi, but it is already installed.

 

sudo apt install wiringpi
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
wiringpi is already the newest version (2.61).
The following package was automatically installed and is no longer required:
libraspberrypi0
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Reply 0 0
plc_ingenieur_ger
I don't get any messages in the log window, neither.
Reply 0 0
dnalor
Hi Guys
I experience quite the same problem. I'm using a new Pi4 with Debian GNU/Linux 12 (bookworm) 64bit.
On the fresh installed OS I installed OpenPLC as documented. The installation run smoothly and returned "Successfully Installed!" message.
Afterwards I pushed the demo Program as explained in the OpenPLC introduction Youtube video.
As soon as I change the HW type to "Raspberry Pi" in the OpenPLC runtime settings the PLC can't be started.
Meanwhile I spent quite some time reading forums and so on but no success so far.
Any help is appreciated. Please find below some of the status and error messages I receive.
Thanks 
 
admin@pi4plc:~ $ sudo systemctl status openplc
● openplc.service - OpenPLC Service
Loaded: loaded (/lib/systemd/system/openplc.service; enabled; preset: enabled)
Active: active (running) since Thu 2023-12-28 19:27:55 CET; 19h ago
Main PID: 10241 (start_openplc.s)
Tasks: 3 (limit: 8734)
CPU: 1min 39.744s
CGroup: /system.slice/openplc.service
├─10241 /bin/bash /home/admin/OpenPLC_v3/ start_openplc.sh
└─10248 /home/admin/OpenPLC_v3/.venv/bin/python3 webserver.py
Dec 29 15:09:47 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:09:47] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:09:48 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:09:48] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:09:49 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:09:49] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:09:50 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:09:50] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:09:51 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:09:51] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:09:52 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:09:52] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:09:53 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:09:53] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:09:54 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:09:54] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:09:55 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:09:55] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:09:56 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:09:56] "GET /runtime_logs HTTP/1.1" 200 -
 
admin@pi4plc:~ $ sudo journalctl -f
Dec 29 15:12:08 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:12:08] "GET /static/programs-icon-64x64.png HTTP/1.1" 304 -
Dec 29 15:12:08 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:12:08] "GET /static/modbus-icon-512x512.png HTTP/1.1" 304 -
Dec 29 15:12:08 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:12:08] "GET /static/monitoring-icon-64x64.png HTTP/1.1" 304 -
Dec 29 15:12:08 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:12:08] "GET /static/hardware-icon-980x974.png HTTP/1.1" 304 -
Dec 29 15:12:08 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:12:08] "GET /static/users-icon-64x64.png HTTP/1.1" 304 -
Dec 29 15:12:08 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:12:08] "GET /static/arrow.png HTTP/1.1" 304 -
Dec 29 15:12:08 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:12:08] "GET /static/settings-icon-64x64.png HTTP/1.1" 304 -
Dec 29 15:12:08 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:12:08] "GET /static/logout-icon-64x64.png HTTP/1.1" 304 -
Dec 29 15:13:12 pi4plc sudo[17876]: admin : TTY=pts/0 ; PWD=/home/admin ; USER=root ; COMMAND=/usr/bin/journalctl -f
Dec 29 15:13:12 pi4plc sudo[17876]: pam_unix(sudo:session): session opened for user root(uid=0) by admin(uid=1000)
Dec 29 15:13:20 pi4plc start_openplc.sh[17881]: Oops: Unable to determine board revision from /proc/cpuinfo
Dec 29 15:13:20 pi4plc start_openplc.sh[17881]: -> No "Hardware" line
Dec 29 15:13:20 pi4plc start_openplc.sh[17881]: -> You'd best google the error to find out why.
Dec 29 15:13:20 pi4plc start_openplc.sh[17881]: OpenPLC Runtime starting...
Dec 29 15:13:20 pi4plc start_openplc.sh[17881]: Interactive Server: Listening on port 43628
Dec 29 15:13:20 pi4plc start_openplc.sh[17881]: Interactive Server: waiting for new client...
Dec 29 15:13:21 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:21] "GET /start_plc HTTP/1.1" 302 -
Dec 29 15:13:21 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:21] "GET /dashboard HTTP/1.1" 200 -
Dec 29 15:13:21 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:21] "GET /static/logo-openplc.png HTTP/1.1" 304 -
Dec 29 15:13:21 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:21] "GET /static/arrow.png HTTP/1.1" 304 -
Dec 29 15:13:21 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:21] "GET /static/default-user.png HTTP/1.1" 304 -
Dec 29 15:13:21 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:21] "GET /static/programs-icon-64x64.png HTTP/1.1" 304 -
Dec 29 15:13:21 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:21] "GET /static/home-icon-64x64.png HTTP/1.1" 304 -
Dec 29 15:13:21 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:21] "GET /static/modbus-icon-512x512.png HTTP/1.1" 304 -
Dec 29 15:13:21 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:21] "GET /static/logout-icon-64x64.png HTTP/1.1" 304 -
Dec 29 15:13:21 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:21] "GET /static/monitoring-icon-64x64.png HTTP/1.1" 304 -
Dec 29 15:13:21 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:21] "GET /static/users-icon-64x64.png HTTP/1.1" 304 -
Dec 29 15:13:21 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:21] "GET /static/hardware-icon-980x974.png HTTP/1.1" 304 -
Dec 29 15:13:21 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:21] "GET /static/settings-icon-64x64.png HTTP/1.1" 304 -
Dec 29 15:13:21 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:21] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:13:22 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:22] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:13:23 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:23] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:13:24 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:24] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:13:25 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:25] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:13:26 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:26] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:13:27 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:27] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:13:28 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:28] "GET /runtime_logs HTTP/1.1" 200 -
Dec 29 15:13:30 pi4plc start_openplc.sh[10248]: 172.16.2.8 - - [29/Dec/2023 15:13:30] "GET /runtime_logs HTTP/1.1" 200 -
^C
 
admin@pi4plc:~ $ gpio -v
gpio version: 2.61
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty
Oops: Unable to determine board revision from /proc/cpuinfo
-> No "Hardware" line
-> You'd best google the error to find out why.
 

admin@pi4plc:~ $ uname -a
Linux pi4plc 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux
 

admin@pi4plc:~ $ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
 
admin@pi4plc:~ $ df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 3726712 0 3726712 0% /dev
tmpfs 799872 1252 798620 1% /run
/dev/mmcblk0p2 60798236 4951436 52738480 9% /
tmpfs 3999360 148 3999212 1% /dev/shm
tmpfs 5120 16 5104 1% /run/lock
/dev/mmcblk0p1 522232 74110 448122 15% /boot/firmware
tmpfs 799872 40 799832 1% /run/user/1000
 
 
!---------------------------------------------------------------------------------------------------
! Installing WiringPi manually
! Source: https://raspberrypi.stackexchange.com/questions/133251/wiringpi-is-missing-from-bullseye-how-do-i-install-it)
!---------------------------------------------------------------------------------------------------
root@pi4plc:/home/admin# wget https://github.com/WiringPi/WiringPi/releases/download/2.61-1/wiringpi-2.61-1-arm64.deb
--2023-12-29 15:39:24-- https://github.com/WiringPi/WiringPi/releases/download/2.61-1/wiringpi-2.61-1-arm64.deb
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/4830334/5a51359f-530c-4a7a-8e14-d1bc36f70373?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20231229%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231229T143924Z&X-Amz-Expires=300&X-Amz-Signature=bd5517132b02fb168b0aefcfea5576f57eb4c87d49ad2c0c01ea3c5a2ed969ae&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=4830334&response-content-disposition=attachment%3B%20filename%3Dwiringpi-2.61-1-arm64.deb&response-content-type=application%2Foctet-stream [following]
--2023-12-29 15:39:24-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/4830334/5a51359f-530c-4a7a-8e14-d1bc36f70373?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20231229%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231229T143924Z&X-Amz-Expires=300&X-Amz-Signature=bd5517132b02fb168b0aefcfea5576f57eb4c87d49ad2c0c01ea3c5a2ed969ae&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=4830334&response-content-disposition=attachment%3B%20filename%3Dwiringpi-2.61-1-arm64.deb&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.110.133, 185.199.111.133, 185.199.108.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 58840 (57K) [application/octet-stream]
saving to: ‘wiringpi-2.61-1-arm64.deb’
wiringpi-2.61-1-arm64.deb 100%[==================================================================>] 57.46K --.-KB/s in 0.01s
2023-12-29 15:39:25 (4.22 MB/s) - ‘wiringpi-2.61-1-arm64.deb’ saved [58840/58840]

root@pi4plc:/home/admin# sudo apt install ./wiringpi-2.61-1-arm64.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'wiringpi' instead of './wiringpi-2.61-1-arm64.deb'
wiringpi is already the newest version (2.61).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@pi4plc:/home/admin# gpio -v
gpio version: 2.61
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty
Oops: Unable to determine board revision from /proc/cpuinfo
-> No "Hardware" line
-> You'd best google the error to find out why.
 
Reply 0 0
plc_ingenieur_ger
I installes the Debian Bulleseye 64Bit on my Raspberry Pi 4 and installed OpenPLC again. Now it works!
Reply 0 0
dnalor
Hi
 
Thank you very much for the fast reply. I really appreciate it, it saved me a lot of time and hassle.
So I started from scratch again and installed the suggested Debian version. After the OpenPLC runtime installation, I was at least able to start and stop the PLC with the hardware setting "Raspberry Pi". Nevertheless, the demo program did throw an error and was not working. 
Still the WiringPi software hasn't been installed. Therefore the "gpio" command did not appear to be available.
In the end the following action resolved the issue.
 
sudo apt install ./wiringpi-2.61-1-armhf.deb
 
After this I was able to compile the demo program (start-stop) with no error and the PLC can now be stopped and started.
Great, finally my initial PLC program work as expected. I hope the upcoming tests do not appear to work as painful as this one.
Reply 0 0
Reply