Closed Franciscopcosta closed 4 years ago
I'm asking the same question
Yes, there are some changes to be done in AT commands, otherwise should be working fine. But writing code directly to support MQTT in ESP8266 is the straightforward approach.
For all those getting stuck at MQTT.MessageFlag = true
when using software serial, ESP8266 or other platforms, change GSM_MQTT::processing
in GSM_MQTT.cpp
to
void GSM_MQTT::processing(void)
{
if (TCP_Flag == false)
{
MQTT_Flag = false;
_tcpInit();
}
_ping();
//**************new code*****************
unsigned long t = millis();
//add long waitPeriod = 0; somewhere at the beginning of the file
if (t - waitPeriod > 1000L)
{
waitPeriod = t;
serialEvent(); //call serialEvent every second
}
//*****************************************
}
Closing the issue as ESP8266 is offtopic and not intended as the target for this library
How can i adapt it to work with ESP8266?