You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have used SIM808 GPS/GSM Module, Adafruit_FONA library and, MQTT publish function.
MQTT connection established but, there is an error in publishing data.
#elif defined(PROTOCOL_MQTT_MYSIGNAL) const char* MQTT_SERVER = "test.mosquitto.org"; const char* MQTT_SERVERPORT = 1883; // Connect to MQTT broker if (!fona.TCPconnect(MQTT_SERVER, MQTT_SERVERPORT)) Serial.println(F("Failed to connect to TCP/IP!")); if (!fona.MQTTconnect("MQTT","","","")) Serial.println(F("Failed to connect to MQTT broker!")); if (!fona.MQTTpublish("MyTopic", "Mydata")) Serial.println(F("Failed to publish data!"));
Can you please suggest a way to solve it out with an example.
Thanks!!
The text was updated successfully, but these errors were encountered:
Hello,
I have used SIM808 GPS/GSM Module, Adafruit_FONA library and, MQTT publish function.
MQTT connection established but, there is an error in publishing data.
Serial Monitor view:
AT+CIPSTART="TCP","test.mosquitto.org","1883"
<--- OK
<--- CONNECT OK
<--- >
---> 84 84 3 194 0 15 0 7 68 101 118 105 99 101 49 0 36 97 116 111 122 105 111 116 38 115 101 61 49 53 53 56 53 48 51 57 50 50 38 115 107 110 61 105 111 116 104 117 98 111 119 110 101 114 164
<--- SEND OK
Publishing GPS data: Mydata
<--- ERROR
Failed to publish data!
---> AT+CIPCLOSE
<--- CLOSE OK
Code is like this,
#elif defined(PROTOCOL_MQTT_MYSIGNAL) const char* MQTT_SERVER = "test.mosquitto.org"; const char* MQTT_SERVERPORT = 1883; // Connect to MQTT broker if (!fona.TCPconnect(MQTT_SERVER, MQTT_SERVERPORT)) Serial.println(F("Failed to connect to TCP/IP!")); if (!fona.MQTTconnect("MQTT","","","")) Serial.println(F("Failed to connect to MQTT broker!")); if (!fona.MQTTpublish("MyTopic", "Mydata")) Serial.println(F("Failed to publish data!"));
Can you please suggest a way to solve it out with an example.
Thanks!!
The text was updated successfully, but these errors were encountered: