working mqtt implementation

This commit is contained in:
Siwat Sirichai 2023-12-28 15:52:08 +07:00
parent 1163f2e30f
commit bb2991cb2d
6 changed files with 149 additions and 76 deletions

View file

@ -26,7 +26,6 @@ void setup()
Serial.println("Setting static IP");
Serial.println("Connecting to Ethernet");
ETH.begin();
delay(1000);
ETH.config(ip, gateway, subnet);
Serial.println("Static IP set");
Serial.println("Begin MQTT Initialization Routine");
@ -41,6 +40,9 @@ void setup()
Serial.println("Registering MQTT Callback");
espmega.iot.registerMqttCallback(mqtt_callback);
Serial.println("ESPMega IoT initialized");
Serial.println("Enable IoT Module for Digital Output Card");
espmega.iot.registerCard(1);
espmega.iot.publishCard(1);
}
void loop()