Hallo in die Runde,
ich sitze seit einer Woche an einem Problem, das ich nicht gelöst kriege und hoffe hier auf Hilfe.
IST-Zustand:
Raspberry Pi 3 mit DAC X400 und RF-Empangsmodul auf PIN 13, Rasbian Stretch (Installation 2017)
Der RPi3 dient als Squeeze-Player (squeeze-lite) und als Steuerung für den LMS-Server (Squeeze-Server) über Funk-Fernbedienungen
Ziel:
Raspberry Pi 4, RaspiOS Trixie, Soll die gleichen Aufgaben übernehmen
Das Problem:
Der Empfang der Funksignale über ein Python-Programm.
Ich habe auf dem Pi3 die Bibliothek pi_switch benutzt. Diese läßt sich nicht mehr installieren (siehe unten). Ich habe nach Alternativen gesucht und rpi-rf gefunden. Das kann ich zwar installieren, jedoch bricht das Test-Programm, das der Entwickler zur Verfügung stellt mit einer Fehlermeldung ab (siehe unten). Das hätte ich nicht erwartet.
Bei den Installationen werden u.a. vorher installiert: wiringpi und 433Utils (ohne Fehler). Ich kann auf der Konsole RFSniffer starten und auch die Codes der Funk-Fernbedienungen empfangen und anzeigen.
Weil ich bisher die Programmierung in Python vorgenommen habe, möchte ich meine Programme auch auf dem Pi4 weiter nutzen. Das Optimum wäre, wenn ich pi_switch installiert kriege.
Was kann ich da machen? Bitte helft mir.
Fehler bei Installation von pi_switch:
*********************************************************************************************************
pi@Squeeze-Neu:~ $ sudo pip install --break-system-packages pi_switch
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pi_switch
Downloading pi_switch-0.4.0.tar.gz (29 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pi_switch
DEPRECATION: Building 'pi_switch' using the legacy setup.py bdist_wheel mechanism, which will be removed in a future version. pip 25.3 will enforce this behaviour change. A possible replacement is to use the standardized build interface by setting the `--use-pep517` option, (possibly combined with `--no-build-isolation`), or adding a `pyproject.toml` file to the source tree of 'pi_switch'. Discussion can be found at https://github.com/pypa/pip/issues/6334
Building wheel for pi_switch (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [55 lines of output]
/usr/lib/python3/dist-packages/setuptools/dist.py:599: SetuptoolsDeprecationWarning: Invalid dash-separated key 'description-file' in 'metadata' (setup.cfg), please use the underscore name 'description_file' instead.
!!
********************************************************************************
Usage of dash-separated 'description-file' will not be supported in future
versions. Please use the underscore name 'description_file' instead.
(Affected: pi_switch).
By 2026-Mar-03, you need to update your project and remove deprecated calls
or your builds will no longer be supported.
See https://setuptools.pypa.io/en/latest/us ... onfig.html for details.
********************************************************************************
!!
opt = self._enforce_underscore(opt, section)
/usr/lib/python3/dist-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!
********************************************************************************
Please consider removing the following classifiers in favor of a SPDX license expression:
License :: OSI Approved :: GNU General Public License v2 (GPLv2)
See https://packaging.python.org/en/latest/ ... l/#license for details.
********************************************************************************
!!
self._finalize_license_expression()
In file included from pi_switch/wrapper/RCSwitch/PiSwitch.cpp:36,
from pi_switch/wrapper/pi_switch.cpp:36:
pi_switch/wrapper/RCSwitch/RCSwitch.cpp: In member function ‘char* RCSwitch::getCodeWordB(int, int, int)’:
pi_switch/wrapper/RCSwitch/RCSwitch.cpp:249:12: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]
249 | return '\0';
| ^~~~
| |
| char
pi_switch/wrapper/RCSwitch/RCSwitch.cpp: In member function ‘char* RCSwitch::getCodeWordC(char, int, int, int)’:
pi_switch/wrapper/RCSwitch/RCSwitch.cpp:322:12: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]
322 | return '\0';
| ^~~~
| |
| char
pi_switch/wrapper/RCSwitch/RCSwitch.cpp: In member function ‘char* RCSwitch::getCodeWordD(char, int, int)’:
pi_switch/wrapper/RCSwitch/RCSwitch.cpp:387:20: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]
387 | return '\0';
| ^~~~
| |
| char
pi_switch/wrapper/RCSwitch/RCSwitch.cpp:407:20: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]
407 | return '\0';
| ^~~~
| |
| char
error: command '/usr/bin/aarch64-linux-gnu-g++' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pi_switch
Running setup.py clean for pi_switch
Failed to build pi_switch
ERROR: Failed to build installable wheels for some pyproject.toml based projects (pi_switch)
*********************************************************************************************************
Anzeige bei Installtion rpi-rf
*********************************************************************************************************
pi@Squeeze-Neu:~ $ pip3 install --break-system-packages rpi-rf
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: rpi-rf in ./.local/lib/python3.13/site-packages (0.9.7)
Requirement already satisfied: RPi.GPIO in ./.local/lib/python3.13/site-packages (from rpi-rf) (0.7.1)
pi@Squeeze-Neu:~ $ sudo pip3 install --break-system-packages rpi-rf
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting rpi-rf
Downloading rpi_rf-0.9.7-py3-none-any.whl.metadata (3.9 kB)
Collecting RPi.GPIO (from rpi-rf)
Downloading RPi.GPIO-0.7.1.tar.gz (29 kB)
Preparing metadata (setup.py) ... done
Downloading rpi_rf-0.9.7-py3-none-any.whl (7.4 kB)
Building wheels for collected packages: RPi.GPIO
DEPRECATION: Building 'RPi.GPIO' using the legacy setup.py bdist_wheel mechanism, which will be removed in a future version. pip 25.3 will enforce this behaviour change. A possible replacement is to use the standardized build interface by setting the `--use-pep517` option, (possibly combined with `--no-build-isolation`), or adding a `pyproject.toml` file to the source tree of 'RPi.GPIO'. Discussion can be found at https://github.com/pypa/pip/issues/6334
Building wheel for RPi.GPIO (setup.py) ... done
Created wheel for RPi.GPIO: filename=rpi_gpio-0.7.1-cp313-cp313-linux_aarch64.whl size=69288 sha256=4ebb5541aa1edfc66acd5f1a10542ad022ec0676c9eb97a1050d3edca9470f5a
Stored in directory: /root/.cache/pip/wheels/fe/f1/d8/b4cf15eedd221009444483ab72646dee0b203f4aa2c185ec1c
Successfully built RPi.GPIO
Installing collected packages: RPi.GPIO, rpi-rf
Successfully installed RPi.GPIO-0.7.1 rpi-rf-0.9.7
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
*********************************************************************************************************
Beim Start von rf-receive.py:
*********************************************************************************************************
pi@Squeeze-Neu:~ $ ./rf-receive.py
Traceback (most recent call last):
File "/home/pi/./rf-receive.py", line 29, in <module>
rfdevice.enable_rx()
~~~~~~~~~~~~~~~~~~^^
File "/home/pi/.local/lib/python3.13/site-packages/rpi_rf/rpi_rf.py", line 189, in enable_rx
GPIO.add_event_detect(self.gpio, GPIO.BOTH)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Failed to add edge detection
*********************************************************************************************************
Raspberry Pi 4 Funk-Empfang 433MHz
Hallo, danke für die Antwort. Ich habe venv noch nie benutzt und muss mich damit erst beschäftigen. Ich hatte auf eine Antwort gehofft, die in die wheel-Erstellung bei der Installation ansetzt.
Wie nutzen andere die Funkmodule am Pi? Ich bin sicher nicht der einzige, der pi_switch benutzte...
Gruß
Wie nutzen andere die Funkmodule am Pi? Ich bin sicher nicht der einzige, der pi_switch benutzte...
Gruß
- __blackjack__
- User
- Beiträge: 14308
- Registriert: Samstag 2. Juni 2018, 10:21
- Wohnort: 127.0.0.1
- Kontaktdaten:
@PetiJ: Ich hoffe Du bist der einzige, denn wie im anderen Forum schon geschrieben: Das Projekt ist offiziell tot, und empfiehlt auf der archivierten Github-Seite sogar explizit ein anderes Package als Ersatz. Welches zudem noch den Vorteil hat, wie bei der Empfehlung auch beschrieben, dass das nur in Python ist und keinen C++-Compiler braucht.
„Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.“ — Brian W. Kernighan
