Comments (10)
Kaum macht man es richtig und schon geht's auch.
Vielen Dank für deine geduldige Hilfe.
Autostart des xonox Servers:
sudo nano /etc/rc.local
Vor der Zeile mit exit 0
sudo python -m xonox &
einfügen
from xonox.
Klappt es besser, wenn du pip3 install xonox
zur Installation nutzt?
from xonox.
Nein, gleiche Meldung
from xonox.
Das geht:
sudo pip3.8 install xonox
oder
sudo pip3.8 install xonox -v
für verbose mode
python -m xonox liefert dann Folgendes:
- Serving Flask app 'xonox.server' (lazy loading)
- Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead. - Debug mode: off
Permission denied
from xonox.
Ich vermute, dass die permission denied
-Meldung durch den Versuch den Port 80 zu öffnen entsteht. Unter Linux/Unix dürfen in der Regel normale Benutzer nur Ports über 1024 öffnen. Da die iRadios jedoch Port 80 erwarten, muss xonox
auf diesem laufen.
@HorstRado: Versuche mal, ob xonox
läuft, wenn du das Script als superuser ausführst, also:
sudo python -m xonox
xonox
aber nicht die Konfiguration im Home-Verzeichnis speichern kann. Deshalb empfehle ich dir, den Speicherort für die Konfiguration manuell anzugeben, wenn du sudo
nutzt. Um die xonox.config
zum Beispiel im Verzeichnis home/pi
zu speichern, nutze:
sudo python -m xonox --config-dir /home/pi
Normalerweise würde ich davon abraten, einen Service als superuser auszuführen. So kannst du aber schnell feststellen, ob es an den fehlenden Berechtigungen für Port 80 lag.
from xonox.
Ich bin jetzt noch mal über 'Los' gegangen :-)
-
Raspi neu installiert mit der aktuellen Raspian Version
-
enthalten ist Python V3.9.2
-
pip install xonox funktioniert ohne Fehlermeldung:
horst@raspberrypi:~ $ pip install xonox
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: xonox in ./.local/lib/python3.9/site-packages (0.0.5)
Requirement already satisfied: flask in /usr/lib/python3/dist-packages (from xonox) (1.1.2) -
legacy.noxonserver.eu und gate1.noxonserver.eu sind in pi-hole (läuft auf einem anderen raspi) umgeleitet.
-
python -m xonox liefert:
horst@raspberrypi:~ $ python -m xonox
- Serving Flask app "xonox.server" (lazy loading)
- Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead. - Debug mode: off
Traceback (most recent call last):
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/horst/.local/lib/python3.9/site-packages/xonox/main.py", line 14, in
server.run(args.host, args.config_dir)
File "/home/horst/.local/lib/python3.9/site-packages/xonox/server.py", line 103, in run
app.run(host=host, port=80)
File "/usr/lib/python3/dist-packages/flask/app.py", line 990, in run
run_simple(host, port, self, **options)
File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 1052, in run_simple
inner()
File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 996, in inner
srv = make_server(
File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 847, in make_server
return ThreadedWSGIServer(
File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 740, in init
HTTPServer.init(self, server_address, handler)
File "/usr/lib/python3.9/socketserver.py", line 452, in init
self.server_bind()
File "/usr/lib/python3.9/http/server.py", line 138, in server_bind
socketserver.TCPServer.server_bind(self)
File "/usr/lib/python3.9/socketserver.py", line 466, in server_bind
self.socket.bind(self.server_address)
PermissionError: [Errno 13] Permission denied
- Radio ist Noxon iRado300
P.S.
- sudo python -m xonox liefert:
horst@raspberrypi:~ $ sudo python -m xonox
/usr/bin/python: No module named xonox
from xonox.
@HorstRado: Es freut mich, dass du noch nicht aufgegeben hast. 👍
Du hast xonox
als Benutzer horst
installiert. Deshalb wurde das Modul durch pip
in /home/horst/.local/lib/python3.9/site-packages/xonox/
abgelegt.
Wenn du jetzt aber sudo python -m xonox
ausführst, wird das ganze (wahrscheinlich) als Benutzer pi
ausgeführt. Im Verzeichnis /home/pi/.local/lib/python3.9/site-packages/
wird es aber wahrscheinlich kein xonox
geben.
Du hast jetzt zwei Möglichkeiten:
Du installierst für pi
das Paket xonox
mittels sudo pip install xonox
. Dann kannst du mit sudo python -m xonox --config-dir .
den Service starten. (Vielleicht deinstallierst du das Paket dann noch für den Nutzer horst
mittels pip uninstall xonox
.)
Oder du führst xonox
als Benutzer horst
, ohne sudo
aus. Dazu benötigst du aber noch ein Helferlein wie authbind
.
Installation:
sudo apt install authbind
# configure access to port 80
sudo touch /etc/authbind/byport/80
sudo chmod 777 /etc/authbind/byport/80
Start von xonox
:
authbind --deep python -m xonox --config-dir .
from xonox.
@HorstRado: Falls du xonox
nicht bei dir als Autostart-Service konfiguriert hast und verhindern möchtest, dass der Service nach deinem SSH-Logout beendet wird, kann dir screen
weiterhelfen.
from xonox.
Erst mal vielen Dank für deine gute Hilfe!
Ich hab jetzt mit dem Benutzer pi folgendes gemacht:
pi@raspberrypi:~ $ sudo pip install xonox
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: xonox in /usr/local/lib/python3.9/dist-packages (0.0.5)
Requirement already satisfied: flask in /usr/lib/python3/dist-packages (from xonox) (1.1.2)
pi@raspberrypi:~ $ sudo python -m xonox
- Serving Flask app "xonox.server" (lazy loading)
- Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead. - Debug mode: off
- Running on http://0.0.0.0:80/ (Press CTRL+C to quit)
Am Radiomenu 'Internet' angewählt gibt die noxon Konsole folgendes aus und das Radiodisplay sagt 'leer':
192.168.42.125 - - [26/Jun/2022 17:40:26] "GET /setupapp/fs/asp/BrowseXML/loginXML.asp?token=0 HTTP/1.1" 200 -
192.168.42.125 - - [26/Jun/2022 17:40:26] "GET /setupapp/fs/asp/BrowseXML/loginXML.asp?gofile=&mac=9f868345b8fa93a771e9f6bc7309e275&dlang=ger&fver=79&hw=10143&ven=Terratec HTTP/1.1" 200 -
Beim Absenden deines Beispiels:
curl --location --request POST 'http://legacy.noxonserver.eu/station'
--header 'Content-Type: application/json'
--data-raw '{
"name": "Radio Swiss Pop",
"description": "Radio Swiss Pop Live Stream",
"streamUrl": "http://stream.srg-ssr.ch/m/rsp/mp3_128"
}'
oder bei
curl --location --request GET 'http://legacy.noxonserver.eu/station'
curl: (7) Failed to connect to legacy.noxonserver.eu port 80: Connection refused
from xonox.
Wenn das Radiodisplay 'leer' anzeigt, ist das ein gutes Zeichen. Das zeigt, dass das Radio mit xonox
sprechen kann. Bei den Beispielrequests in der Doku bin ich davon ausgegangen, dass der Rechner der den Curl-Request abschickt den gleichen DNS-Server wie die Radios nutzt. Wenn das bei dir nicht der Fall ist, dann schicke die Requests an die IP-Adresse des xonox
-Services. Wenn du direkt auf dem Raspberry bist auf dem auch xonox
läuft, dann könntest du auch den Request an den localhost
abschicken.
Also wenn du den Request vom Raspberry ausführst:
curl --location --request POST 'http://localhost/station'
--header 'Content-Type: application/json'
--data-raw '{
"name": "Radio Swiss Pop",
"description": "Radio Swiss Pop Live Stream",
"streamUrl": "http://stream.srg-ssr.ch/m/rsp/mp3_128"
}'
Von einem anderen Computer:
curl --location --request POST 'http://xonox-ip/station'
--header 'Content-Type: application/json'
--data-raw '{
"name": "Radio Swiss Pop",
"description": "Radio Swiss Pop Live Stream",
"streamUrl": "http://stream.srg-ssr.ch/m/rsp/mp3_128"
}'
from xonox.
Related Issues (12)
- Station IDs are not unique
- Management API does not return JSON HOT 4
- Verbindung fehlgeschlagen HOT 4
- Add Support for Favorite/Preset-Buttons HOT 13
- Order Station List Alphabetically
- Support for Noxon 2 Audio? HOT 30
- xonox 0.0.7.2 does not start when installed after 2023-04-25 HOT 1
- Management API: Get station and station-list does not work HOT 1
- Problems with xonox 1.0.1 in Ubuntu 22.04.4 LTS (Jammy Jellyfish) HOT 2
- Support for Noxon iRadio HOT 1
- how to config local DNS? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xonox.