Eğitimde broker = 192.168.x.x yazıyor – Hermetry için hangi adresi gireceğim?
Yapay zekâ tarafından English dilinden çevrildi ·
Küçük bir lojistik girişiminin kurucusuyum, mühendis DEĞİLİM; bir yatırımcı toplantısından önce bir proof of concept (kavram kanıtı) hazırlamaya çalışıyorum. Bir frigorifik römork için sıcaklık sensörlü bir Raspberry Pi 4.Bir blog yazısındaki paho-mqtt adımlarını izledim. Orada broker = "192.168.1.50" ve port = 1883 yazıyor. Hermetry’nin MQTT IP adresi nedir? Bir cihaz oluşturup erişim belirtecini kopyaladım ama hiçbir yerde IP bulamıyorum. Cihaz sayfasındaki ana bilgisayar adına ping attığımda dönen IP’yi denedim ve on_connect rc=5 hatasını aldım. Ana bilgisayar adıyla birlikte port 1883’ü de denedim, o da rc 5 verdi.
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.
Yapay zekâ tarafından English dilinden çevrildi ·
Cihazdaki Bağlantı ayrıntıları kartı tam olarak neyi gösteriyor? Ana bilgisayar (host) ve port?
What exactly does the Connection details card on the device show you? Host and port?
Yapay zekâ tarafından English dilinden çevrildi ·
Bir ana bilgisayar adı ve 8883. Yani bloktaki 1883 bunun için yanlış mı?
A host name and 8883. So the 1883 in the blog is wrong for this?
Yapay zekâ tarafından English dilinden çevrildi ·
Evet. O blog, kendi ev ağınızdaki bir broker için hazırlanmış, bu yüzden 192.168 adresi var. Hermetry için hiç IP kullanmanız gerekmiyor: Connection details kartındaki host adıyla, 8883 portunda TLS üzerinden bağlanın. TLS ad bilgisini (SNI) gerektirir, bu yüzden ping attığınız IP başarısız olur; düz 1883 ise profil düz MQTT’ye izin vermediği sürece reddedilir, varsayılan olarak da izin vermez. rc=5 “not authorised” (yetkisiz) anlamına gelir; asıl neden cihazın Log sekmesinde yer alıyor, bir bakmaya değer.
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)
paho 2.x ile bunun yerine mqtt.Client(mqtt.CallbackAPIVersion.VERSION2, client_id="reefer-01") kullanmanız gerekir.
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.
Yapay zekâ tarafından English dilinden çevrildi ·
Bağlandı, cihaz sayfasında -18.2 görünüyor. Günlük sekmesi 1883 denemesinin neden başarısız olduğunu söylemişti (düz port izinli değil), sadece bunun var olduğunu bilmiyordum. Teşekkürler, demo perşembe günü.
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.
- Bu konuyu yanıtlamak için giriş yapmış olmalısınız.
Sohbete katılın
Soru sormak ve yanıtlamak, yararlı gönderileri beğenmek ve sorununuzu çözen yanıtı işaretlemek için oturum açın. Her katkı puan ve seviye kazandırır.

