#include "mqtt.h" //include this for mqtt
#include "ota.h" //include this for ota
Change the ssid and password in file to id and password
otaSetup()
--Add in setup to connect and start ota
otaLoop()
--Add in loop to keep connection
Change the ssid and password in file to id and password
Set mqtt details in the mqtt section
Make sure each device has a diffent mqtt id
mqttSetup("log",{"testtopic1,"testtopic2"})
--run on setup to connect and start mqtt
--the fist attribute is for the mqtt log topic
--when connected a status message will be posted here
--the second attribute is a array for topics to subscribe
mqttLoop()
--keeps the mqtt connection active
void MsgReceived(String topic, String payload)
--this function is to recieve any mqtt messages that arrive
mqttPublish("topic", "payload");
--call this function to publish a payload to a topic