Skip to content
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

[Backend] Research MQTT does the protocol could implement feature the device to connection status. (online, or offline) #19

Closed
2 tasks done
truonghoangduy opened this issue Feb 21, 2022 · 1 comment
Assignees
Labels
Projects

Comments

@truonghoangduy
Copy link
Collaborator

truonghoangduy commented Feb 21, 2022

Here are some detail about MQTT, blog post could help you research an solution

  • MQTT allows client to connect to broker with (username, password).

  • MQTT protocol has session, and Qos level. Meaning that the broker know when device has been disconnected

  • (copy form) MQTT Last Will and Testament (LWT): when the MQTT broker detects that the client is no longer connected it will publish the LWT message to the configured topic (note LWT is configured on the remote client, not in OH). Then create a switch Item to subscribe for those LWT messages and flip it off when you see a LWT message and back ON when you see any other message (use a rule).

  • LWT vietnamese blog (thông báo cho các khách hàng khác về một khách hàng bị ngắt kết nối một cách vô duyên.) : https://vidieukhien.xyz/2020/03/22/mqtt-tutorial-mqtt-last-will-and-testament/

  • LWT best practice https://www.hivemq.com/blog/mqtt-essentials-part-9-last-will-and-testament/

  • Flutter LWT : implement link

  • Topic for status : org/{org-name}/device/{device-id}/status.

  • Requirement for near realtime is not required (heart-beat or ping is okie).


Google Cloud Solution

GCP has a solution for it: https://stackoverflow.com/questions/54609757/google-core-iot-device-offline-event-or-connection-status , but it has required Stackdirver(GCP monitor tool) to monitor IoT_Core for device disconnection

relatied to GCP solution :
persistent-device-connection-status
google-cloud-detecting-offline-devices

Stuff has been proved

  • Flutter client able to connect to broker with MQTT v3.1
  • Authenticate custom Aedes broker
@truonghoangduy truonghoangduy created this issue from a note in gateway (To do) Feb 21, 2022
@DangCao1999 DangCao1999 moved this from To do to In progress in gateway Feb 22, 2022
@DangCao1999
Copy link
Collaborator

Implement Broker embedded with express

@truonghoangduy truonghoangduy moved this from In progress to REVIEW | HELP | BUG in gateway Feb 23, 2022
@truonghoangduy truonghoangduy moved this from REVIEW | HELP | BUG to Done in gateway Feb 23, 2022
@truonghoangduy truonghoangduy moved this from Done to DONE W2 in gateway Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
gateway
DONE W2
Development

No branches or pull requests

2 participants