Does anybody worked on Quectel EC200 series SIM module for establishing an MQTT connection to cloud

AT+QMTCONN=0,"deployment-fc9b6ee2","chara","chara" OK +QMTCONN: 0,1 +QMTSTAT: 0,3 I'm getting the error like the above, but Ideally the response should be +QMTCONN:0,0,0
Solution:
```cpp #include <PubSubClient.h> #include <QuectelMQTT.h> const char* mqtt_server = "your_mqtt_server";...
Jump to solution
3 Replies
Marvee Amasi
Marvee Amasi7mo ago
I have not tried this before , but it will be helpful to check out the Quectel EC200 series AT commands documentation for detailed explanations of the +QMTCONN and +QMTSTAT responses, particularly error codes like "3" so you can find specific troubleshooting steps for this particular error code
iamnarendrans
iamnarendrans7mo ago
I've checked man, based upon the input, I made changes, even though, it is giving the same error. If someone have any example code, it will be really helpful for me
Solution
Boss lady
Boss lady7mo ago
#include <PubSubClient.h>
#include <QuectelMQTT.h>

const char* mqtt_server = "your_mqtt_server";
const int mqtt_port = 1883;
const char* mqtt_username = "your_username";
const char* mqtt_password = "your_password";
const char* mqtt_topic = "your_topic";

QuectelMQTT quectel_mqtt("your_apn", "your_username", "your_password", "your_simcard_pin");
WiFiClient espClient;
PubSubClient client(espClient);

void setup() {
quectel_mqtt.PowerOn(); // Power on the Quectel module
quectel_mqtt.InitializeGPRS(); // Initialize GPRS connection

Serial.begin(115200);
delay(100);

WiFi.begin("your_ssid", "your_password"); // Connect to WiFi network

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}

Serial.println("");
Serial.println("WiFi connected");

quectel_mqtt.InitializeMQTT(client, mqtt_server, mqtt_port, mqtt_username, mqtt_password); // Initialize MQTT connection
quectel_mqtt.ConnectMQTT(client);
}
client.loop();

// Publish a message to the MQTT broker
char message[50];
snprintf(message, 50, "Hello from Quectel SIM module!");
client.publish(mqtt_topic, message);

delay(5000); // Publish message every 5 seconds
}
#include <PubSubClient.h>
#include <QuectelMQTT.h>

const char* mqtt_server = "your_mqtt_server";
const int mqtt_port = 1883;
const char* mqtt_username = "your_username";
const char* mqtt_password = "your_password";
const char* mqtt_topic = "your_topic";

QuectelMQTT quectel_mqtt("your_apn", "your_username", "your_password", "your_simcard_pin");
WiFiClient espClient;
PubSubClient client(espClient);

void setup() {
quectel_mqtt.PowerOn(); // Power on the Quectel module
quectel_mqtt.InitializeGPRS(); // Initialize GPRS connection

Serial.begin(115200);
delay(100);

WiFi.begin("your_ssid", "your_password"); // Connect to WiFi network

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}

Serial.println("");
Serial.println("WiFi connected");

quectel_mqtt.InitializeMQTT(client, mqtt_server, mqtt_port, mqtt_username, mqtt_password); // Initialize MQTT connection
quectel_mqtt.ConnectMQTT(client);
}
client.loop();

// Publish a message to the MQTT broker
char message[50];
snprintf(message, 50, "Hello from Quectel SIM module!");
client.publish(mqtt_topic, message);

delay(5000); // Publish message every 5 seconds
}
Hope this helps
Want results from more Discord servers?
Add your server