Hello!
I am trying to create a project where I connect my EC25-EUX modem (I have the modem attached to the MINI PCIe EVB kit) to a mosquitto broker and publish data in a specific topic. I am new to these kind of projects and I am having problems to carry it out.
I have been following different documents where the example’s steps are explained (https://sixfab.com/wp-content/uploads/2020/08/Quectel_EC2xEG9xEM05_MQTT_Application_Note_V1.1.pdf) but when I reach the step of connecting to a MQTT server I always receive an error.
Before I begin with the steps of the application note I configure the TCP/IP communication of the modem.
The steps I follow are:
- Connect my evaluation board to QNavigator and connect the module (it does an automatic initialization). I connect the board to Quectel USB AT Port.
- Configure a Context:
AT+QICSGP=1,1,“(myAPN)”,“”,“”,0
→ OK - Activate the context:
AT+QIACT=1
→ OK - Make sure the context I have configured is open:
AT+QIACT?
→ 1,1,1,“10.64.75.67” - Open a socket in buffer mode:
AT+QIOPEN=1,0,“TCP”,“137.135.82.217”,1883,0,0
→ OK
NOTE: to know the mosquitto broker’s IP I do ping to the host mqtt.eclipseprojects.io and I can see the server’s IP.
- Configure MQTT receiving mode:
AT+QMTCFG=“recv/mode”,0,0,1
→ OK - Open a network for MQTT client:
AT+QMTOPEN=0,“137.135.82.217”,1883
→ OK
→ 0,-1 (Error code: Failed to open network)
I have tried opening also with the url instead of the IP (mqtt.eclipseprojects. io) but I get the same URC message.
If someone can please help me, I have tried all the possible examples but I never get to connect to the mosquitto broker. Thank you!
I’ll leave the first automatic initialization here if it’s useful:
/* Start AT SYNC: Send AT every 500ms, if receive OK, SYNC success, if no OK return after sending AT 10 times, SYNC fail */
[2023-10-30 08:53:45:419_S:] AT
[2023-10-30 08:53:45:486_R:] AT
[2023-10-30 08:53:45:486_R:] OK
[2023-10-30 08:53:45:488_S:] ATI
[2023-10-30 08:53:45:551_R:] ATI
[2023-10-30 08:53:45:551_R:] Quectel
[2023-10-30 08:53:45:551_R:] EC25
[2023-10-30 08:53:45:551_R:] Revision: EC25EUXGAR08A09M1G
[2023-10-30 08:53:45:551_R:] OK
[2023-10-30 08:53:45:569_S:] ATI
[2023-10-30 08:53:45:635_R:] ATI
[2023-10-30 08:53:45:635_R:] Quectel
[2023-10-30 08:53:45:635_R:] EC25
[2023-10-30 08:53:45:635_R:] Revision: EC25EUXGAR08A09M1G
[2023-10-30 08:53:45:635_R:] OK
/* Use ATV1 to set the response format */
[2023-10-30 08:53:45:654_S:] ATV1
[2023-10-30 08:53:45:719_R:] ATV1
[2023-10-30 08:53:45:719_R:] OK
/* Use ATE1 to enable echo mode */
[2023-10-30 08:53:45:969_S:] ATE1
[2023-10-30 08:53:46:034_R:] ATE1
[2023-10-30 08:53:46:034_R:] OK
/* Use AT+CMEE=2 to enable result code and use verbose values */
[2023-10-30 08:53:46:187_S:] AT+CMEE=2
[2023-10-30 08:53:46:253_R:] AT+CMEE=2
[2023-10-30 08:53:46:253_R:] OK
/* Get the baudrate, if the value is 0 (auto baudrate), then it will be set to 115200 (fixed baudrate) to assure reliable communication and avoid any problems caused by undetermined baudrate between DCE and DTE, value of IPR should be saved with AT&W */
[2023-10-30 08:53:46:515_S:] AT+IPR?
[2023-10-30 08:53:46:569_R:] AT+IPR?
[2023-10-30 08:53:46:569_R:] +IPR: 115200
[2023-10-30 08:53:46:569_R:] OK
/* Use ATI to get module information of Manufacturer ID, Device module and Firmware version */
[2023-10-30 08:53:46:635_S:] ATI
[2023-10-30 08:53:46:701_R:] ATI
[2023-10-30 08:53:46:701_R:] Quectel
[2023-10-30 08:53:46:701_R:] EC25
[2023-10-30 08:53:46:701_R:] Revision: EC25EUXGAR08A09M1G
[2023-10-30 08:53:46:701_R:] OK
/* Use AT+GSN to query the IMEI of module */
[2023-10-30 08:53:46:818_S:] AT+GSN
[2023-10-30 08:53:46:873_R:] AT+GSN
[2023-10-30 08:53:46:873_R:] 862506047432318
[2023-10-30 08:53:46:873_R:] OK
[2023-10-30 08:53:46:875_S:] AT+QURCCFG=“URCPORT”,“usbmodem”
[2023-10-30 08:53:46:933_R:] AT+QURCCFG=“URCPORT”,“usbmodem”
[2023-10-30 08:53:46:933_R:] OK
/* Use AT+CPIN? to query the SIM card status : SIM card inserted or not, locked or unlocked */
[2023-10-30 08:53:47:478_S:] AT+CPIN?
[2023-10-30 08:53:47:543_R:] AT+CPIN?
[2023-10-30 08:53:47:543_R:] +CPIN: READY
[2023-10-30 08:53:47:543_R:] OK
/* Use AT+CIMI to query the IMSI of SIM card */
[2023-10-30 08:53:47:672_S:] AT+CIMI
[2023-10-30 08:53:47:729_R:] AT+CIMI
[2023-10-30 08:53:47:729_R:] 204043253335437
[2023-10-30 08:53:47:729_R:] OK
/* Use AT+QCCID to query ICCID number of SIM card */
[2023-10-30 08:53:47:905_S:] AT+QCCID
[2023-10-30 08:53:47:968_R:] AT+QCCID
[2023-10-30 08:53:47:968_R:] +QCCID: 89314404000106191548
[2023-10-30 08:53:47:968_R:] OK
/* Use AT+CSQ to query current signal quality */
[2023-10-30 08:53:48:023_S:] AT+CSQ
[2023-10-30 08:53:48:084_R:] AT+CSQ
[2023-10-30 08:53:48:084_R:] +CSQ: 23,99
[2023-10-30 08:53:48:084_R:] OK
/* Use AT+CREG? /AT+CGREG? to query the network registration status. */
[2023-10-30 08:53:48:093_S:] AT+CREG?
[2023-10-30 08:53:48:151_R:] AT+CREG?
[2023-10-30 08:53:48:151_R:] +CREG: 0,5
[2023-10-30 08:53:48:151_R:] OK
[2023-10-30 08:53:48:174_S:] AT+CGREG?
[2023-10-30 08:53:48:234_R:] AT+CGREG?
[2023-10-30 08:53:48:234_R:] +CGREG: 0,5
[2023-10-30 08:53:48:234_R:] OK
/* Use AT+COPS? to query current Network Operator */
[2023-10-30 08:53:48:281_S:] AT+COPS?
[2023-10-30 08:53:48:336_R:] AT+COPS?
[2023-10-30 08:53:48:336_R:] +COPS: 0,0,“vodafone ES DATA ONLY”,7
[2023-10-30 08:53:48:336_R:] OK
/Use AT+CEREG? to query current EPS Network Registration Status/
[2023-10-30 08:53:48:394_S:] AT+CEREG?
[2023-10-30 08:53:48:465_R:] AT+CEREG?
[2023-10-30 08:53:48:465_R:] +CEREG: 0,5
[2023-10-30 08:53:48:465_R:] OK
[2023-10-30 08:53:48:501_S:] AT+CLVL=?
[2023-10-30 08:53:48:576_R:] AT+CLVL=?
[2023-10-30 08:53:48:576_R:] +CLVL: (0-5)
[2023-10-30 08:53:48:576_R:] OK
[2023-10-30 08:57:51:262_S:] AT+QICSGP=1
[2023-10-30 08:57:51:340_R:] AT+QICSGP=1
[2023-10-30 08:57:51:340_R:] +QICSGP: 1,“orom2m.vf.es”,“”,“”,0
[2023-10-30 08:57:51:340_R:] OK
[2023-10-30 09:00:39:699_S:] AT+QICSGP=1
/* Start AT SYNC: Send AT every 500ms, if receive OK, SYNC success, if no OK return after sending AT 10 times, SYNC fail */
[2023-10-30 09:01:21:009_S:] AT
[2023-10-30 09:01:21:078_R:] AT
[2023-10-30 09:01:21:078_R:] OK
[2023-10-30 09:01:21:084_S:] ATI
[2023-10-30 09:01:21:162_R:] ATI
[2023-10-30 09:01:21:162_R:] Quectel
[2023-10-30 09:01:21:162_R:] EC25
[2023-10-30 09:01:21:162_R:] Revision: EC25EUXGAR08A09M1G
[2023-10-30 09:01:21:162_R:] OK
[2023-10-30 09:01:21:178_S:] ATI
[2023-10-30 09:01:21:240_R:] ATI
[2023-10-30 09:01:21:240_R:] Quectel
[2023-10-30 09:01:21:240_R:] EC25
[2023-10-30 09:01:21:240_R:] Revision: EC25EUXGAR08A09M1G
[2023-10-30 09:01:21:240_R:] OK
/* Use ATV1 to set the response format */
[2023-10-30 09:01:21:262_S:] ATV1
[2023-10-30 09:01:21:325_R:] ATV1
[2023-10-30 09:01:21:325_R:] OK
/* Use ATE1 to enable echo mode */
[2023-10-30 09:01:21:579_S:] ATE1
[2023-10-30 09:01:21:641_R:] ATE1
[2023-10-30 09:01:21:641_R:] OK
/* Use AT+CMEE=2 to enable result code and use verbose values */
[2023-10-30 09:01:21:795_S:] AT+CMEE=2
[2023-10-30 09:01:21:864_R:] AT+CMEE=2
[2023-10-30 09:01:21:864_R:] OK
/* Get the baudrate, if the value is 0 (auto baudrate), then it will be set to 115200 (fixed baudrate) to assure reliable communication and avoid any problems caused by undetermined baudrate between DCE and DTE, value of IPR should be saved with AT&W */
[2023-10-30 09:01:22:111_S:] AT+IPR?
[2023-10-30 09:01:22:180_R:] AT+IPR?
[2023-10-30 09:01:22:180_R:] +IPR: 115200
[2023-10-30 09:01:22:180_R:] OK
/* Use ATI to get module information of Manufacturer ID, Device module and Firmware version */
[2023-10-30 09:01:22:227_S:] ATI
[2023-10-30 09:01:22:311_R:] ATI
[2023-10-30 09:01:22:311_R:] Quectel
[2023-10-30 09:01:22:311_R:] EC25
[2023-10-30 09:01:22:311_R:] Revision: EC25EUXGAR08A09M1G
[2023-10-30 09:01:22:311_R:] OK
/* Use AT+GSN to query the IMEI of module */
[2023-10-30 09:01:22:427_S:] AT+GSN
[2023-10-30 09:01:22:499_R:] AT+GSN
[2023-10-30 09:01:22:499_R:] 862506047432318
[2023-10-30 09:01:22:499_R:] OK
[2023-10-30 09:01:22:499_S:] AT+QURCCFG=“URCPORT”,“usbat”
[2023-10-30 09:01:22:565_R:] AT+QURCCFG=“URCPORT”,“usbat”
[2023-10-30 09:01:22:565_R:] OK
/* Use AT+CPIN? to query the SIM card status : SIM card inserted or not, locked or unlocked */
[2023-10-30 09:01:23:087_S:] AT+CPIN?
[2023-10-30 09:01:23:149_R:] AT+CPIN?
[2023-10-30 09:01:23:149_R:] +CPIN: READY
[2023-10-30 09:01:23:149_R:] OK
/* Use AT+CIMI to query the IMSI of SIM card */
[2023-10-30 09:01:23:281_S:] AT+CIMI
[2023-10-30 09:01:23:350_R:] AT+CIMI
[2023-10-30 09:01:23:350_R:] 204043253335437
[2023-10-30 09:01:23:350_R:] OK
/* Use AT+QCCID to query ICCID number of SIM card */
[2023-10-30 09:01:23:512_S:] AT+QCCID
[2023-10-30 09:01:23:581_R:] AT+QCCID
[2023-10-30 09:01:23:581_R:] +QCCID: 89314404000106191548
[2023-10-30 09:01:23:581_R:] OK
/* Use AT+CSQ to query current signal quality */
[2023-10-30 09:01:23:632_S:] AT+CSQ
[2023-10-30 09:01:23:697_R:] AT+CSQ
[2023-10-30 09:01:23:697_R:] +CSQ: 23,99
[2023-10-30 09:01:23:697_R:] OK
/* Use AT+CREG? /AT+CGREG? to query the network registration status. */
[2023-10-30 09:01:23:697_S:] AT+CREG?
[2023-10-30 09:01:23:766_R:] AT+CREG?
[2023-10-30 09:01:23:766_R:] +CREG: 0,5
[2023-10-30 09:01:23:766_R:] OK
[2023-10-30 09:01:23:781_S:] AT+CGREG?
[2023-10-30 09:01:23:844_R:] AT+CGREG?
[2023-10-30 09:01:23:844_R:] +CGREG: 0,5
[2023-10-30 09:01:23:844_R:] OK
/* Use AT+COPS? to query current Network Operator */
[2023-10-30 09:01:23:897_S:] AT+COPS?
[2023-10-30 09:01:23:966_R:] AT+COPS?
[2023-10-30 09:01:23:966_R:] +COPS: 0,0,“vodafone ES DATA ONLY”,7
[2023-10-30 09:01:23:966_R:] OK
/Use AT+CEREG? to query current EPS Network Registration Status/
[2023-10-30 09:01:24:012_S:] AT+CEREG?
[2023-10-30 09:01:24:081_R:] AT+CEREG?
[2023-10-30 09:01:24:081_R:] +CEREG: 0,5
[2023-10-30 09:01:24:081_R:] OK