Skip to content

Teakzieas/NodeMcuMqttOTA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#include "mqtt.h" //include this for mqtt
#include "ota.h" //include this for ota


ota.h

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

mqtt.h

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published