mirror of
				https://github.com/KevinMidboe/TinyGSM.git
				synced 2025-10-29 18:00:18 +00:00 
			
		
		
		
	Add MQTT Auth example
This commit is contained in:
		| @@ -121,7 +121,14 @@ void setup() { | |||||||
| boolean mqttConnect() { | boolean mqttConnect() { | ||||||
|   SerialMon.print("Connecting to "); |   SerialMon.print("Connecting to "); | ||||||
|   SerialMon.print(broker); |   SerialMon.print(broker); | ||||||
|   if (!mqtt.connect("GsmClientTest")) { |  | ||||||
|  |   // Connect to MQTT Broker | ||||||
|  |   boolean status = mqtt.connect("GsmClientTest"); | ||||||
|  |  | ||||||
|  |   // Or, if you want to authenticate MQTT: | ||||||
|  |   //boolean status = mqtt.connect("GsmClientName", "mqtt_user", "mqtt_pass"); | ||||||
|  |  | ||||||
|  |   if (status == false) { | ||||||
|     SerialMon.println(" fail"); |     SerialMon.println(" fail"); | ||||||
|     return false; |     return false; | ||||||
|   } |   } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user