-
Notifications
You must be signed in to change notification settings - Fork 3
MQTT broker
MQTT protocol enables bi-directional communication between the SmartRover emulator and the Frontend app, so that you can receive telemetry data and camera stream and send driving commands from control pad or console terminal. For the best performance, it is recommended to install a local MQTT broker on your computer and configure both emulator and the frontend to connect to "localhost". Or for more realistic experience of a "delayed" communication between the SmartRover, Mars Orbiter and the Earth, you can choose and use from numerous online MQTT brokers.
How to install Mosquitto broker (https://mosquitto.org/download/)
macOS
1. Install Homebrew (https://brew.sh/) In your macOS Terminal paste this command
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
after installing Homebrew
and paste this command to your macOS terminal
brew install mosquitto
the install script finishes with the guides on how to get started.
ln -sfv /usr/local/opt/mosquitto/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mosquitto.plist
To test the installation and ensure the server is running successfully:
Open a new command window and start a listener.
mosquitto_sub -t topic/state
In another window, send a message to the listener.
mosquitto_pub -t topic/state -m "I am installed successfully!"
/usr/local/etc/mosquitto/mosquitto.conf
- Rename original mosquito.conf into mosquito.conf.bak
- Prepare a new mosquitto.conf
-
find the line
allow_anonymous
and set it totrue
:allow_anonymous = true this allows you to create a server with any user name.
-
max_connections 99
-
brew services stop mosquito
mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf
6. Optional: to have a structured overview of MQTT topics install MQTT explorer(you can definitely work without this).
Windows
You can install mosquitto broker from their website (https://mosquitto.org/download/) or click on the latest releases for direct download
It is too easy to configure our SmartRover MQTT settings, you just do it in a three steps
Dare mighty things™