BG95 - M2 azure iot cloud connection using SAS token

Hello Everyone,
I am trying to connect Azure IoT cloud using MQTT with SAS token.
Here is log of my AT commnads. It always failed to open network either on 1883 or 8883.
Can anyone guide me what can be wrong. ?
Am i missing some configurations ?

AT+CREG?

+CREG: 1,5

OK
AT+CEREG?

+CEREG: 1,5

OK
AT+QNWINFO

+QNWINFO: “eMTC”,“26201”,“LTE BAND 3”,1300

OK
AT+QIACT?

+QIACT: 1,1,1,“100.97.24.4”

OK
AT+QMTCFG=“ssl”,0,1,2

OK
AT+QSSLCFG=“seclevel”,2,2

OK
AT+QSSLCFG=“sslversion”,2,4

OK
AT+QSSLCFG=“ciphersuite”,2,0XFFFF

OK
AT+QSSLCFG=“ignorelocaltime”,2,1

OK
AT+QMTOPEN=0,“BD.net”,1883

OK

+QMTOPEN: 0,-1
AT+QMTOPEN=0,“BD.net”,8883

OK

+QMTOPEN: 0,-1

Regards,
Bhavin

Hi Bhavin
You do not have the relevant authentication certificates (cacert, clientcert, clientkey) configured. You can upload the relevant certificates and try again. Related commands are as follows:

AT+QSSLCFG=“cacert”,< SSL_ctxID> [,

< cacertpath > ]

AT+QSSLCFG=“clientcert”,< SSL_ctxI

D> [,<clientcertpath>]

AT+QSSLCFG=“clientkey”,< SSL_ctxID

> [,<clientkeypath>]

If you don’t have a certificate, try AT+QSSLCFG= “seclevel”,2,0 ignore authentication.

BR
tabor

@tabor.tang-Q ,

Hi ,
i removed AT+QSSLCFG=“seclevel”,2,2 and tried to connect using SAS token.
It worked fine.
Thank you.

Hi @Dhola,

Were you able to connect to Azure without having to upload certificates?

I want to do the same thing (connect to Azure with SAS token), could you post the AT command sequence again?

Regards,
Thiago.

Hi @Thiago_Leite ,

Here is my at commnds sequence for BG95-M2 using vodafone easyconnect iot sim card to connect to azure iot using SAS token.
AT+CFUN=0
AT+QCFG=“nwscanseq”,0203,1
AT+QCFG=“iotopmode”,2,1
AT+QCFG=“band”,0,80084,80084
AT+CFUN=1
AT+CGDCONT=1,“IP”,“lpwa.vodafone.com
AT+CEREG=1
AT+CREG=1

AT+QSSLCFG=“sslversion”,2,4
AT+QSSLCFG=“ciphersuite”,2,0XFFFF
AT+QSSLCFG=“ignorelocaltime”,2,1
AT+QMTCFG=“ssl”,0,1,2
AT+QMTCFG=“version”,0,4

AT+QMTOPEN=0,“XXX.azure-devices.net”,8883

AT+QMTCONN=0,“ID2”,“XXX.azure-devices.net/ID2/?api-version=2021-04-12","SharedAccessSignature sr=XXX.azuredevices.net%2Fdevices%2FID2&sig=vO%2BI7nV8Me3deNYmZ74zqGOCrDSoTWMqMJ7SiZ%2BIsU%3D&se=1692885518”

AT+QMTPUB=0,1,1,0,“devices/ID2/messages/events/”