256mqtt
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| 256mqtt [2024/11/23 16:05] – created jwan | 256mqtt [2025/10/10 10:15] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 59: | Line 59: | ||
| connectmqtt(); | connectmqtt(); | ||
| } | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | In the loop: | ||
| + | < | ||
| + | mqtt_client.loop(); | ||
| + | |||
| + | if (!mqtt_client.connected()) { | ||
| + | connectmqtt(); | ||
| + | } | ||
| </ | </ | ||
| Line 90: | Line 100: | ||
| bool publish(const char topic[], const char payload[], int length); | bool publish(const char topic[], const char payload[], int length); | ||
| bool publish(const char topic[], const char payload[], int length, bool retained, int qos); | bool publish(const char topic[], const char payload[], int length, bool retained, int qos); | ||
| - | </ | ||
| - | |||
| - | To reconnect if disconnected: | ||
| - | < | ||
| - | void loop() { | ||
| - | if (!mqtt_client.connected()) { | ||
| - | connectomqttbroker(); | ||
| - | } | ||
| - | mqtt_client.loop(); | ||
| - | } | ||
| </ | </ | ||
| Line 117: | Line 117: | ||
| Below link: | Below link: | ||
| - | https://docs.emqx.com/en/cloud/latest/connect_to_deployments/esp8266.html | + | https://registry.platformio.org/libraries/256dpi/MQTT |
| + | https://github.com/ | ||
256mqtt.1732377917.txt.gz · Last modified: (external edit)
