[GELÖST] SDR-Stick - Datenübertragung zu mosquitto schlägt fehl

Du hast Fragen oder ein Problem bei der Installation.....
Einfach Fragen.
Wenn du Fragen zu einem Programm hast das nicht Bestandteil des Skripts ist benutz bitte den Bereich Userprojekte viewforum.php?f=33
Antworten
zillawilli
User
User
Beiträge: 8
Registriert: Fr 17. Dez 2021, 18:49

[GELÖST] SDR-Stick - Datenübertragung zu mosquitto schlägt fehl

Beitrag von zillawilli »

Hallo Leute

Ich habe Probleme das die Datenübetragung vom SDR-Stick zu mosquitto nicht funktioniert.

der Befehl aus dem Video DVB-T-433MHz.json bei Minute 11:28
bringt mir leider immer den Fehler:

sudo rtl_433 -F json | mosquitto_pub -u user -P pwd -t home/rtl_433 -l

[1] 4589
-bash: /: Ist ein Verzeichnis
pi@raspberrypi:~ $ Error: Both topic and message must be supplied.
mosquitto_pub is a simple mqtt client that will publish a message on a single topic and exit
mosquitto_pub version 2.0.11 running on libmosquitto 2.0.11.

Usage: mosquitto_pub {[-h host] [--unix path] [-p port] [-u username] [-P passwo rd] -t topic | -L URL}
{-f file | -l | -n | -m message}
[-c] [-k keepalive] [-q qos] [-r] [--repeat N] [--repeat-de lay time] [-x session-expiry]
[-A bind_address] [--nodelay]
[-i id] [-I id_prefix]
[-d] [--quiet]
[-M max_inflight]
[-u username [-P password]]
[--will-topic [--will-payload payload] [--will-qos qos] [-- will-retain]]
[{--cafile file | --capath dir} [--cert file] [--key file]
[--ciphers ciphers] [--insecure]
[--tls-alpn protocol]
[--tls-engine engine] [--keyform keyform] [--tls-engine-k pass-sha1]]
[--tls-use-os-certs]
[--psk hex-key --psk-identity identity [--ciphers ciphers]]
[--proxy socks-url]
[--property command identifier value]
[-D command identifier value]
mosquitto_pub --help

-A : bind the outgoing socket to this host/ip address. Use to control which int erface
the client communicates over.
-d : enable debug messages.
-c : disable clean session/enable persistent client mode
When this argument is used, the broker will be instructed not to clean exi sting sessions
for the same client id when the client connects, and sessions will never e xpire when the
client disconnects. MQTT v5 clients can change their session expiry interv al with the -x
argument.
-D : Define MQTT v5 properties. See the documentation for more details.
-f : send the contents of a file as the message.
-h : mqtt host to connect to. Defaults to localhost.
-i : id to use for this client. Defaults to mosquitto_pub_ appended with the pr ocess id.
-I : define the client id as id_prefix appended with the process id. Useful for when the
broker is using the clientid_prefixes option.
-k : keep alive in seconds for this client. Defaults to 60.
-L : specify user, password, hostname, port and topic as a URL in the form:
mqtt(s)://[username[:password]@]host[:port]/topic
-l : read messages from stdin, sending a separate message for each line.
-m : message payload to send.
-M : the maximum inflight messages for QoS 1/2..
-n : send a null (zero length) message.
-p : network port to connect to. Defaults to 1883 for plain MQTT and 8883 for M QTT over TLS.
-P : provide a password
-q : quality of service level to use for all messages. Defaults to 0.
-r : message should be retained.
-s : read message from stdin, sending the entire input as a message.
-t : mqtt topic to publish to.
-u : provide a username
-V : specify the version of the MQTT protocol to use when connecting.
Can be mqttv5, mqttv311 or mqttv31. Defaults to mqttv311.
-x : Set the session-expiry-interval property on the CONNECT packet. Applies to MQTT v5
clients only. Set to 0-4294967294 to specify the session will expire in th at many
seconds after the client disconnects, or use -1, 4294967295, or ∞ for a se ssion
that does not expire. Defaults to -1 if -c is also given, or 0 if -c not g iven.
--help : display this message.
--nodelay : disable Nagle's algorithm, to reduce socket sending latency at the possible
expense of more packets being sent.
--quiet : don't print error messages.
--repeat : if publish mode is -f, -m, or -s, then repeat the publish N times.
--repeat-delay : if using --repeat, wait time seconds between publishes. Defaul ts to 0.
--unix : connect to a broker through a unix domain socket instead of a TCP sock et,
e.g. /tmp/mosquitto.sock
--will-payload : payload for the client Will, which is sent by the broker in ca se of
unexpected disconnection. If not given and will-topic is set, a zero
length message will be sent.
--will-qos : QoS level for the client Will.
--will-retain : if given, make the client Will retained.
--will-topic : the topic on which to publish the client Will.
--cafile : path to a file containing trusted CA certificates to enable encrypte d
communication.
--capath : path to a directory containing trusted CA certificates to enable enc rypted
communication.
--cert : client certificate for authentication, if required by server.
--key : client private key for authentication, if required by server.
--keyform : keyfile type, can be either "pem" or "engine".
--ciphers : openssl compatible list of TLS ciphers to support.
--tls-version : TLS protocol version, can be one of tlsv1.3 tlsv1.2 or tlsv1.1.
Defaults to tlsv1.2 if available.
--insecure : do not check that the server certificate hostname matches the remo te
hostname. Using this option means that you cannot be sure that the
remote host is the server you wish to connect to and so is insecur e.
Do not use this option in a production environment.
--tls-engine : If set, enables the use of a TLS engine device.
--tls-engine-kpass-sha1 : SHA1 of the key password to be used with the selected SSL engine.
--tls-use-os-certs : Load and trust OS provided CA certificates.
--psk : pre-shared-key in hexadecimal (no leading 0x) to enable TLS-PSK mode.
--psk-identity : client identity string for TLS-PSK mode.
--proxy : SOCKS5 proxy URL of the form:
socks5h://[username[:password]@]hostname[:port]
Only "none" and "username" authentication is supported.

See https://mosquitto.org/ for more information.

hier beginnt der SDR-Stick zu arbeiten:

rtl_433 version unknown inputs file rtl_tcp RTL-SDR SoapySDR
Use -h for usage help and see https://triq.org/ for documentation.
Trying conf file at "rtl_433.conf"...
Trying conf file at "/root/.config/rtl_433/rtl_433.conf"...
Trying conf file at "/usr/local/etc/rtl_433/rtl_433.conf"...
Trying conf file at "/etc/rtl_433/rtl_433.conf"...

Hat einer bitte eine Idee dazu?

sg
willi

zillawilli
User
User
Beiträge: 8
Registriert: Fr 17. Dez 2021, 18:49

Re: SDR-Stick - Datenübertragung zu mosquitto schlägt fehl

Beitrag von zillawilli »

Hallo Miteinander

Musste bei mir leider den von ei23 vorgeschlagenen Befehl

sudo rtl_433 -F json | mosquitto_pub -u user -P pwd -t home/rtl_433 -l

auf

sudo rtl_433 -F json -F mqtt://localhost,retain=0,events=home/rtl_433

ändern. Ohne User und PWD.

Nun rennt es.

siehe: RTL_433 zu MQTT zu Homeassistant

sg
willi

Benutzeravatar
ei23felix
Administrator
Administrator
Beiträge: 291
Registriert: Sa 17. Jul 2021, 10:44
Kontaktdaten:

Re: [GELÖST] SDR-Stick - Datenübertragung zu mosquitto schlägt fehl

Beitrag von ei23felix »

Hab das schon länger nicht mehr getestet, vielleicht wurde was am pubsub_client (der läuft nativ auf dem pi) geändert...
Danke für den Hinweis!
  • Böse Menschen sind selten tatsächlich böse, meistens eher faul oder dumm.
  • Du kannst nur dann sicher sein, wenn du weißt, dass du nie ganz sicher sein kannst.
  • Du kannst nur unabhängig werden, wenn du weißt, dass du nie ganz unabhängig sein wirst.

Dennis0815
User
User
Beiträge: 10
Registriert: Mo 14. Mär 2022, 11:52

Re: [GELÖST] SDR-Stick - Datenübertragung zu mosquitto schlägt fehl

Beitrag von Dennis0815 »

Ich hatte ebenfalls das Problem, dass die Weitergabe an MQTT nicht geklappt hat. Hatte aber die Fehlermeldung:
-bash: mosquitto_pub: command not found
Daraufhin habe ich das Kommando geändert, wie es von zillawilli beschrieben wurde.

Code: Alles auswählen

sudo rtl_433 -F json -F mqtt://localhost,retain=0,events=home/rtl_433
Der Fehler ist nun weg, aber der Login auf MQTT klappt leider nicht. Hier mal ein Auszug aus der Console:

Code: Alles auswählen

sudo rtl_433 -F json -F mqtt://localhost,retain=0,events=home/rtl_433
rtl_433 version 21.12-100-gbb1be7f1 branch master at 202204251100 inputs file rtl_tcp RTL-SDR
Use -h for usage help and see https://triq.org/ for documentation.
Trying conf file at "rtl_433.conf"...
Trying conf file at "/root/.config/rtl_433/rtl_433.conf"...
Trying conf file at "/usr/local/etc/rtl_433/rtl_433.conf"...
Trying conf file at "/etc/rtl_433/rtl_433.conf"...
Publishing MQTT data to localhost port 1883
Publishing events info to MQTT topic "home/rtl_433".
Registered 186 out of 218 device decoding protocols [ 1-4 8 11-12 15-17 19-23 25-26 29-36 38-60 63 67-71 73-100 102-105 108-116 119 121 124-128 130-149 151-161 163-168 170-175 177-197 199 201-215 217-218 ]
Found Fitipower FC0012 tuner
Exact sample rate is: 250000.000414 Hz
Sample rate set to 250000 S/s.
Tuner gain set to Auto.
Tuned to 433.920MHz.
Allocating 15 zero-copy buffers
MQTT Connected...
baseband_demod_FM: low pass filter for 250000 Hz at cutoff 25000 Hz, 40.0 us
MQTT Connection error: 5
MQTT Connection failed...
MQTT Connected...
MQTT Connection error: 5
MQTT Connection failed...
MQTT Connected...
MQTT Connection error: 5
MQTT Connection failed...
Hat jemand eine Idee?

Andy
User
User
Beiträge: 194
Registriert: Fr 16. Jul 2021, 22:06

Re: [GELÖST] SDR-Stick - Datenübertragung zu mosquitto schlägt fehl

Beitrag von Andy »

user und passwort für den mqtt brocker hast du gesetzt?
Raspberry PI 400 4GB # Raspberry PI 4B 4GB

Dennis0815
User
User
Beiträge: 10
Registriert: Mo 14. Mär 2022, 11:52

Re: [GELÖST] SDR-Stick - Datenübertragung zu mosquitto schlägt fehl

Beitrag von Dennis0815 »

Ja, hab ich, aber auch so klappt es nicht, denn dann bekomme ich den weiter oben von zilliwilli beschriebenen Fehler.
Laut zilliwilli braucht man die Userdaten ja nicht mehr.

Antworten