Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT Publish failed!! #96

Open
Bhavikjp opened this issue Jul 18, 2018 · 0 comments
Open

MQTT Publish failed!! #96

Bhavikjp opened this issue Jul 18, 2018 · 0 comments

Comments

@Bhavikjp
Copy link

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!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant