/MQTT-client-application-for-Windows

Delphi based application which communicates a VCL application with an IoT board

Primary LanguagePascal

MQTT-client-application-for-Windows

Delphi based application which communicates a VCL application with an IoT board The VCL Broker test is a Delphi-based application designed using the IDE RAD Studio Tokyo 10.2. It has been compiled for windows 32 bits. Basically, it is a client application which communicates with an IoT board through a MQTT broker server (mqtt.org). With this application, IoT (internet of things) projects can be easily designed. The IoT board can be anyone based on the ESP8266 circuit, including the Wemos D1 R2 and the nodeMCU 1.0 boards. The IoT module must have the sketch test_eclipse.ino previously stored in it. This sketch is based on the libraries esp8266wifi.h and PubSubClient.h (https://pubsubclient.knolleary.net/). The last one provides a client for doing simple publish/subscribe messaging with a server that supports MQTT protocol. The sketch test_eclipse.ino uses the broker test.mosquitto.org which listens on the port 1883. It subscribes to the topic “MessFromClient71” and publishes in the topics “Estado/Led”, “Estado/Botao” and "TopicIoTboard71". Every request received from the VCL application is printed on the serial monitor. If the VCL application publishes in the topic “MessFromClient71” the commands /LED=ON or /LED=OFF, the IoT board put the builtin led in the appropriate state and publishes this status in the topic “Estado/Led”. If the application publishes the command /STATEBUTTON, the IoT board publishes the state of the builtin button (pressed or unpressed) in the topic “Estado/Botao”. Finally, every message introduced via the serial monitor is published in the topic “TopicIoTboard71”.

The VCL Broker test application for Windows has been designed using the TMS MQTT components (https://www.tmssoftware.com/site/tmsmqtt.asp) for Rad Studio. It uses the TMSMQTTClient component which communicates the application with the MQTT free broker servers test.mosquitto.org, broker.hivemq.com, iot.eclipse.com, mqtt.fluux.io, test.mosca.io, broker.mqttdashboard.com (see http://moxd.io/2015/10/17/public-mqtt-brokers/). The server is selected from a listbox. The application subscribes to the topics Estado/Led, Estado/Botao and TopicIoTboard71 and publishes on the topic MessFromClient71. The received payloads are written on a memo log window and the command to be published can be introduced through an edit window and sent to the broker server. Finally, two buttons allows the application to connect and disconnect to the broker server. The connection status, as well as the received payloads sent by the IoT board are written on the memo log window.

telamqtt