DTLS handshake failure BG77

Hello, I am trying to get CoAP working via DTLS using example 5.2 in datasheet Quectel_BG95BG77BG600L_Series_CoAP_Application_Note_V1.0. When I try to handshake I get the error “DTLS handshaking failure” - according to the datasheet.

Module’s firmware: BG77LAR02A04_01.201.01.201

Here is the log:

[2024-01-22_11:57:50:584]at+cereg?

[2024-01-22_11:57:50:584]+CEREG: 0,5

[2024-01-22_11:57:50:584]OK
[2024-01-22_11:58:03:329]AT+QCOAPCFG="pdpcid",0,1 

[2024-01-22_11:58:03:329]OK
[2024-01-22_11:58:14:694]AT+QCOAPCFG="trans",0,4,5

[2024-01-22_11:58:14:694]OK
[2024-01-22_11:58:28:057]AT+QCOAPCFG="dtls",0,1,0

[2024-01-22_11:58:28:057]OK
[2024-01-22_11:58:33:291]AT+QSSLCFG="dtls",0,1

[2024-01-22_11:58:33:291]OK
[2024-01-22_11:58:38:064]AT+QSSLCFG="dtlsversion",0,1

[2024-01-22_11:58:38:064]OK
[2024-01-22_11:58:45:729]AT+QFUPL="UFS:0_server.psk",34

[2024-01-22_11:58:45:729]CONNECT
[2024-01-22_11:58:47:568]+QFUPL: 34,322e

[2024-01-22_11:58:47:568]OK
[2024-01-22_11:59:01:130]AT+QCOAPOPEN=0,"leshan.eclipseprojects.io",5684

[2024-01-22_11:59:01:130]OK
[2024-01-22_11:59:02:479]
[2024-01-22_11:59:02:479]+QCOAPOPEN: 0,-9

If I don’t use DTLS, but only CoAP, there is no problem and I always connect successfully.

Does anyone know what could be causing this please?

Thank you in advance for the answer.

Hi @Robo

Have you checked this psk is vaild ? and please set SSL version as DTLS as well.

1 Like

Hi @Linkin-Q,

The issue has been resolved using the following set of commands:

[2024-02-02_11:41:36:991]AT+QFUPL="UFS:0_server.psk",34

[2024-02-02_11:41:36:991]CONNECT
[2024-02-02_11:41:37:823]+QFUPL: 34,322e

[2024-02-02_11:41:37:823]OK
[2024-02-02_11:41:48:487]AT+QCOAPCFG="pdpcid",0,1

[2024-02-02_11:41:48:487]OK
[2024-02-02_11:41:49:216]AT+QCOAPCFG="trans",0,4,5

[2024-02-02_11:41:49:216]OK
[2024-02-02_11:41:51:651]AT+QCOAPCFG="dtls",0,1,0

[2024-02-02_11:41:51:651]OK
[2024-02-02_11:41:53:642]AT+QSSLCFG="dtls",0,1

[2024-02-02_11:41:53:642]OK
[2024-02-02_11:41:55:344]AT+QSSLCFG="dtlsversion",0,1

[2024-02-02_11:41:55:344]OK
[2024-02-02_11:42:07:885]AT+QSSLCFG="ciphersuite",0,0XC0A8

[2024-02-02_11:42:07:885]OK
[2024-02-02_11:42:57:592]AT+QCOAPOPEN=0,"23.97.187.154",5684

[2024-02-02_11:42:57:592]OK
[2024-02-02_11:42:59:999]
[2024-02-02_11:42:59:999]+QCOAPOPEN: 0,0

Thank you for reaching out.

Best regards,
Robo