So far I was able to cover my needs with ESPHome. But now I want to add a sensor outside my LAN and use a public broker (flespi.io or HiveMQ).
So I did a configuration (relevant parts only):
INFO Successfully uploaded program.
INFO Starting log output from Test/m5stick/debug
INFO Successfully reconnected to the MQTT server
INFO Successfully reconnected to the MQTT server
INFO Successfully reconnected to the MQTT server
INFO Successfully reconnected to the MQTT server
INFO Successfully reconnected to the MQTT server
INFO Successfully reconnected to the MQTT server
INFO Successfully reconnected to the MQTT server
INFO Successfully reconnected to the MQTT server
Then the log stops. With port 1883 I only get one response “MQTT Server Connected”.
The ports are open on the network, no firewall blocking; with MQTT Explorer I can connect (with the same access token), create topics, send values…
If used with the esp-idf framework a TLS connection to a mqtt broker can be established. The servers CA certificate is required to validate the connection. […]
from:
And just in case you have nabu casa cloud you can also just use webhooks with esphome
No, it’s not working either. The only difference is that the log stops after the first line - it seems the ESP is hanging. With port 8883 the log gets longer but also slower.
Once back home I will try to get the SH1 fingerprint (I only have web access at the moment).
Also on an ESP32 I will try the certificate you linked.
But still I only get the following from loglevel VERY_VERBOSE
INFO Starting log output from Test/m5stick/debug
INFO Successfully reconnected to the MQTT server
INFO Successfully reconnected to the MQTT server
INFO Successfully reconnected to the MQTT server
INFO Successfully reconnected to the MQTT server
INFO Successfully reconnected to the MQTT server
INFO Successfully reconnected to the MQTT server
INFO Successfully reconnected to the MQTT server
INFO Successfully reconnected to the MQTT server
Flespi.io shows no connection at all.
The token is fine: MQTT Explorer can connect with the same token on port 8883.
ALso the rest of the configuration should be fine as it connects without problems to the local mosquitto if MQTT is configured for it. But the goal is that the sensor will be outside the LAN once it works…
To me it seems as ESPHome does not connect at all.