You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the device boots, the callback for each registered setting is triggered multiple times (it seems that it is triggered n times where n is the total number of settings - but I can easily be wrong about the exact number).
Expected Behavior
A callback for each setting should be triggered exactly once.
Steps To Reproduce
I'm using Zephyr 3.7 together with Golioth v0.15.0. The target is espressif esp32 WROOM.
Logs, console output, or any kind of debug information
[00:00:19.069,000] hp_golioth_settings: Set MQTT broker name to xxx.com
[00:00:19.072,000] hp_golioth_settings: Set MQTT port to 1883
[00:00:19.412,000] hp_golioth_settings: Set cooling threshold to 2.50
[00:00:19.413,000] hp_golioth_settings: Set MQTT broker name to xxx.com
[00:00:19.416,000] hp_golioth_settings: Set MQTT port to 1883
[00:00:19.692,000] hp_golioth_settings: Set MQTT port to 1883
[00:00:19.692,000] hp_golioth_settings: Set cooling threshold to 2.50
[00:00:19.695,000] hp_golioth_settings: Set MQTT broker name to xxx.com
[00:00:19.985,000] hp_golioth_settings: Set MQTT port to 1883
[00:00:19.987,000] hp_golioth_settings: Set cooling threshold to 2.50
[00:00:19.988,000] hp_golioth_settings: Set MQTT broker name to xxx.com
The text was updated successfully, but these errors were encountered:
Hi @OgnjenX! Thanks for opening this issue and apologies for the delay in our reply.
You're correct in your assessment of the behavior. Each time we register a setting, we do a GET request to the server to ensure that we have an up-to-date value for that setting. The server returns the full settings payload each time, and so we call each of the registered handlers to update them. During initialization, when registering multiple settings, this manifests in the behavior you've described. This is inefficient, and we have plans to improve this in the future, both in terms of UX and bandwidth usage.
Note that even with improvements to settings registration, the settings handler will still need to be resilient to being called when the setting hasn't changed. This is because whenever there is an update to one or more settings in the cloud console, the whole settings payload is sent to the device, and the device does not know which of the settings has changed and which remains the same.
Golioth Firmware SDK Commit Hash
a6115ea
Platform/OS
Zephyr 3.7
Hardware Target
ESP32
What host OS are you using?
Windows 11
Current Behavior
When the device boots, the callback for each registered setting is triggered multiple times (it seems that it is triggered n times where n is the total number of settings - but I can easily be wrong about the exact number).
Expected Behavior
A callback for each setting should be triggered exactly once.
Steps To Reproduce
I'm using Zephyr 3.7 together with Golioth v0.15.0. The target is espressif esp32 WROOM.
Logs, console output, or any kind of debug information
[00:00:19.069,000] hp_golioth_settings: Set MQTT broker name to xxx.com
[00:00:19.072,000] hp_golioth_settings: Set MQTT port to 1883
[00:00:19.412,000] hp_golioth_settings: Set cooling threshold to 2.50
[00:00:19.413,000] hp_golioth_settings: Set MQTT broker name to xxx.com
[00:00:19.416,000] hp_golioth_settings: Set MQTT port to 1883
[00:00:19.692,000] hp_golioth_settings: Set MQTT port to 1883
[00:00:19.692,000] hp_golioth_settings: Set cooling threshold to 2.50
[00:00:19.695,000] hp_golioth_settings: Set MQTT broker name to xxx.com
[00:00:19.985,000] hp_golioth_settings: Set MQTT port to 1883
[00:00:19.987,000] hp_golioth_settings: Set cooling threshold to 2.50
[00:00:19.988,000] hp_golioth_settings: Set MQTT broker name to xxx.com
The text was updated successfully, but these errors were encountered: