Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handshake error when running demo example for nRF7002 DK #7

Open
hcd-bdltd opened this issue Nov 30, 2023 · 5 comments
Open

handshake error when running demo example for nRF7002 DK #7

hcd-bdltd opened this issue Nov 30, 2023 · 5 comments

Comments

@hcd-bdltd
Copy link

Currently, the demo version is not working for the board nrf7002dk_nrf5340_cpuapp at version 23.11.

Steps to reproduce:

git clone [email protected]:AVSystem/Anjay-zephyr-client.git
cd Anjay-zephyr-client/demo
west init -l .
west config manifest.path demo
west config manifest.file west-nrf.yml
west update -o=--depth=1 -n
west build -p always -b nrf7002dk_nrf5340_cpuapp
west flash --erase
minicom -D /dev/ttyACM1
anjay stop
anjay config set wifi_ssid 'SSID'
anjay config set wifi_password 'PSSWD'
anjay start

Result:

Attempt to start Anjay
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
Anjay started
[00:01:04.525,665] <inf> anjay_zephyr_lwm2m: Saving config
[00:01:04.529,266] <inf> anjay_zephyr_config: Configuration successfully saved
[00:01:04.529,266] <inf> anjay_zephyr_lwm2m: Starting Anjay
[00:01:04.530,181] <inf> anjay_zephyr_lwm2m: Connecting to the network...
[00:01:10.786,651] <inf> net_dhcpv4: Received: 192.168.1.110
[00:01:10.787,719] <inf> anjay_zephyr_lwm2m: Connected to network
[00:01:11.010,101] <inf> anjay_zephyr_lwm2m: Time synchronized
[00:01:11.010,162] <inf> anjay: [anjay] Initializing Anjay 3.6.1
[00:01:11.012,176] <inf> anjay: [anjay_dm] successfully registered object /0
[00:01:11.012,298] <inf> anjay: [anjay_dm] successfully registered object /1
[00:01:11.012,359] <inf> anjay: [anjay_dm] successfully registered object /3
[00:01:11.012,481] <inf> anjay: [anjay_dm] successfully registered object /3347
[00:01:11.012,756] <inf> anjay: [anjay_dm] successfully registered object /3311
[00:01:11.013,000] <inf> anjay: [security] Added instance 0 (SSID: 1, URI: coaps://eu.iot.avsystem.cloud:5684)
[00:01:11.013,153] <inf> anjay: [server] Added instance 0 (SSID: 1)
[00:01:11.013,214] <inf> anjay_zephyr_lwm2m: Successfully created thread
[00:01:11.013,214] <inf> anjay_zephyr_lwm2m: Anjay is now online on bearer 0
[00:01:11.014,282] <inf> anjay: [anjay] servers reloaded
[00:01:11.014,770] <inf> anjay: [anjay] server /0/0: transport change: (none) -> U (uri: coaps://eu.iot.avsystem.cloud:5684)
[00:01:11.172,607] <wrn> anjay: [avs_net] Could not restore session; performing full handshake
[00:01:11.172,637] <err> anjay: [avs_net] handshake failed: -60
[00:01:11.176,910] <err> anjay: [anjay] could not connect to eu.iot.avsystem.cloud:5684
[00:01:11.177,612] <inf> anjay: [anjay] servers reloaded

Expected (same as version 23.09.1):

[00:00:09.763,275] <inf> anjay: [anjay] Register sent
[00:00:12.726,470] <wrn> anjay: [anjay] server responded with 4.00 Bad Request (expected 2.01 Created)
[00:00:12.726,470] <wrn> anjay: [anjay] could not register to server 1
[00:00:12.731,414] <inf> anjay: [anjay] servers reloaded
@Kucmasz
Copy link
Contributor

Kucmasz commented Dec 2, 2023

Hi!
Thanks for the notice and your question. Anjay Zephyr Client relies in cryptography on MbedTLS library that is provided with nRF Connect SDK, which was upgraded with the last release. A difference in behavior on the DTLS Handshake level is probably caused by changes in default MbedTLS configuration if all the other aspects (client and server security configuration). We did not observe such behavior so far, so I need to ask you for patience while we investigate the possible causes of that.

@hcd-bdltd
Copy link
Author

Hello @Kucmasz, any update on this issue? Is there any way I can help with?

@Kucmasz
Copy link
Contributor

Kucmasz commented Jan 7, 2024

Hi! Sorry for the lack of response, we managed to dive into this matter just this week. Seems like there is a conflict in Kconfig and MbedTLS configuration settings being at the same time required by Anjay library and selected by nRF library for Wi-Fi connection management, WPA supplicant more precisely. We have reached out to Nordic for support and advice in workaround or a patch. Unfortunatelly at this point I can't provide you with a solution other that disabling security in Wi-Fi network or Anjay (not sure if that is entirely possible through menuconfig, I can check that tomorrow for you or you can experiment on your own). Maybe @JZimnol could be of more help as he was conducting the investigation.

@JZimnol
Copy link
Member

JZimnol commented Jan 7, 2024

Hi! As @Kucmasz stated, we've reached out to Nordic (Zephyr's Discord to be more presise) for support, unfortunately we have not received any response yet.. We'll keep you updated on that.

@hcd-bdltd
Copy link
Author

No worries, thanks for the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants