NETWORKING

Connecting IoT devices to the web

MQTT:

MQTT is a protocol that sends messages to a broker, with different types of information, organized in different topics.
It works basically like WhatsApp:

You have different groups (TOPICS)
To which you send different MESSAGES
People (or devices) can SUBSCRIBE to a group
to get the messages you PUBLISH.

The topics can have many subtopics inside:

POWAR / CITY / TEMPERATURE
POWAR / CITY / WIND
POWAR / CITY / SUN

POWAR / HOUSE / LIGHT
POWAR / HOUSE / TEMPERATURE

POWAR / LED


Mobirise

STRUCTURE TO USE:

GROUPNAME / "SENSOR"
and
GROUPNAME / CITY / "INFORMATION"

Connecting ESP8266
to internet:

An easy way of doing it is with the WiFIManager Library, which turns your ESP8266 into a WiFi Network that you can see at home, and when you connect to it, you can now choose your WiFi and enter your WiFi password to connect.

Now we need to download the "WiFiManager" library created by tzapu.

in Arduino IDE:
TOOLS > MANAGE LIBRARIES >

Mobirise
WiFiManager CODE:

#include <ESP8266WiFi.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <>

void setup()
{
Serial.begin(115200);

// Create an instance of the class WiFiManager
WiFiManager wifiManager;

// Un-comment to reset the configuration
//wifiManager.resetSettings();

// We create a captive portal
wifiManager.autoConnect("***POWAR***", "12345678");

Serial.println("POWARfull Connection");
}

void loop() {}



CODE LINK:
WIFI_MANAGER.ino

Mobirise

OUR SERVER:

http://46.101.82.150:1880/

INTEGRATION CODES:

Here are some of the codes you are going to need to integrate everything.


WIFI_MANAGER.ino


WIFI_MQTT_LDR.ino


WIFI_MQTT_LDR_DHT.ino

Mobirise

Node RED

Introduction to Messages

Made with Mobirise ‌

Website Maker