The following application was created by a project with the purpose to connect MQTT parts with EV3 device.

The goal was to implement an application that is capable of transforming incoming MQTT topics or JSON strings over HTTP to a format that is compliant with EV3 device.

Basic information about the application and key features

The MQTT to EV3 application is based on a spring boot java microservice architecture. Therefore, one of the key features of the application is the low consumption of resources, as the framework allows for the efficient distribution and usage of resources in general.

Furthermore the architecture includes multiple packages, such as the Java MQTT Paho client, the JSON libraries JSON-Simple and the Apache Maven package for Build, Deployment, and Testing.

One of the features is the configuration file with the options to control and customize the EV3 components.

Lastly, the application also supports a customize command.

Architecture and functional principles of the MQTT to Bluetooth


Before starting the application, you must ensure that the MQTT server and the corresponding EV3 device are running.

The current version does not have an interface that performs checks such as the above-mentioned prerequisites, as in a general operation both servers must be active.

In case these preconditions are not met, the application will throw multiple errors and will eventually crash.

Functional principles

At first, a JSON string is being sent via MQTT (HTTP is possible as well). This string is being directed into the MQTT to EV3 application, where the string is then being transformed into a EV3 device compliant format, which is predefined.

Lastly the application executes the command and sent it to the EV3 device.

Version Informations

The application is currently stable and the actual status is stable (Version 1.0.1).

Version Status Change Description


Configuration File

The following table explains you, the individual functions of the configuration file.

File OptionExample
General Config
CONVERTER_MODE0MQTT mode (Application works only with valid MQTT JSON commands)
1HTTP mode [URL: localhost:8080/HTTPToBluetoothConverterApi?jsonMessage:{}] (Application works only with valid HTTP JSON commands)
2MQTT and HTTP mode [URL: localhost:8080/HTTPToBluetoothConverterApi?jsonMessage:{}] (Application works with valid HTTP JSON and MQTT JSON commands)
MQTT_HTTP_APACHE_KAFKA_STREAM_LOGGER_MODE0No logging (No logging of the input and output stream)
1HTTP/MQTT stream logging
(Only logging of the input stream)
2Kafka stream logging
(Only logging of the output stream)
3HTTP/MQTT and Kafka stream logging (Logging of the input and output stream)
MQTT_HTTP_APACHE_KAFKA_LOGGER_PATHPath/Micro_Services/MqttAndHttpApacheKafkaConverterLog.logDefine the log path and file
MQTT_BROKER_HOSTtcp://MQTT_Broker_Hostname:MQTT_Broker_PortDefine the MQTT Broker Hostname or IP and the Port (Default: 1883)
MQTT_CLIENT_IDMQTTToApacheKafkaStreamClient Define the MQTT client ID
MQTT_RECEPTION_TOPIC_NAMEMQTT/TopicDefine the reception MQTT Topic
MQTT/Topic;MQTT/Topic Define the reception MQTT Topics separated with ‘;’
MQTT_SEND_TOPIC_NAME MQTT/TopicDefine the send MQTT Topic
MQTT/Topic;MQTT/Topic Define the send MQTT Topics separated with ‘;’
LAST_WILL_TESTAMENT_TOPIC_NAMEMQTT/Topic Define the Last Will and Testament Topic
LAST_WILL_TESTAMENT_QOS2Define the Last Will and Testament QOS
LAST_WILL_TESTAMENT_MESSAGEThe device is currently not available.Define the Last Will and Testament message
Bluetooth Config
BLUETOOTH_IP_ADDRESS10.0.1.1Define the Bluetooth IP address
BLUETOOTH_SOCKET5000Define the Bluetooth socket
BLUETOOTH_RECEPTION_SOCKET5000Define the Bluetooth reception socket
MQTT_STREAM_DEVICEIDtestDefine the Bluetooth stream DeviceID


  1. The application was developed for Java 9 and may also run under higher Java versions.


  1. Download the correct file for your Operating System.
  2. Unpack the file and copy the Jar and configuration folder & file to your local Operating System.
  3. Adjust your favorite user and set the correct rights at the Jar file (sudo chown user:user Path/MQTT_To_EV3.jar & sudo chmod 755 Path/MQTT_To_EV3.jar)
  4. Optional by Linux and MAC OS X Systems: Copy, implement and customize the Service Script.
    1. Download and copy the Script from here.
    2. Place the Script inside your /etc/init.d directory.
    3. Set the correct rights to your Script (sudo chmod 755 /etc/init.d/mqtt-to-ev3).
    4. Set the correct owner to your Script (sudo chown root:root /etc/init.d/mqtt-to-ev3).
    5. Customize the path inside the Script (sudo nano /etc/init.d/mqtt-to-ev3).
    6. Activate the Script and implement it your system start process with (sudo systemctl enable mqtt-to-ev3).
  5. Start the Service Script (sudo service mqtt-to-ev3 start) to run the application.
  6. Or start the MQTT_To_EV3 Jar file (/usr/bin/java -jar Path/MQTT_To_EV3.jar &) to run the application.



If you want you can support my work. The corresponding PayPal link will follow shortly.

License Agreement

You can find the license agreement here.


Please, contact me if you find a bug or you need help!