How To Install Using Arduino Library Manager
This AsyncMQTT_Generic Library is based on and modified from Marvin Roger's async-mqtt-client Library, to provide support to many more boards besides ESP32/ESP8266, such as STM32F, Portenta_H7, etc. boards. Those supported boards can be used with ESP8266/ESP32’s WiFi, LAN8742A Ethernet, Portenta_H7 WiFi/Ethernet.
Releases v1.2.0
1. Add support to STM32F/L/H/G/WB/MP1 (without TLS/SSL) using built-in LAN8742A Ethernet, such as Nucleo-144, DISCOVERY, etc.
2. Add examples for STM32
Supported Boards
1. ESP32
2. ESP8266
3. WT32_ETH01 (ESP32 + LAN8720A)
4. STM32F/L/H/G/WB/MP1 boards with built-in Ethernet LAN8742A such as :
- Nucleo-144 (F429ZI, F767ZI)
- Discovery (STM32F746G-DISCOVERY)
- All STM32 boards (STM32F/L/H/G/WB/MP1) with 32K+ Flash, with Built-in Ethernet
Debug Terminal Output Sample
This is terminal debug output when running FullyFeature_STM32 on STM32F7 NUCLEO_F767ZI connecting to broker.emqx.io MQTT server. The Ethernet loss was tested by disconnecting, then reconnecting the Ethernet cable.
Code: Select all
Starting FullyFeature_STM32 on NUCLEO_F767ZI
AsyncMQTT_Generic v1.2.0 for STM32
Connected to network. IP = 192.168.2.118
Connecting to MQTT...
Connected to MQTT broker: broker.emqx.io, port: 1883
PubTopic: async-mqtt/STM32_Pub
************************************************
Session present: 0
Subscribing at QoS 2, packetId: 1
Publishing at QoS 0
Publishing at QoS 1, packetId: 2
Publishing at QoS 2, packetId: 3
************************************************
Subscribe acknowledged.
packetId: 1
qos: 2
Publish received.
topic: async-mqtt/STM32_Pub
message: STM32 Test3
qos: 2
dup: 0
retain: 1
len: 11
index: 0
total: 11
Publish acknowledged.
packetId: 2
Publish received.
topic: async-mqtt/STM32_Pub
message: STM32 Test1
qos: 0
dup: 0
retain: 0
len: 11
index: 0
total: 11
Publish received.
topic: async-mqtt/STM32_Pub
message: STM32 Test2
qos: 1
dup: 0
retain: 0
len: 11
index: 0
total: 11
Publish received.
topic: async-mqtt/STM32_Pub
message: STM32 Test3
qos: 2
dup: 0
retain: 0
len: 11
index: 0
total: 11
Publish acknowledged.
packetId: 3
Ethernet disconnected <==== Test disconnect Ethernet very short time
Ethernet reconnected.
Ethernet disconnected <==== Test disconnect Ethernet long enough time to force MQTT disconnection
Ethernet reconnected.
Disconnected from MQTT. <==== MQTT disconnected and reconnected
Connected to MQTT broker: broker.emqx.io, port: 1883
PubTopic: async-mqtt/STM32_Pub
************************************************
Session present: 0
Subscribing at QoS 2, packetId: 4
Publishing at QoS 0
Publishing at QoS 1, packetId: 5
Publishing at QoS 2, packetId: 6
************************************************
Subscribe acknowledged.
packetId: 4
qos: 2
Publish received.
topic: async-mqtt/STM32_Pub
message: STM32 Test3
qos: 2
dup: 0
retain: 1
len: 11
index: 0
total: 11
Publish acknowledged.
packetId: 5
Publish received.
topic: async-mqtt/STM32_Pub
message: STM32 Test1
qos: 0
dup: 0
retain: 0
len: 11
index: 0
total: 11
Publish received.
topic: async-mqtt/STM32_Pub
message: STM32 Test2
qos: 1
dup: 0
retain: 0
len: 11
index: 0
total: 11
Publish received.
topic: async-mqtt/STM32_Pub
message: STM32 Test3
qos: 2
dup: 0
retain: 0
len: 11
index: 0
total: 11
Publish acknowledged.
packetId: 6