Here is use case I am working upon.
I have few LoRa based devices connected to thingsnetwork server. These devices are used to Switch on/off light. I am using Azure functions to send the commands to the devices (e.g. switch ON light) using thingsnetwork http api and sending downlink command.
When I send the command to switch ON light from one azure function, it goes to ttn server -> gateway -> devices. Device would respond as separate uplink command as response to command. This would trigger seperate Azure function where the light status is received.
Now I want to implement retry, in two scenarios -
- If command is send to switch on light - but device upload the light status as OFF. Then I need to send ON command again to that device.
- If command is send to switch on light - and no response received from the device within X seconds, then I need to send ON command again to that device.
I am using Azure tech stack - Azure event hub, Service bus, Azure function etc.
Can someone suggest the best practice to implement such async notifications from devices and how we can implement retry pattern?