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 Amasi3w 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
iamnarendrans3w 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 lady3w 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
More Posts
Installing Minimal Valgrind Components for Embedded Systems to Reduce Footprint@Middleware & OS Hey guys, In other for me to minimize my embedded system's footprint, can I instaFixing 'Missing Operator' Error in Batch Script for Renaming JPG Files on WindowsI'm trying to rename image files (JPGs) on a Windows machine. I want to add an incrementing number (Understanding Anonymous Inode 0 Entries in /proc/pid/maps for Memory Usage in Embedded LinuxI'm investigating memory usage in my embedded Linux application using `/proc/pid/maps`. I'm confusedHow to Correctly Calibrate a Load Cell Using HX711 Library for Accurate Weight Measurements?Hello everyone, I am trying to calibrate a load cell to obtain the correct weight. I followed the inDIY haptic SmartKnob: BLDC motor + round LCDThis innovative input device, SmartKnob, is an **open-source** input device with software-configurabHow to Implement OTA Updates for ESP32 with FreeRTOS on Google Cloud IoT Core?@Middleware & OS Hello guys am interested in `over the air` (OTA) firmware update of an ESP32 microHow to Identify and Resolve Latency Spikes in a Linux GPIO Application Using Preempt_rt Kernel PatchHi guys, during a discussion yesterday, my colleague and I were exploring ways to detect and solve lAre there alternatives to system() that might be more performant for CGI scripts on embedded Linux?I'm facing a performance issue with the system() call in C on my embedded Linux system. The command What exactly do inner and outer cache policies refer to?Hey guys @Middleware & OS I am trying to develop my own RTOS kernel for a Cortex-M7 STM32F746 DiscoDeveloping a smart thermostat device using Android Things OS@Middleware & OS Hey guys, I'm developing a smart thermostat device using Android Things OS. I woul