-
Notifications
You must be signed in to change notification settings - Fork 12
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
Support REST Api for sending configs and commands to devices (Device Communication API) #19
Comments
@calohmn Hi there! May I ask you to assign someone for a review of this issue? If needed we can also do a quick walkthru in virtual meet to have a quick onboarding session |
@julian-sotec Sorry for the delay. I'm having a look at this issue here and the PR. |
Great! Thank you very much. If you need a quick demo / walkthru let us know |
…evice Communication API) (#20) Signed-off-by: g.dimitropoulos <[email protected]>
Fix test error, apply minor corrections. Also don't build docker-image by default and use generic docker image name. Signed-off-by: Carsten Lohmann <[email protected]>
* added support for device states * added automatic Pub/Sub tenant topic & subscription creation and deletion * added automatically sending of a config in case a config is requested or a new one created * extended config table with error field Signed-off-by: Matthias Kaemmer <[email protected]>
- handle commands and configs - use pubsub as internal message - updating db for device configs Signed-off-by: Georgios Dimitropoulos <[email protected]>
- handle commands and configs - use pubsub as internal message - updating db for device configs Signed-off-by: Georgios Dimitropoulos <[email protected]>
* added support for device states * added support for request/response commands * added automatic Pub/Sub tenant topic & subscription creation and deletion * added automatically sending of a config in case a config is requested or a new one created * extended config table with error field * formatted device communication api code Signed-off-by: Matthias Kaemmer <[email protected]>
- handle commands and configs - use pubsub as internal message - updating db for device configs Signed-off-by: Georgios Dimitropoulos <[email protected]>
* Add support for device states * Add support for request/response commands * Add support for ack-required command type and change configs to use ack-required type * Add retry mechanism for sending configs * Add automatic Pub/Sub tenant topic & subscription creation and deletion * Add automatically sending of a config in case a config is requested or a new one created * Add possibility to change log level * Update Quarkus dependency and migrated javax dependencies to jakarta * Improve SQL connection handling * Format and clean up device communication api code Signed-off-by: Matthias Kaemmer <[email protected]>
As we describe here This is an issue in order to qualify Hono as a replacement for Google IoT Core customers. In Google Iot Core clients can send commands and configs to a device through a REST API. Therefore we would like to add another REST API component to Hono as a replacement, named “Hono Device Communication API”. The new component will cover only communication via the MQTT adapter and will not communicate directly with the devices, but only with the command router.
Workflow
Client sends HTTP command/config requests to the Hono Device Communication API, api sends commands/configs to the command router which forwards them to the device.
Config Data
Config data does not need a specific schema and could be any binary data that a device understands. Configuration data will be stored with config version history.
Config Request
To update device configurations, the client should send a post request to the API and define fields versionToUpdate and binaryData in the request body.
POST https://API_URL/api/v1/config/{tenant-id}/{device-id}
Request body
Schema fields:
versionToUpdate field
Every device config has a version id (greater than 0). By updating device configs clients can update a specific config version or if the versionToUpdate field is set to 0, then the current version of configs will be always updated. Config update will fail if requested version does not exist.
binaryData
Any binary data that a specific device can understand.
Response body
If successful, api will return an DeviceConfig.
For more information see Google's IoT API documentation.
DeviceConfig DB
DeviceConfig objects will be saved in a Database so that a client can request them via the API. Database will be also used by MQTT adapter to make sure that all the desired configs have been delivered to the devices and also that all the devices have acknowledged their configs.
Keeping DeviceConfig sync
MQTT adapter after a configuration version was successfully updated, will publish the updated config version with retain set to true and so every device after a new start will always receive the updated current configurations to use.
The text was updated successfully, but these errors were encountered: