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", "ircServer": "chat.freenode.net",
"ircPort": 6665, "ircPort": 6665,
"ircNickname": "redcat", "ircNickname": "biermeter",
"ircUser": "redcat" "ircUser": "biermeter"
} }

View File

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

View File

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

View File

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