Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

With a number behind the topic to indicate which indicate which motor it applies to. 


Ho To have a MQTT broker run locally on the system mosquttio was used, its setup process is showcased in 24_7 Mosquitto setup. To setup a subscriber in CDP is quite simple. After creating a project, the NetworkInterface needs to be edited to correct IP(127.0.0.1) and SubnetMasK(255.255.255.0) furthermore, add a MQTTClient to the project. Within the MQTTClient some changes needs to be done before the subscriber works, the Broker host and port needs to be set to the correct settings, these should be 127.0.0.1(localhost) and 1883 respectivly.Image Removed1883 respectivly.Image Added

Now the subscriber topics can be added to the MQTTClient, for our dashboard the MQTTIO.subscribeTopic<string> was used. The dashboard has 4 unique MQTTClients:

Image Added

AMS, TMS, AMP, TMP are the acronyms of the topics: ActualMotorSpeed, TargetMotorSpeed, ActualMotorPosition, TargetMotorPosition. The topics are then added to the MQTTClient with the topics:
Image Added

This is for the MQTTClientAMS, and are like this for the other clients aswell. 


The dashboard is then designes as:
Image Added

Where the motors actual speed is on the left half on the meter, and the target speed on the righthand side.