Joyeeta Chatterjee in MATLAB Answers
上次活动时间: 2024-8-6

I want to publish MQTT messages from my model in Simulink to the mosquitto broker. So far I have been able to publish messages successfully from MATLAB script to the mosquitto broker using the MQTT in MATLAB toolbox. I would like to do the same through my Simulink model. I understand that there is a MQTT Publish block in Simulink for Raspberry Pi that publishes message to a ThingSpeak broker. Is there a way to use this block for any other Simulink model (that does not use Raspberry Pi) and also for any other broker like mosquitto in my case? If the MQTT Publish block cannot be used for this purpose, should I use a MATLAB function block and write the MATLAB code for MQTT in a .m file and include it in Simulink? Is there any other way to implement MQTT Publish in Simulink models (without Raspberry Pi and for brokers other than ThingSpeak)?

关于 ThingSpeak

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.