0% found this document useful (0 votes)
6 views

installing software for iot mqtt practical pdf

The document provides step-by-step instructions for installing Jupyter Notebook via Anaconda and running a specific IoT MQTT protocol practical. It details how to connect to an MQTT broker, process messages to control a virtual light indicator using Tkinter, and set up an IoT application on a mobile device for interaction. The practical involves using a unique topic for MQTT messages to control the light's state based on received commands.

Uploaded by

Ranjith Rao
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

installing software for iot mqtt practical pdf

The document provides step-by-step instructions for installing Jupyter Notebook via Anaconda and running a specific IoT MQTT protocol practical. It details how to connect to an MQTT broker, process messages to control a virtual light indicator using Tkinter, and set up an IoT application on a mobile device for interaction. The practical involves using a unique topic for MQTT messages to control the light's state based on received commands.

Uploaded by

Ranjith Rao
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Installing Jupyter notebook

https://www.anaconda.com/download open link and follow below instructions.


Installing Jupyter notebook
Installing Jupyter notebook

Click on next next then wait for complete installation.

Once installation is done

Search for anaconda navigator


Installing Jupyter notebook

Click on open.

This window will show.

Now click on Jupyter notebook (Launch button)

Below window will open in your browser.

Here search for your downloaded Ipynb file

IOT mqtt protocol practical 3.ipynb file


Installing Jupyter notebook

As I created file(name- IOT as shown in lab lecture 3 ) in desktop

I clicked on desktop and

Double click on IOT Mqtt protocall 3.ipynb

It will show like above


Installing Jupyter notebook
Installing Jupyter notebook

Code Explanation Step-by-Step Breakdown:

1. Connects to an MQTT Broker


o Uses the public broker HiveMQ (broker.hivemq.com).
o Subscribes to a specific topic: "IOT/light/control/your bits id" (which
should be unique per user ).
o Listens for messages published on this topic.
2. Receives and Processes MQTT Messages
o When a message is received:
▪ If the message is "1", the light turns Green (ON).
▪ If the message is "0", the light turns Red (OFF).
▪ If an unexpected message is received, it prints an error.
3. Displays a GUI with a Virtual Light Indicator
o Uses Tkinter to create a window.
o A circle is drawn on a canvas to represent the light.
o The light starts red (OFF) and changes color based on MQTT messages.
4. Keeps Running and Updates in Real Time
o The program continuously listens for MQTT messages.
o If the window is closed, the MQTT connection is disconnected properly.

Summary

🔹 Listens for MQTT messages on a specific topic.


🔹 Displays a virtual light in a GUI using Tkinter.
🔹 Changes the light's color based on MQTT messages.
🔹 Handles proper connection and disconnection from the MQTT broker.
Installing Jupyter notebook

Once you run this code

This type of popup will come on window (please search it will pop up anywhere in your
window)
Installing Jupyter notebook

Then open IOT application on your mobile :

https://play.google.com/store/apps/details?id=snr.lab.iotmqttpanel.prod&pcampaignid=web_s
hare

Open application IOT MQTT panel


Installing Jupyter notebook

Click on Setup connection.


Installing Jupyter notebook

After typing all click on + button


Installing Jupyter notebook

Give the dashboard a name, such as "Light" (or feel free to choose any other name) and click on save.
Installing Jupyter notebook

Click on create button


Installing Jupyter notebook

Click on any name (as per your given name, it will show).
Installing Jupyter notebook

Click on ADD panel


Installing Jupyter notebook

Click on Switch button

IOT/light/control/2023ab05195 # MQTT topic (must be unique per user change with ur Bits ID )
Installing Jupyter notebook

Topic should be as per given in code (for me it was IOT/light/control/2023ab05195 as per that I entered here)
Installing Jupyter notebook

Click on Create button.


Installing Jupyter notebook

That button will get added.

Now as your code is already running in pc and if u click on this button it will send message.

Now perform the practical as per instructions given in lab lecture 3.

You might also like