mirror of
https://gitlab.com/zwirbel/illucat.git
synced 2025-12-15 17:58:20 +01:00
reenable ota
This commit is contained in:
@@ -2,5 +2,5 @@
|
|||||||
"mqttClientName" : "illucat",
|
"mqttClientName" : "illucat",
|
||||||
"mqttBrokerHost" : "192.168.1.2",
|
"mqttBrokerHost" : "192.168.1.2",
|
||||||
"mqttBrokerPort" : 1883,
|
"mqttBrokerPort" : 1883,
|
||||||
"mqttRootTopic" : "wirelos/illucat"
|
"mqttRootTopic" : "wirelos/led/illucat"
|
||||||
}
|
}
|
||||||
@@ -73,8 +73,8 @@
|
|||||||
<div class="Form" data-fileName="/config.json" data-name="configForm" data-from="/config.json" data-endpoint="/config"></div>
|
<div class="Form" data-fileName="/config.json" data-name="configForm" data-from="/config.json" data-endpoint="/config"></div>
|
||||||
<h2>NeoPixel</h2>
|
<h2>NeoPixel</h2>
|
||||||
<div class="Form" data-fileName="/pixelConfig.json" data-name="configForm" data-from="/pixelConfig.json" data-endpoint="/config"></div>
|
<div class="Form" data-fileName="/pixelConfig.json" data-name="configForm" data-from="/pixelConfig.json" data-endpoint="/config"></div>
|
||||||
<!-- <h2>MQTT</h2>
|
<h2>MQTT</h2>
|
||||||
<div class="Form" data-fileName="/mqttConfig.json" data-name="configForm" data-from="/mqttConfig.json" data-endpoint="/config"></div> -->
|
<div class="Form" data-fileName="/mqttConfig.json" data-name="configForm" data-from="/mqttConfig.json" data-endpoint="/config"></div>
|
||||||
<h2>IRC</h2>
|
<h2>IRC</h2>
|
||||||
<div class="Form" data-fileName="/ircConfig.json" data-name="configForm" data-from="/ircConfig.json" data-endpoint="/config"></div>
|
<div class="Form" data-fileName="/ircConfig.json" data-name="configForm" data-from="/ircConfig.json" data-endpoint="/config"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -100,4 +100,6 @@ lib_deps = ${common.lib_deps}
|
|||||||
https://gitlab.com/wirelos/sprocket-network-wifi.git
|
https://gitlab.com/wirelos/sprocket-network-wifi.git
|
||||||
https://gitlab.com/wirelos/sprocket-plugin-web.git
|
https://gitlab.com/wirelos/sprocket-plugin-web.git
|
||||||
https://gitlab.com/wirelos/sprocket-plugin-irc.git
|
https://gitlab.com/wirelos/sprocket-plugin-irc.git
|
||||||
|
https://gitlab.com/wirelos/sprocket-plugin-mqtt.git
|
||||||
|
PubSubClient
|
||||||
ArduinoIRC
|
ArduinoIRC
|
||||||
|
|||||||
@@ -52,5 +52,11 @@
|
|||||||
#define WEB_DEFAULT_FILE "index.html"
|
#define WEB_DEFAULT_FILE "index.html"
|
||||||
#define WEB_PORT 80
|
#define WEB_PORT 80
|
||||||
|
|
||||||
|
// mqtt config
|
||||||
|
#define MQTT_CLIENT_NAME "illucat"
|
||||||
|
#define MQTT_HOST "192.168.1.2"
|
||||||
|
#define MQTT_PORT 1883
|
||||||
|
#define MQTT_ROOT_TOPIC "wirelos/led/illucat"
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
#include <PixelPlugin.h>
|
#include <PixelPlugin.h>
|
||||||
#include <IrcPlugin.h>
|
#include <IrcPlugin.h>
|
||||||
#include <OtaTcpPlugin.cpp>
|
#include <OtaTcpPlugin.cpp>
|
||||||
|
#include <MqttPlugin.h>
|
||||||
|
|
||||||
WiFiNet *network;
|
WiFiNet *network;
|
||||||
Sprocket *sprocket;
|
Sprocket *sprocket;
|
||||||
@@ -18,6 +19,7 @@ WebApiPlugin *webApiPlugin;
|
|||||||
PixelPlugin *pixelPlugin;
|
PixelPlugin *pixelPlugin;
|
||||||
IrcPlugin *ircPlugin;
|
IrcPlugin *ircPlugin;
|
||||||
OtaTcpPlugin *otaTcp;
|
OtaTcpPlugin *otaTcp;
|
||||||
|
MqttPlugin *mqttPlugin;
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
@@ -25,6 +27,7 @@ void setup()
|
|||||||
sprocket = new Sprocket({STARTUP_DELAY, SERIAL_BAUD_RATE});
|
sprocket = new Sprocket({STARTUP_DELAY, SERIAL_BAUD_RATE});
|
||||||
pixelPlugin = new PixelPlugin({LED_STRIP_PIN, LED_STRIP_LENGTH, LED_STRIP_BRIGHTNESS, LED_STRIP_UPDATE_INTERVAL});
|
pixelPlugin = new PixelPlugin({LED_STRIP_PIN, LED_STRIP_LENGTH, LED_STRIP_BRIGHTNESS, LED_STRIP_UPDATE_INTERVAL});
|
||||||
ircPlugin = new IrcPlugin({IRC_SERVER, IRC_PORT, chipName, chipName});
|
ircPlugin = new IrcPlugin({IRC_SERVER, IRC_PORT, chipName, chipName});
|
||||||
|
mqttPlugin = new MqttPlugin({MQTT_CLIENT_NAME, MQTT_HOST, MQTT_PORT, MQTT_ROOT_TOPIC});
|
||||||
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);
|
||||||
@@ -36,6 +39,7 @@ void setup()
|
|||||||
sprocket->addPlugin(webApiPlugin);
|
sprocket->addPlugin(webApiPlugin);
|
||||||
sprocket->addPlugin(otaTcp);
|
sprocket->addPlugin(otaTcp);
|
||||||
sprocket->addPlugin(ircPlugin);
|
sprocket->addPlugin(ircPlugin);
|
||||||
|
sprocket->addPlugin(mqttPlugin);
|
||||||
|
|
||||||
network = new WiFiNet(
|
network = new WiFiNet(
|
||||||
WIFI_MODE,
|
WIFI_MODE,
|
||||||
@@ -49,6 +53,7 @@ void setup()
|
|||||||
|
|
||||||
webServerPlugin->server->serveStatic(PIXEL_CONFIG_FILE, SPIFFS, "pixelConfig.json");
|
webServerPlugin->server->serveStatic(PIXEL_CONFIG_FILE, SPIFFS, "pixelConfig.json");
|
||||||
webServerPlugin->server->serveStatic(IRC_CONFIG_FILE, SPIFFS, "ircConfig.json");
|
webServerPlugin->server->serveStatic(IRC_CONFIG_FILE, SPIFFS, "ircConfig.json");
|
||||||
|
webServerPlugin->server->serveStatic(MQTT_CONFIG_FILE, SPIFFS, "mqttConfig.json");
|
||||||
|
|
||||||
sprocket->subscribe("irc/connected", [](String msg) {
|
sprocket->subscribe("irc/connected", [](String msg) {
|
||||||
if (atoi(msg.c_str()))
|
if (atoi(msg.c_str()))
|
||||||
|
|||||||
@@ -36,16 +36,17 @@
|
|||||||
#define COLOR_CONNECTED LED_STRIP_DEFAULT_COLOR
|
#define COLOR_CONNECTED LED_STRIP_DEFAULT_COLOR
|
||||||
#define COLOR_NOT_CONNECTED 255
|
#define COLOR_NOT_CONNECTED 255
|
||||||
|
|
||||||
|
|
||||||
|
// OTA config
|
||||||
|
#define OTA_PORT 8266
|
||||||
|
#define OTA_PASSWORD ""
|
||||||
|
|
||||||
// mqtt config
|
// mqtt config
|
||||||
#define MQTT_CLIENT_NAME "illucat"
|
#define MQTT_CLIENT_NAME "illucat"
|
||||||
#define MQTT_HOST "192.168.1.2"
|
#define MQTT_HOST "192.168.1.2"
|
||||||
#define MQTT_PORT 1883
|
#define MQTT_PORT 1883
|
||||||
#define MQTT_ROOT_TOPIC "wirelos/illucat"
|
#define MQTT_ROOT_TOPIC "wirelos/illucat"
|
||||||
|
|
||||||
// OTA config
|
|
||||||
#define OTA_PORT 8266
|
|
||||||
#define OTA_PASSWORD ""
|
|
||||||
|
|
||||||
// WebServer
|
// WebServer
|
||||||
#define WEB_CONTEXT_PATH "/"
|
#define WEB_CONTEXT_PATH "/"
|
||||||
#define WEB_DOC_ROOT "/www"
|
#define WEB_DOC_ROOT "/www"
|
||||||
|
|||||||
Reference in New Issue
Block a user