System hangs calling golioth_client_stop(client)

In Zephyr SDK 0.7.1 I called golioth_system_client_stop(client) and it worked properly.
Porting to Software SDK 0.11.1 (west-ncs.yml) the call is now golioth_client_stop(client) and my system will hang until the WDT resets it whenever I call it.
The documentation states that “This function will block until the client thread is actually stopped” and I’ve confirmed that it’s hanging in coap_client.c while loop.

    while (golioth_client_is_running(client))
    {
        golioth_sys_msleep(1000);
    }

What would cause the golioth client thread to refuse to stop?

Hey @john.stuewe, that is indeed a different behavior than the one in Zephyr SDK. I’ll run this by the Firmware Team and get back to you.

Let me know what you find out. I haven’t found a way around this.
With Golioth being an IOT company and IOT needing to run from battery I’m very surprised there aren’t more examples turning the radio and Golioth connection on and off.

@john.stuewe, we confirmed that the golioth_client_stop() isn’t working as expected, and we are treating it as a bug. We’ll include this fix in our next SDK release, which we expect to happen in the very near future.

I experience the same issue. I agree with @john.stuewe about the low power examples. It would be really nice to have a good example how to handle sleep modes. I opened an issue on the Reference design template github in december last year but no comments yet. (Add support for low power applications · Issue #71 · golioth/reference-design-template · GitHub)

@john.stuewe, @thijs, we agree that it would be nice to have more examples of low power and sleep modes and we have made some strides in that direction with a series of blog posts to show users how to start with that endeavour. Low power and sleep modes are part of the application layer and it’s up to the user to design their application and product with power constraints in mind and should seek information in relevant vendor documentation for the MCU as well as the example code.

We will continue to make new content for “sleepy” devices and incorporate low power modes into the Reference Design Template as soon as our resources allow. Until then, we welcome every contribution to the RD Template and we’ll gladly collaborate with the open-source community to help us achieve that goal.

Thanks! If the golioth_client_stop() function is working again in the coming update I can provide some examples how I would use it. Until now I did not find another way to stop the traffic from the application to the server. Because of this PSM mode will never be activated.

If you have some tips other than stopping the golioth service I would be happy to test them.

I played a bit with the CONFIG_GOLIOTH_COAP_KEEPALIVE_INTERVAL_S settings but that does not show any difference for me.

This is a blocking issue for me. Can you provide any workaround while we’re waiting on the new SDK?

1 Like