IR_remote_MQTT_MATLAB

Project progress report on 11/04/2022

Testing MATLAB MQTT

Industrial_Communication_Toolbox

Using the Industrial Communication toolbox, we were able to use MATLAB to connect to our MQTT broker as a client by creating a client object and using write function.

MQTT in MATLAB

Toggling the zigbee electrical outlet with IR remote

Put our MQTT client object into our userdata and replace the task display code in our callTask function with the MQTT write function and now we can control the zigbee electrical outlet with IR remote.

Zigbee image here

Showing graph with GUI app

This part is the most problematic of this week’s work. Due to the lack of experience with how a MATLAB app works, we encounter several problems during our attempt to implement IR signal graph plotting. For example, the configureCallback function won’t work like in normal MATLAB. You have to pass an extra “event” argument to it for it to work.

Graph

MQTT and zigbee with GUI app

After we were able to display the IR signal graph in our GUI app, we implemented the MQTT publishing function to toggle the zigbee electrical outlet. It worked well in normal condition, but there is rapid repeating toggling when the Zigbee2MQTT lost connection to the MQTT broker unexpectedly then reconnected.

MQTT and zigbee with GUI app