Abstract

The article describes a device that transmits data and processes commands over the MQTTprotocol on the Internet. A small batch was made to assess the performance in real practice. Thesoftware for the microcontroller is written in C using a real-time operating system (RTOS), whichallows you to streamline software development through pseudo-parallel code execution, task synchronizationmechanisms (semaphores, mutexes), and a queue mechanism. The paper presents anexample of an algorithm for the interaction of FreeRTOS tasks: the tasks of waiting for a commandfrom the server, the tasks of measuring temperature, the main thread that sends a messageto the server in response to the appearance of a line in the message queue. The core of the MQTTclient being developed is the STM32 microcontroller and the GSM/GPRS SIM800 module. A largenumber of interfaces are displayed on the device, which allows you to connect a wide variety ofperipherals (temperature, humidity, pressure sensors, servos, etc.). The device is able to independentlyrestore the connection to the network in case of its interruption. The proprietary implementationof the MQTT protocol version 3.1 QoS 0 is used in the software of the control microcontroller.MQTT messages are transmitted as part of a TCP connection established by means of a GSM module. The control microcontroller communicates with the GSM module via AT commands.The possibility of two-way real-time messaging is implemented, which allows using the developedmicroprocessor system both in the mode of an autonomous control device and in the interactivemode of executing commands received wirelessly and sending the execution statuses of thesecommands. The main feature of the MQTT client is the ability to remotely update the microcontrollersoftware (OTA), implemented using an auxiliary microcontroller and a flash memory chip.The developed MQTT client is intended to be used as the basis of microprocessor systems - clientsof the Internet of Things.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.