Tutorial nennt broker = 192.168.x.x – welche Adresse trage ich für Hermetry ein?
Von English mit KI übersetzt ·
Gründer eines kleinen Logistik-Startups, ich bin KEIN Ingenieur und versuche, vor einem Investorentermin einen Proof of Concept fertigzustellen. Raspberry Pi 4 mit einem Temperaturfühler für einen Kühlanhänger.Ich habe einem Blogbeitrag mit paho-mqtt gefolgt. Darin steht broker = "192.168.1.50" und port = 1883. Wie lautet Hermetrys MQTT-IP-Adresse? Ich habe ein Gerät angelegt und das Zugangstoken kopiert, aber nirgends eine IP gefunden. Ich habe die IP ausprobiert, die beim Ping auf den Hostnamen auf der Geräteseite zurückkam, und habe on_connect rc=5 erhalten. Auch Port 1883 mit dem Hostnamen probiert, ebenfalls rc 5.
Founder of a tiny logistics startup, I am NOT an engineer, trying to get a proof of concept done before an investor meeting. Raspberry Pi 4 with a temperature probe for a reefer trailer.
I followed a blog post with paho-mqtt. It has broker = "192.168.1.50" and port = 1883. What is Hermetry’s MQTT IP address? I created a device and copied the access token but I can’t find an IP anywhere. I tried the IP that comes back when I ping the host name on the device page and got on_connect rc=5. Also tried port 1883 with the host name, also rc 5.
Von English mit KI übersetzt ·
Was genau zeigt dir die Karte „Verbindungsdetails“ auf dem Gerät an? Host und Port?
What exactly does the Connection details card on the device show you? Host and port?
Von English mit KI übersetzt ·
Ein Hostname und 8883. Ist also die 1883 im Blog dafür falsch?
A host name and 8883. So the 1883 in the blog is wrong for this?
Von English mit KI übersetzt ·
Ja. Dieser Blog ist für einen Broker in Ihrem eigenen Heimnetz gedacht, deshalb steht dort eine 192.168-Adresse. Für Hermetry sollten Sie überhaupt keine IP verwenden: Verbinden Sie sich über den Host-Namen aus der Karte Connection details, TLS auf 8883. TLS benötigt den Namen (SNI), deshalb schlägt die angepingte IP fehl, und einfaches 1883 wird abgelehnt, sofern das Profil kein unverschlüsseltes MQTT erlaubt, was standardmäßig nicht der Fall ist. rc=5 bedeutet „not authorised“, der eigentliche Grund landet im Tab Log des Geräts, das lohnt einen Blick.
import ssl, json, paho.mqtt.client as mqtt
HOST = "<host from Connection details>"
TOKEN = "<access token>"
c = mqtt.Client(client_id="reefer-01")
c.username_pw_set(TOKEN) # token as username, no password
c.tls_set(cert_reqs=ssl.CERT_REQUIRED) # normal public CA bundle
c.connect(HOST, 8883, keepalive=60)
c.loop_start()
c.publish("v1/telemetry", json.dumps({"temperature": -18.2}), qos=1)
Mit paho 2.x müssen Sie stattdessen mqtt.Client(mqtt.CallbackAPIVersion.VERSION2, client_id="reefer-01") verwenden.
Yes. That blog is for a broker on your own home network, that’s why it has a 192.168 address. For Hermetry there’s no IP you should use at all: connect by the host name from the Connection details card, TLS on 8883. TLS needs the name (SNI), so the pinged IP fails, and plain 1883 is refused unless the profile allows plain MQTT, which it doesn’t by default. rc=5 is „not authorised“, and the actual reason ends up on the device’s Log tab, worth a look.
import ssl, json, paho.mqtt.client as mqtt
HOST = "<host from Connection details>"
TOKEN = "<access token>"
c = mqtt.Client(client_id="reefer-01")
c.username_pw_set(TOKEN) # token as username, no password
c.tls_set(cert_reqs=ssl.CERT_REQUIRED) # normal public CA bundle
c.connect(HOST, 8883, keepalive=60)
c.loop_start()
c.publish("v1/telemetry", json.dumps({"temperature": -18.2}), qos=1)
With paho 2.x you need mqtt.Client(mqtt.CallbackAPIVersion.VERSION2, client_id="reefer-01") instead.
Von English mit KI übersetzt ·
Verbunden, -18.2 steht auf der Geräteseite. Im Log-Tab stand auch, warum der Versuch mit 1883 fehlgeschlagen ist (einfacher Port nicht erlaubt), ich wusste nur nicht, dass es das gibt. Danke, die Demo ist am Donnerstag.
Connected, -18.2 is on the device page. Log tab did say why the 1883 attempt failed (plain port not allowed), I just didn’t know it existed. Thank you, demo is Thursday.
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.
Mitdiskutieren
Melde dich an, um Fragen zu stellen und zu beantworten, hilfreiche Beiträge mit „Gefällt mir“ zu markieren und die Antwort zu kennzeichnen, die dein Problem gelöst hat. Jeder Beitrag bringt Punkte und Stufen.

