ESP32

Connection to Matlab

Receiving the Data from the ESP32 in Matlab is done by 3 Steps:

  1. connect to the MQTT Broker using the function: mqttclient
  2. define a function that should be called when Data is received
  3. subscripe to the Topic of the ESP32 using the function: subscribe

Sadly Matlab is horrible in open/closing connections and
handling the running process of the Subscription.

So it is very easy to have a connection that is not closed or have a process
running in the background still beeing subscripted too a Topic and the user
beeing unable to close it cause all handles to it are lost.

I have written 2 Classes as an example defining the MQTT connection
and the Sensor to prevent as many of these cases as possible.

run.mlx mqttConnection.m mpu6050.m

Overview

Go Back