Git Product home page Git Product logo

eq_robot_mqtt_broker's Introduction

eq_robot_mqtt_broker

Example of creating an MQTT server with publisher in ROS Noetic and python subscriber

Prerequisites

You must have

  1. Docker
  2. Docker-compose

Run the example

Clone the repository and navigate to the root folder

sudo -E docker-compose up

Note that the -E option is what enables passing environment variables from the host machine to the container.

If you wish to force re-building of the docker images

sudo -E docker-compose up --build

The docker-compose should now spin up three containers.

  1. mqtt_broker
    • The MQTT server which relays messages. This is based on VerneMQ.
  2. mqtt_publisher
    • A ROS Noetic network spinning up a publisher which publishes dummy data to the broker at 1 Hz. The communication on the ROS network is relayed to the MQTT broker through an mqtt_bridge.
  3. mqtt_subscriber

The publisher will print its published message while the subscriber will echo the message.

Run echo-subscriber

Clone the repository and navigate to the root folder

sudo -E docker-compose -f docker-compose.echo-test.yml up

The docker-compose should now spin up two containers.

  1. mqtt_broker
    • The MQTT server which relays messages. This is based on VerneMQ.
  2. mqtt_echo_subscriber
    • Subscriber written in Python which uses the paho mqtt client. Subscribes to the topics that the EchoMQTTClient in isar/services/service_connection/echo publishes to for testing purposes.

Subscriber will echo the recieved messages.

VerneMQ status interface

The VerneMQ status interface is exposed in localhost and may be accessed at

http://localhost:8888/status

Accessing the containers

Each container may be accessed after startup through the following command

sudo docker exec -it <container_name> /bin/bash

Administering the MQTT Broker

User management

Note that the example currently has anonymous access enabled by default!

A user exists with the following credentials for the sake of the example

  • Username: test_user
  • Password: test_password

To manage the user/password file see the official VerneMQ documentation.

Broker inspection

To inspect the broker during runtime you may use docker exec to access the container and use the vmq-admin tool to inspect the broker. See the VerneMq documentation for more details.

Credits

Thanks to The EIT-hub experiments repository for heplful guide to VerneMQ.

eq_robot_mqtt_broker's People

Contributors

aeshub avatar christdej avatar nicholasdalhaug avatar vetlek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.