Skip to content

Conversation

@kokosabu
Copy link

We hope that MQTT will be adopted in addition to WebSockets.

MQTT is publish/subscribe type, so when one client publishes, all clients can subscribe to it.
(I saw in this article that it was one of the last candidates for protocol transport messaging. )

I have implemented MQTT, and I hope it will be useful for you to consider the adoption of MQTT. I have extended MaasRobotics-AMR-Receiver to subscribe to MQTT as well.

$ cd AMR_Interop_Standard
$ docker-compose build
$ docker-compose up
$ # open http://localhost:3000/ in a browser

or

$ pip install paho-mqtt
$ cd AMR_Interop_Standard/MassRobotics-AMR-MQTT-Client
$ python subscribe.py & 
$ python publisher.py

@CS-RGRobotix
Copy link

Im definitely in favor of this. The type of data being sent is perfect for MQTT

@kingc95
Copy link

kingc95 commented Nov 22, 2021

I just did a checkout of this and I'm in love with it. I already use MQTT with ROS and other projects so it makes sense to me why it should be supported. Runs great and exactly as I would expect it to. This should be adopted as an option to meet with the Mass Robotics AMR Interop spec. As an additional argument in favor of MQTT it can be encrypted end to end and locked with User and Password making it more secure than no security as is the case with ROS and the original TCP/IP version of this standard.

One suggestion I would make is to have each subscriber and publisher nest one level down for the statusReport topic. Example: {uuid}/statusReport as opposed to /statusReport. This make it cleaner for organizational purposes, allows you to limit the number of messages every subscriber will have to parse through. The identity report should be one topic every device posts to on power on or on a power off so the Fleet Manager can know the UUID of every device. Then subscribe to all topics under that /{uuid} using wildcards. example: mqtt_client.subscribe("2c99c66f-e6ff-2b04-7529-8b5916c62cc4/*") will subscribe to all topics starting with that uuid. In this example there is only one topic the device posts, but in theory there could be many more and you shouldnt have to reference a table to capture them all as a fleet manager.

@CS-RGRobotix
Copy link

I made a fork here: https://github.com/cs-resgreen/AMR_Interop_Standard that implements the above suggestion

NOTE: the wildcard operator is # not * read the usage here under the heading Topics/Subscriptions: https://mosquitto.org/man/mqtt-7.html

@kokosabu kokosabu force-pushed the implement-mqtt-protocol branch from 2507abd to 53193d3 Compare November 24, 2021 02:58
@kokosabu
Copy link
Author

Glad I suggested it, it seems to be well received!

@kokosabu
Copy link
Author

Hi @cacioppoc @zac-dydek

Conflicts have been resolved. I hope it will be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants