Replies: 1 comment 1 reply
-
Base version:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The MQTT client within Home Edge would receive the data whenever the data gets published to the MQTT broker at cloud. The communication between the service application and the Home Edge is Rest API based, like how we have designed for sending data to Cloud. Since this is asynchronous process the time we receive the data at Home Edge is dynamic. There can be different design methods for sending the data to the service application.
So main sub tasks would be :
Subscription API: Service application will call this Home Edge API to subscribe for a topic. We should initialize DataStorage at this point of time for topic of interest (e.g topic : home/living/lamp)
Broker would send event when there is publish for the topic. Home Edge MQTT client would receive the data and store in DataStorage. (e.g : topic : home/living/lamp, Message: Off)
Get Data API : Service Application would call the get data API of Home Edge to receive data for the topic. Internally data from DataStorage would be returned back.
If the above flow seems aggregable, we can start with developing the subscription API first. During the development we can see whether DataStorage is needed or a local Db would be enough. The reason for thought of local Db is that as we need not retain the history of data received for a particular topic and only maintain the latest data for the topic.
Came across two link which were good for MQTT, thought of sharing it here
http://www.steves-internet-guide.com/mqtt-publish-subscribe/
https://randomnerdtutorials.com/what-is-mqtt-and-how-it-works/
CloudSync MQTT_Receive.pptx
Beta Was this translation helpful? Give feedback.
All reactions