Failed to connect -22

Description

I’m trying out the certificate example on the 9160. I think I have everything setup correctly but I keep getting this -22 error. Here is the startup log.

[00:00:00.636,688] littlefs: littlefs partition at /lfs1
[00:00:00.636,749] littlefs: LittleFS version 2.9, disk version 2.1
[00:00:00.636,932] littlefs: FS at flash-controller@39000:0xf0000 is 6 0x1000-byte blocks with 512 cycle
[00:00:00.636,932] littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
[00:00:00.637,786] littlefs: Automount /lfs1 succeeded
*** Booting nRF Connect SDK v2.9.1-60d0d6c8d42d ***
*** Using Zephyr OS v3.7.99-ca954a6216c9 ***
*** Golioth Firmware SDK v0.19.1 ***
[00:00:00.645,690] cert_provisioning: main: Start certificate provisioning sample
[00:00:00.645,721] golioth_samples: Bringing up network interface
[00:00:00.645,721] golioth_samples: Waiting to obtain IP address
[00:00:11.615,966] lte_monitor: Network: Searching
[00:00:11.761,291] lte_lc: Registration rejected, EMM cause: 11, Cell ID: 199267087, Tracking area: 9879, LTE mode: 7
[00:00:19.990,875] lte_lc: Registration rejected, EMM cause: 19, Cell ID: 36529173, Tracking area: 31518, LTE mode: 7
[00:00:28.830,383] lte_monitor: Network: Registered (roaming)
[00:00:28.832,244] cert_provisioning: Read 399 bytes from /lfs1/credentials/crt.der
[00:00:28.834,014] cert_provisioning: Read 399 bytes from /lfs1/credentials/key.der
[00:00:28.834,594] golioth_mbox: Mbox created, bufsize: 1320, num_items: 10, item_size: 120
[00:00:29.050,659] golioth_coap_client_zephyr: Failed to connect to socket: -22
[00:00:29.051,574] golioth_coap_client_zephyr: Failed to connect: -22
[00:00:29.051,574] golioth_coap_client_zephyr: Failed to connect: -22

Expected Behavior

Connect to Golioth

Actual Behavior

No connection.

Environment

9160

Logs and Console Output

[00:00:00.636,688] littlefs: littlefs partition at /lfs1
[00:00:00.636,749] littlefs: LittleFS version 2.9, disk version 2.1
[00:00:00.636,932] littlefs: FS at flash-controller@39000:0xf0000 is 6 0x1000-byte blocks with 512 cycle
[00:00:00.636,932] littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
[00:00:00.637,786] littlefs: Automount /lfs1 succeeded
*** Booting nRF Connect SDK v2.9.1-60d0d6c8d42d ***
*** Using Zephyr OS v3.7.99-ca954a6216c9 ***
*** Golioth Firmware SDK v0.19.1 ***
[00:00:00.645,690] cert_provisioning: main: Start certificate provisioning sample
[00:00:00.645,721] golioth_samples: Bringing up network interface
[00:00:00.645,721] golioth_samples: Waiting to obtain IP address
[00:00:11.615,966] lte_monitor: Network: Searching
[00:00:11.761,291] lte_lc: Registration rejected, EMM cause: 11, Cell ID: 199267087, Tracking area: 9879, LTE mode: 7
[00:00:19.990,875] lte_lc: Registration rejected, EMM cause: 19, Cell ID: 36529173, Tracking area: 31518, LTE mode: 7
[00:00:28.830,383] lte_monitor: Network: Registered (roaming)
[00:00:28.832,244] cert_provisioning: Read 399 bytes from /lfs1/credentials/crt.der
[00:00:28.834,014] cert_provisioning: Read 399 bytes from /lfs1/credentials/key.der
[00:00:28.834,594] golioth_mbox: Mbox created, bufsize: 1320, num_items: 10, item_size: 120
[00:00:29.050,659] golioth_coap_client_zephyr: Failed to connect to socket: -22
[00:00:29.051,574] golioth_coap_client_zephyr: Failed to connect: -22
[00:00:29.051,574] golioth_coap_client_zephyr: Failed to connect: -22

Hi @wischmi2. Can you double check that you’ve uploaded the correct files for the certificate and the private key? It would be unusual for them to be the exact same size:

[00:00:28.832,244] cert_provisioning: Read 399 bytes from /lfs1/credentials/crt.der
[00:00:28.834,014] cert_provisioning: Read 399 bytes from /lfs1/credentials/key.der

Yes, that was it. Thanks!

1 Like