El tutorial dice broker = 192.168.x.x – ¿qué dirección pongo para Hermetry?
Traducido del English por IA ·
Fundador de una pequeña startup de logística, NO soy ingeniero, intento tener lista una prueba de concepto antes de una reunión con un inversor. Raspberry Pi 4 con una sonda de temperatura para un remolque frigorífico.Seguí una entrada de blog con paho-mqtt. En ella aparece broker = "192.168.1.50" y port = 1883. ¿Cuál es la dirección IP de MQTT de Hermetry? Creé un dispositivo y copié el token de acceso, pero no encuentro ninguna IP. Probé la IP que devuelve el ping al nombre de host en la página del dispositivo y obtuve on_connect rc=5. También probé el puerto 1883 con el nombre de host, también 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.
Traducido del English por IA ·
¿Qué muestra exactamente la tarjeta «Detalles de conexión» del dispositivo? ¿Host y puerto?
What exactly does the Connection details card on the device show you? Host and port?
Traducido del English por IA ·
Un nombre de host y 8883. Entonces, ¿el 1883 del blog está mal para este caso?
A host name and 8883. So the 1883 in the blog is wrong for this?
Traducido del English por IA ·
Sí. Ese blog es para un broker en su propia red doméstica, por eso tiene una dirección 192.168. Para Hermetry no debe usar ninguna IP: conéctese por el nombre de host de la tarjeta Connection details, TLS en el 8883. TLS necesita el nombre (SNI), así que la IP del ping falla, y el 1883 sin cifrar se rechaza a menos que el perfil permita MQTT sin cifrar, lo cual no ocurre por defecto. rc=5 significa «not authorised» y la razón real aparece en la pestaña Log del dispositivo, vale la pena revisarla.
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)
Con paho 2.x necesitas en su lugar mqtt.Client(mqtt.CallbackAPIVersion.VERSION2, client_id="reefer-01").
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.
Traducido del English por IA ·
Conectado, -18.2 aparece en la página del dispositivo. La pestaña Registro sí indicaba por qué falló el intento en 1883 (puerto sin cifrar no permitido), solo que no sabía que existía. Gracias, la demo es el jueves.
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.
- Debes estar registrado para responder a este debate.
Únete a la conversación
Inicia sesión para preguntar y responder, dar me gusta a las publicaciones útiles y marcar la respuesta que resolvió tu problema. Cada aportación suma puntos y niveles.

