Test openWB 2 auf Debian 12 / RPI OS Bookworm

Fragen zur Nutzung, Features, usw..
Basti
Beiträge: 147
Registriert: Di Feb 21, 2023 3:28 pm
Has thanked: 1 time
Been thanked: 24 times

Re: Test openWB 2 auf Debian 12 / RPI OS Bookworm

Beitrag von Basti »

Habe es gestern erst wieder getestet nach dem ich die neuesten Updates eingefplegt habe und es lief ohne Probleme auf Proxmox.

Code: Alles auswählen

Debian 12
apt install curl sudo
adduser openwb
usermod -aG sudo openwb
reboot
login as openwb
curl -s https://raw.githubusercontent.com/Xerolux/openwb-bookworm/master/openwb-install.sh | sudo bash
Ansonsten bitte mal die main.log posten nach dem Neustart

Code: Alles auswählen

http://192.168.178.70/openWB/ramdisk/main.log
bitte deine IP Eintragen
Danke dir
rleidner
Beiträge: 1537
Registriert: Mo Nov 02, 2020 9:50 am
Has thanked: 103 times
Been thanked: 202 times

Re: Test openWB 2 auf Debian 12 / RPI OS Bookworm

Beitrag von rleidner »

Ich habe es auf debian12 am Laufen, aber es benötigt "kleinere" Anpassungen:
requirements.txt auf aktuelle Versionen setzen:

Code: Alles auswählen

openwb@debian12:~/openWB$ cat requirements.txt 
jq==1.6.0
paho_mqtt==1.6.1
pymodbus==3.6.3
pytest==8.0.0
requests_mock==1.11.0
lxml==5.1.0
aiohttp==3.9.3
schedule==1.2.1
PyJWT==2.8.0
ipparser==1.0.2
bs4==0.0.2
pkce==1.0.3
# skodaconnect==1.3.9
evdev==1.6.1
#telnetlib3==2.0.2
cryptography==42.0.2
msal==1.26.0
python-dateutil==2.8.2
umodbus==1.0.4
pysmb==1.2.9.1
pytz==2024.1
Daraus folgen einige Anpassungen in packages/modules/common/modbus.py:

Code: Alles auswählen

openwb@debian12:~/openWB$ git diff packages/modules/common/modbus.py | cat
diff --git a/packages/modules/common/modbus.py b/packages/modules/common/modbus.py
index a7ef40ed8..f31a3123e 100644
--- a/packages/modules/common/modbus.py
+++ b/packages/modules/common/modbus.py
@@ -10,7 +10,9 @@ from enum import Enum
 from typing import Callable, Iterable, Union, overload, List
 
 import pymodbus
-from pymodbus.client.sync import ModbusTcpClient, ModbusSerialClient
+from pymodbus.client.tcp  import ModbusTcpClient
+from pymodbus.client.serial  import ModbusSerialClient
+# from pymodbus.client.sync import ModbusTcpClient, ModbusSerialClient
 from pymodbus.constants import Endian
 from pymodbus.payload import BinaryPayloadDecoder
 from urllib3.util import parse_url
@@ -72,8 +74,8 @@ class ModbusClient:
     def __read_registers(self, read_register_method: Callable,
                          address: int,
                          types: Union[Iterable[ModbusDataType], ModbusDataType],
-                         byteorder: Endian = Endian.Big,
-                         wordorder: Endian = Endian.Big,
+                         byteorder: Endian = Endian.BIG,
+                         wordorder: Endian = Endian.BIG,
                          **kwargs):
         try:
             multi_request = isinstance(types, Iterable)
@@ -103,45 +105,45 @@ class ModbusClient:
             raise Exception(__name__+" "+str(type(e))+" " + str(e)) from e
 
     @overload
-    def read_holding_registers(self, address: int, types: Iterable[ModbusDataType], byteorder: Endian = Endian.Big,
-                               wordorder: Endian = Endian.Big, **kwargs) -> List[Number]:
+    def read_holding_registers(self, address: int, types: Iterable[ModbusDataType], byteorder: Endian = Endian.BIG,
+                               wordorder: Endian = Endian.BIG, **kwargs) -> List[Number]:
         pass
 
     @overload
-    def read_holding_registers(self, address: int, types: ModbusDataType, byteorder: Endian = Endian.Big,
-                               wordorder: Endian = Endian.Big, **kwargs) -> Number:
+    def read_holding_registers(self, address: int, types: ModbusDataType, byteorder: Endian = Endian.BIG,
+                               wordorder: Endian = Endian.BIG, **kwargs) -> Number:
         pass
 
     def read_holding_registers(self, address: int,
                                types: Union[Iterable[ModbusDataType], ModbusDataType],
-                               byteorder: Endian = Endian.Big,
-                               wordorder: Endian = Endian.Big,
+                               byteorder: Endian = Endian.BIG,
+                               wordorder: Endian = Endian.BIG,
                                **kwargs):
         return self.__read_registers(
             self.delegate.read_holding_registers, address, types, byteorder, wordorder, **kwargs
         )
 
     @overload
-    def read_input_registers(self, address: int, types: Iterable[ModbusDataType], byteorder: Endian = Endian.Big,
-                             wordorder: Endian = Endian.Big,
+    def read_input_registers(self, address: int, types: Iterable[ModbusDataType], byteorder: Endian = Endian.BIG,
+                             wordorder: Endian = Endian.BIG,
                              **kwargs) -> List[Number]:
         pass
 
     @overload
-    def read_input_registers(self, address: int, types: ModbusDataType, byteorder: Endian = Endian.Big,
-                             wordorder: Endian = Endian.Big, **kwargs) -> Number:
+    def read_input_registers(self, address: int, types: ModbusDataType, byteorder: Endian = Endian.BIG,
+                             wordorder: Endian = Endian.BIG, **kwargs) -> Number:
         pass
 
     def read_input_registers(self, address: int,
                              types: Union[Iterable[ModbusDataType], ModbusDataType],
-                             byteorder: Endian = Endian.Big,
-                             wordorder: Endian = Endian.Big,
+                             byteorder: Endian = Endian.BIG,
+                             wordorder: Endian = Endian.BIG,
                              **kwargs):
         return self.__read_registers(self.delegate.read_input_registers, address, types, byteorder, wordorder, **kwargs)
 
     @overload
-    def read_coils(self, address: int, types: Iterable[ModbusDataType], byteorder: Endian = Endian.Big,
-                   wordorder: Endian = Endian.Big,
+    def read_coils(self, address: int, types: Iterable[ModbusDataType], byteorder: Endian = Endian.BIG,
+                   wordorder: Endian = Endian.BIG,
                    **kwargs) -> List[bool]:
         pass
 
Ich empfehle ausserdem in der service definition der openwb2 das restart=always zu kommentieren, da sonst ständig das atreboot.sh neu ausgeführt wird.

Code: Alles auswählen

openwb@debian12:~/openWB$ cat data/config/openwb2.service
# openwb-version:2
[Unit]
Description="Regelung openWB 2.0"

[Service]
User=openwb
WorkingDirectory=/var/www/html/openWB
ExecStartPre=-/var/www/html/openWB/runs/atreboot.sh
ExecStart=/var/www/html/openWB/packages/main.py
# Restart=always
# extend timeout to 15min for long running atreboot
TimeoutStartSec=900

[Install]
WantedBy=multi-user.target
openWB-2 Standard+ | openWB EVU Kit v2 MID| 9,9kWp mit Kostal Plenticore 8.5 plus | VW ID.3, Kia EV6, Smart EQ forfour
Basti
Beiträge: 147
Registriert: Di Feb 21, 2023 3:28 pm
Has thanked: 1 time
Been thanked: 24 times

Re: Test openWB 2 auf Debian 12 / RPI OS Bookworm

Beitrag von Basti »

Hast du den pymodbus im Betrieb gändert oder bei Neuinstallation? Ich kriege es nicht zum laufen, es startet nicht.

Code: Alles auswählen

https://raw.githubusercontent.com/Xerolux/openwb-bookworm/pymodbus3.6.3/packages/modules/common/modbus.py

Code: Alles auswählen

pymodbus==3.6.3
Fehler:

Code: Alles auswählen

NameError: name 'event_jobs_running' is not defined
2024-02-11 13:00:26,970 - {root:270} - {ERROR:MainThread} - Fehler im Main-Modul
Traceback (most recent call last):
  File "/var/www/html/openWB/packages/main.py", line 263, in <module>
    if event_jobs_running.is_set() and len(schedule.get_jobs("algorithm")) == 0:
       ^^^^^^^^^^^^^^^^^^
NameError: name 'event_jobs_running' is not defined
2024-02-11 13:00:26,970 - {root:270} - {ERROR:MainThread} - Fehler im Main-Modul
Traceback (most recent call last):
  File "/var/www/html/openWB/packages/main.py", line 263, in <module>
    if event_jobs_running.is_set() and len(schedule.get_jobs("algorithm")) == 0:

Code: Alles auswählen

https://github.com/Xerolux/openwb-bookworm/tree/pymodbus3.6.3
rleidner
Beiträge: 1537
Registriert: Mo Nov 02, 2020 9:50 am
Has thanked: 103 times
Been thanked: 202 times

Re: Test openWB 2 auf Debian 12 / RPI OS Bookworm

Beitrag von rleidner »

Die in requirements.txt enthaltenen Python-Module werden bei Systemstart (runs/atreboot.sh) installiert.

Die Änderung an packages/modules/common/modbus.py habe ich manuell gemacht und dann openwb2 neu gestartet.

Code: Alles auswählen

sudo systemctl restart openwb2
Zum Testen kann man atreboot bzw. main.py auch aus der Shell starten - zumindest main.py zeigt meistens detailliertere Fehlermeldungen.
openWB-2 Standard+ | openWB EVU Kit v2 MID| 9,9kWp mit Kostal Plenticore 8.5 plus | VW ID.3, Kia EV6, Smart EQ forfour
SMCinc
Beiträge: 4
Registriert: Di Nov 08, 2022 8:15 pm

Re: Test openWB 2 auf Debian 12 / RPI OS Bookworm

Beitrag von SMCinc »

Bei mir läft seit heue openWB Version 2025-08-01 15:06:29 +0200 [cc53d66a4]
im Pi 3b mit BOOKWORM und Python 3.9.18 (Debian 12 kommt mit Python 3.11)
Ich habe Beschreibung 3 verwendet und hatte Probleme wegen Python 3.11
Hier meine Lösung:
Wenn man ~/openwb-venv schon angelegt hatte vorher löschen....

Code: Alles auswählen

sudo apt update
sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev \
  libnss3-dev libssl-dev libreadline-dev libffi-dev curl libsqlite3-dev wget
cd /usr/src
sudo wget https://www.python.org/ftp/python/3.9.18/Python-3.9.18.tgz
sudo tar xzf Python-3.9.18.tgz
cd Python-3.9.18
sudo ./configure --enable-optimizations
sudo make -j$(nproc)
sudo make altinstall
sudo rm /usr/src/Python-3.9.18.tgz
python3.9 -m venv ~/openwb-venv
source ~/openwb-venv/bin/activate

... und schon konnte auch jq==1.1.3 installiert werden:

Code: Alles auswählen

cd /var/www/html/openWB
pip install -r requirements.txt
pip install -r requirements2.txt
Ansonsten der Beschreibung folgen.
Es läuft bisher Fehlerfrei
Zuletzt geändert von SMCinc am So Aug 03, 2025 6:24 pm, insgesamt 1-mal geändert.
Basti
Beiträge: 147
Registriert: Di Feb 21, 2023 3:28 pm
Has thanked: 1 time
Been thanked: 24 times

Re: Test openWB 2 auf Debian 12 / RPI OS Bookworm

Beitrag von Basti »

Du kannst auch auf Trixie , läuft bei mir seit Wochen 😉. Aber freut mich das es läuft .

Habe da auch mal was gemacht vor Wochen 😁

https://github.com/Xerolux/openwb-trixie
ZOE-Fahrer
Beiträge: 26
Registriert: So Mär 20, 2022 5:41 pm

Re: Test openWB 2 auf Debian 12 / RPI OS Bookworm

Beitrag von ZOE-Fahrer »

War neugierig...
Beim One-liner wurd in jedem Versuch abgebrochen:

Code: Alles auswählen

[2026-04-17 22:42:50] ✓ Debian Trixie erkannt
bash: line 103: cho: command not found
Die Anleitung ist ein wenig unübersichtlich. Erst beim 3. mal Trixie aufspielen, hab ich dann geschafft alles nach Anleitung zu befolgen, openwb als user benutzt und die manuellen Schritte, aber auch da:

Code: Alles auswählen

restarting apache...done
installing python requirements...
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
installing openwb2 system service...
Created symlink '/etc/systemd/system/multi-user.target.wants/openwb2.service' → '/var/www/html/openWB/data/config/openwb2.service'.
installing openwb2-simpleAPI service...
Created symlink '/etc/systemd/system/multi-user.target.wants/openwb-simpleAPI.service' → '/var/www/html/openWB/data/config/openwb-simpleAPI.service'.
installing openwb2 remote support service...
Created symlink '/etc/systemd/system/multi-user.target.wants/openwbRemoteSupport.service' → '/etc/systemd/system/openwbRemoteSupport.service'.
installation finished, now starting openwb services...
Job for openwb2.service canceled.
all done
if you want to use this installation for development, add a password for user 'openwb'
Bis zum Übersichtsschirm "Der Systemstart ist noch nicht abgeschlossen." funktionierts. Dann wird der nterne Display dunkel und startet wieder neu.

Fehlermeldung auf /openWB/web/settings/#/
"Daten konnten nicht abonniert werden.
Topic: openWB/system/messages/+
ErrorWithSubackPacket: Connection closed"

und in der Schleife auf /openWB/web/display/

Code: Alles auswählen

Topic: openWB/system/current_commit Payload: "2026-04-16 08:52:52 +0200 [b6108c58c]"
Topic: openWB/system/current_branch Payload: "master"
Topic: openWB/system/update_in_progress Payload: false
Topic: openWB/system/ip_address Payload: "192.xxx.xxx.xxx"
Topic: openWB/system/current_commit Payload: "2026-04-16 08:52:52 +0200 [b6108c58c]"
Topic: openWB/system/current_branch Payload: "master"
Topic: openWB/system/update_in_progress Payload: false

Code: Alles auswählen

openwb@raspberrypi:~ $ python3 --version
Python 3.13.5
openwb@raspberrypi:~ $ python --version
Python 3.13.5
openwb@raspberrypi:~ $ pip3 --version
pip 25.1.1 from /usr/lib/python3/dist-packages/pip (python 3.13)
openwb@raspberrypi:~ $
wurde mit dem Skript nicht downgraded. -Denke, da liegt der Fehler.
und

Code: Alles auswählen

(openwb-venv) openwb@raspberrypi:~/openwb-trixie $ sudo systemctl status openwb
Unit openwb.service could not be found.
openwb@raspberrypi:~/openwb-trixie $ sudo systemctl status openwb
Unit openwb.service could not be found.
Schritte befolgen ist kein Problem, aber bei den ganzen Fehlermeldungen bin ich raus(
openWB DUO 22kW, Display + z.Z. nicht aktiver ESP zur Kostenanzeige
Ich hab einen Computer. Mit dem kann ich Probleme lösen, die ich ohne nicht habe...
Basti
Beiträge: 147
Registriert: Di Feb 21, 2023 3:28 pm
Has thanked: 1 time
Been thanked: 24 times

Re: Test openWB 2 auf Debian 12 / RPI OS Bookworm

Beitrag von Basti »

das sollte dein problem lösen, verbessere gerade das script..

Code: Alles auswählen

# 1) venv sicherstellen
cd ~/openwb-trixie
OPENWB_VENV_NONINTERACTIVE=1 ./install_python3.9.sh --venv-only

# 2) openWB auf venv umstellen
sudo sed -i 's#^ExecStart=.*#ExecStart=/opt/openwb-venv/bin/python3 /var/www/html/openWB/packages/main.py#' /var/www/html/openWB/data/config/openwb2.service
sudo sed -i 's#\([^[:alnum:]_/.-]\|^\)pip3 install -r#\1/opt/openwb-venv/bin/pip3 install -r#g' /var/www/html/openWB/runs/atreboot.sh
sudo sed -i 's#^ExecStart=.*#ExecStart=/opt/openwb-venv/bin/python3 /var/www/html/openWB/runs/remoteSupport/remoteSupport.py#' /etc/systemd/system/openwbRemoteSupport.service

# 3) Dienste neu laden/starten
sudo systemctl daemon-reload
sudo systemctl restart mosquitto
sudo systemctl restart openwb2
sudo systemctl restart openwb-simpleAPI
Antworten