Hi guys,
I’m here again cause I cannot solve my problems regarding MQTT connection using Quectel modem bg95 m3.
Making it simple, my hardware setup is made of an st microcontroller (STM32U575) plus a BG95 M3 modem from quectel, communicating serially via UART port.
I’m attaching my main problem.
I want to test MQTT protocol for a project by publishing/subscribing some data over Mosquitto public MQTT server but I’m encountering a massive issue.
Up to the opening phase everything seems to be working fine but as soon as I try to run the QMTCONN command, the connection falls apart and the +QMTSTAT 0,1 message pops up.
To give you as much information as possible I’m pasting the code snippet and module response I get by taking a look at teraterm terminal.
CODE:
uint16_t rep;
if(checkService()!=0)
return 1;
REFRESH_IWDG; // refresh watchdog
HAL_Delay(200);
REFRESH_IWDG; // refresh watchdog
rep=LTE_FTP_SendCommand(LTE_QICSGP,NO_REQUEST, LTE_MAX_RESPONSE_TIME_QICSGP,RETRY_1);
myUartPrintf( "LTE_QICSGP %d\r\n",rep);
if (rep==ERROR_LTE)
return 2;
HAL_Delay(200);
rep=LTE_FTP_SendCommand(LTE_QIACT,NO_REQUEST, LTE_MAX_RESPONSE_TIME_QIACT,RETRY_1); // risponde solo con 0 o 4
myUartPrintf( "LTE_QIACT %d\r\n",rep);
if (rep==ERROR_LTE)
return 3;
HAL_Delay(200);
//open
uart_command("AT+QMTOPEN=0,\""IP_ADDRESS"\","PORT"\r");
HAL_Delay(1000);
//connect
uart_command("AT+QMTCONN=0,\""CLIENT_ID"\"\r");
HAL_Delay(1500);
//publish
mqtt_publish("epebbs/test2025","{\"InizioAnnoNuovo\":\"vai\"}");
HAL_Delay(2000);
Where :
LTE_QICSGP “AT+QICSGP=16,1,"inetd.it.vodafone.iot","","",0\r”
IP_ADDRESS “5.196.78.28”
CLIENT_ID “GUYS_EPEBBS”
PORT “1883”
RESPONSE:
+CREG: 0,5
Creg: 0,5 0
Creg: 5
+CEREG: 0,4
Cereg: 0,4 0
Cereg: 4
LTE_QICSGP 0
LTE_QIACT 0
+QMTOPEN: 0,0
+QMTSTAT: 0,1
Can someone help me out?
Thank you in advance!
Kindly
Elia