// Code written By: Chinmay Kolhatkar (IOT EMBEDDED ENGINEER) #include #include // Connect to the WiFi const char* ssid = "******"; //add your wifi Name const char* password = "*****"; //Add your wifi password here const char* mqtt_server = "192.168.43.69"; //add the ip address of your raspberry pi you can get the ip address of your Pi by typing ifconfig in terminal WiFiClient espClient; PubSubClient client(espClient); const byte relay=12; const byte led_pin=13; void callback(char* topic, byte* payload, unsigned int length) { Serial.print("Message arrived ["); Serial.print(topic); Serial.print("] "); for (int i=0;i