MQTT Subscribe and Unsubscribe using Simcom modules
Simcom SIM7XXX modules has support for the MQTT feature using the AT Commands.
To subscribe to a topic with Simcom modules,
- Connect to the MQTT browser
- Subscribe to a topic using the AT+SMSUB command.
- Unsubscribe from a topic using the AT+UNSUB command.
Related Topics
- How MQTT works?
- MQTT – Connect to Broker
- MQTT Publish
- MQTT Subscribe
Try AT Command Tester tool to test MQTT features with the Simcom Modules. In below example,
- With one instance of the AT Command Tester tool, a MQTT connection is established to ‘test.mosquitto.org’ server using the Simcom SIM7080G module.
- With another instance of the AT Command Tester tool, a MQTT connection is established to ‘test.mosquitto.org’ using the PC client.
- The MQTT PC client publishes to the topic ‘SensorReadings’.
- The Simcom MQTT client is subscribed to the topic ‘SensorReadings’ and so receives the data published by the PC MQTT client.