golioth / reference-design-template

Template for making new Golioth Reference Design repositories
Apache License 2.0
17 stars 5 forks source link

New SDK prints errors continuously when PSK and PSK-ID are not configured #91

Closed jstuewe23 closed 7 months ago

jstuewe23 commented 7 months ago

With the new firmware SDK the console sends a continuous stream (40 messages\minute) of COAP error messages. These messages make it distracting to try and enter them using the console settings feature. There is also no indication what the problem is for novice users.

[00:12:32.572,113] <err> app_sensors: Failed to send sensor data to Golioth: 10
[00:12:37.176,910] <err> golioth_coap_client_zephyr: Failed to send empty CoAP message: -22
[00:12:37.177,276] <err> golioth_coap_client_zephyr: Failed to connect: -22
[00:12:37.177,307] <wrn> golioth_coap_client_zephyr: Failed to connect: -22
[00:12:42.193,237] <err> golioth_coap_client_zephyr: Failed to send empty CoAP message: -22
[00:12:42.193,603] <err> golioth_coap_client_zephyr: Failed to connect: -22
[00:12:42.193,634] <wrn> golioth_coap_client_zephyr: Failed to connect: -22

Please add a check for PSK\PSK-ID and send a message requesting that they be set if they are empty. The program should probably halt as well vs. continuing to print error messages.

szczys commented 7 months ago

Hi John,

This is expected behavior for all of our samples that use runtime credentials.

If you would like to change that behavior, you can check the struct values in between golioth_sample_credentials_get() and passing the configuration to golioth_client_create()

https://github.com/golioth/reference-design-template/blob/8f7d4bee782ae1762c8d1d721453c0da7d02e79f/src/main.c#L74-L77

jstuewe23 commented 6 months ago

It may be expected behavior, but it's not a good user experience. Please consider this for future revisions of the template.