Simple publisher for MQTT server

This is a simple program that shows how does the "publisher" in MQTT server model works. It publish "On" as a message on a server with IP address 192.168.1.105. Be carefull, we have already installed an instance of MQTT server on your Raspberry. And it lives on your Raspberry so the server has the same IP addres as the Raspberry. This means that you have to replace the IP addres in the program, with the addres of your Raspberry. If you forget it you can type "ifconfig" in the command promt and search for the "inet" line.
 

wlan0: flags=4163  mtu 1500

        inet 192.168.1.105  netmask 255.255.255.0  broadcast 192.168.1.255

The name of the client in this case is "Publisher 1" and the message is posted under the topic "Air Conditioner".

How to open?

Download
  • #a37tbu
  • 14 Dec 2018

Courses and lessons with this Program

This Program is used in the following courses and lessons

Image for Perfect STEM course. Module 2 - 1D Games with Led strip.
  • 19
  • 0:00
  • 37
Image for Publisher and Subscriber
  • 0
  • 7
  • 3d_rotation 0