run pattern ater startup

This commit is contained in:
2018-11-29 07:05:46 +01:00
parent fb98bef55b
commit ade966a77c
4 changed files with 10 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{
"ircServer": "chat.freenode.net",
"ircPort": 6665,
"ircNickname": "redcat",
"ircUser": "redcat"
"ircNickname": "biermeter",
"ircUser": "biermeter"
}

View File

@@ -1,6 +1,6 @@
{
"mqttClientName" : "illucat",
"mqttClientName" : "biermeter",
"mqttBrokerHost" : "192.168.1.2",
"mqttBrokerPort" : 1883,
"mqttRootTopic" : "wirelos/led/illucat"
"mqttRootTopic" : "wirelos/led/biermeter"
}

View File

@@ -1,6 +1,6 @@
{
"pin": 4,
"length": 8,
"length": 60,
"brightness": 127,
"updateInterval": 100,
"defaultColor": 100

View File

@@ -8,6 +8,7 @@
#include <WebApiPlugin.h>
#include <PixelPlugin.h>
#include <MqttPlugin.h>
#include <OtaTcpPlugin.cpp>
WiFiNet *network;
Sprocket *sprocket;
@@ -16,6 +17,7 @@ WebConfigPlugin *webConfigPlugin;
WebApiPlugin *webApiPlugin;
PixelPlugin *pixelPlugin;
MqttPlugin *mqttPlugin;
OtaTcpPlugin *otaTcp;
void setup()
{
@@ -25,10 +27,12 @@ void setup()
webServerPlugin = new WebServerPlugin({WEB_CONTEXT_PATH, WEB_DOC_ROOT, WEB_DEFAULT_FILE, WEB_PORT});
webConfigPlugin = new WebConfigPlugin(webServerPlugin->server);
webApiPlugin = new WebApiPlugin(webServerPlugin->server);
otaTcp = new OtaTcpPlugin({OTA_PORT, OTA_PASSWORD});
sprocket->addPlugin(pixelPlugin);
sprocket->addPlugin(webServerPlugin);
sprocket->addPlugin(webConfigPlugin);
sprocket->addPlugin(webApiPlugin);
sprocket->addPlugin(otaTcp);
sprocket->addPlugin(mqttPlugin);
network = new WiFiNet(
@@ -45,6 +49,7 @@ void setup()
webServerPlugin->server->serveStatic(MQTT_CONFIG_FILE, SPIFFS, "mqttConfig.json");
sprocket->activate();
sprocket->publish("pixels/pattern", "1");
}
void loop()