Skip to content

Fix compatibility with Raspberry Pi OS Trixie (Debian 13 / Python 3.13) #3344

@A9xxx

Description

@A9xxx

Summary:
openWB 2.x fails to start on Raspberry Pi OS Trixie (Debian 13) with Python 3.13. The system shows "Lade Einstellungen..." indefinitely.

Environment:

  • Raspberry Pi OS Trixie (Debian 13)
  • Python 3.13
  • openWB 2.2.0 (master branch)

Errors found (in order of occurrence):

1. evdev==1.5.0 uses removed @asyncio.coroutine

asyncio.coroutine was removed in Python 3.11. evdev 1.5.0 uses it internally.
Fix: Upgrade to evdev==1.9.3 (tested and working).

2. paho-mqtt 1.6.1 API broken in paho-mqtt 2.x

mqtt.Client(name) without callback_api_version raises an error in paho-mqtt 2.x (which Debian 13 pip might install).
Fix: Update broker.py to use callback_api_version=mqtt.CallbackAPIVersion.VERSION1 and bump requirements to paho_mqtt==2.1.0.

3. atreboot.sh pip installs fail on Debian 13 (PEP 668)

Debian 13 enforces PEP 668 (externally managed environment). pip3 install without --break-system-packages fails.


Proposed Changes

requirements.txt

-evdev==1.5.0
+evdev==1.9.3
-paho_mqtt==1.6.1
+paho_mqtt==2.1.0

packages/helpermodules/broker.py

diff
class BrokerClient:
     def __init__(self, name, on_connect, on_message, host="localhost", port=1886):
         try:
             self.name = f"openWB-{name}-{get_name_suffix()}"
-            self.client = mqtt.Client(self.name)
+            self.client = mqtt.Client(
+                client_id=self.name,
+                callback_api_version=mqtt.CallbackAPIVersion.VERSION1
+            )
             self.client.on_connect = on_connect
             self.client.on_message = on_message
             self.client.connect(host, port)
 class InternalBrokerPublisher:
     def __init__(self):
         try:
-            self.client = mqtt.Client(f"openWB-python-bulk-publisher-{get_name_suffix()}")
+            self.client = mqtt.Client(
+                client_id=f"openWB-python-bulk-publisher-{get_name_suffix()}",
+                callback_api_version=mqtt.CallbackAPIVersion.VERSION1
+            )
             self.client.connect("localhost", 1886)
runs/atreboot.sh (two places)

diff
-pip3 install -r requirements.txt
+pip3 install --break-system-packages -r requirements.txt
-pip uninstall urllib3 -y
+pip uninstall urllib3 -y --break-system-packages 2>/dev/null; true
Additional Notes for ARM / Debian 13
Some packages cannot be compiled from source on ARM with Python 3.13:

jq==1.1.3 (longintrepr.h removed in Py 3.12) -> Use apt install python3-jq
grpcio==1.60.1 (OOM on Pi during compile) -> Use apt install python3-grpcio
lxml==4.9.1 -> Use apt install python3-lxml
Suggested addition to atreboot.sh before pip install:

bash
if python3 -c "import sys; exit(0 if sys.version_info >= (3,12) else 1)" 2>/dev/null; then
    apt-get install -y python3-grpcio python3-jq python3-lxml python3-protobuf 2>/dev/null || true
fi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions