7 Commits

Author SHA1 Message Date
d815117179 update deps 2025-08-14 20:19:41 +02:00
22004ba8e6 pin versions 2025-08-14 20:15:09 +02:00
Patrick balsiger
210e32eb5a feat: uploadfs 2022-06-22 22:08:04 +02:00
0x1d
23ba26bc21 feat: pio install 2022-06-22 17:32:44 +00:00
05fbbe90ea fix: neopixel version, add makefile 2021-10-08 18:47:25 +02:00
0x1d
2fa6fadac6 Merge branch 'feature/esp32-build' into 'master'
feat: add ESP32 build

See merge request 0x1d/illucat!12
2020-09-27 11:35:07 +00:00
Patrick Balsiger
212baf7660 feat: add ESP32 build 2020-09-27 09:20:42 +02:00
15 changed files with 270 additions and 164 deletions

2
.gitignore vendored
View File

@@ -1,5 +1,3 @@
.pioenvs
.piolibdeps
.pio .pio
.vscode .vscode
data/config.json data/config.json

View File

@@ -1,4 +1,4 @@
image: python:2.7-stretch image: python:3.12.10
variables: variables:
S3_BUCKET_NAME: "wirelos" S3_BUCKET_NAME: "wirelos"
@@ -12,16 +12,16 @@ stages:
cache: cache:
key: ${CI_COMMIT_REF_SLUG} key: ${CI_COMMIT_REF_SLUG}
paths: paths:
- .pioenvs/ - .pio/
firmware: firmware:
stage: build stage: build
image: python:2.7-stretch image: python:3.12.10
before_script: before_script:
- pip install -U platformio - pip install -U platformio
script: script:
- pio run -t clean - pio run -t clean
- pio run - pio run -e release
- pio run -t buildfs - pio run -t buildfs
release: release:
@@ -30,11 +30,11 @@ release:
- /^release-.*$/ - /^release-.*$/
image: python:latest image: python:latest
script: script:
- pip install awscli #- pip install awscli
- mkdir -p ${PROJECT_NAME}/${CI_COMMIT_TAG} - mkdir -p ${PROJECT_NAME}/${CI_COMMIT_TAG}
- mv .pioenvs/release/firmware.bin ${PROJECT_NAME}/${CI_COMMIT_TAG} - mv .pio/build/release/firmware.bin ${PROJECT_NAME}/${CI_COMMIT_TAG}
- mv .pioenvs/release/spiffs.bin ${PROJECT_NAME}/${CI_COMMIT_TAG} - mv .pio/build/release/spiffs.bin ${PROJECT_NAME}/${CI_COMMIT_TAG}
- aws s3 --endpoint-url=https://$DO_SPACE_ENDPOINT cp ./ s3://$S3_BUCKET_NAME/ --recursive --exclude "*" --include "*.bin" #- aws s3 --endpoint-url=https://$DO_SPACE_ENDPOINT cp ./ s3://$S3_BUCKET_NAME/ --recursive --exclude "*" --include "*.bin"
artifacts: artifacts:
paths: paths:
- ${PROJECT_NAME}/${CI_COMMIT_TAG} - ${PROJECT_NAME}/${CI_COMMIT_TAG}

8
.gitpod.yml Normal file
View File

@@ -0,0 +1,8 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file)
# and commit this file to your remote git repository to share the goodness with others.
tasks:
- init: make install

40
Makefile Normal file
View File

@@ -0,0 +1,40 @@
PIO ?= platformio
flash: upload uploadfs
install:
python3 -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
init:
curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/master/scripts/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules
sudo udevadm control --reload-rules
sudo udevadm trigger
build:
$(PIO) run -e esp01
upload:
$(PIO) run -e esp01 -t upload
uploadfs:
$(PIO) run -e esp01 -t uploadfs
spiffs.bin:
#mkspiffs -c data -p 256 -b 4096 -s 524288 spiffs.bin
mkspiffs -c data -p 256 -b 4096 -s 65536 spiffs.bin
upload-esp01:
#esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --flash_size 1MB 0x00000 .pio/build/esp01/firmware.bin
#esptool.py --port /dev/ttyUSB0 --baud 57600 write_flash --flash_size 1MB 0x80000 spiffs.bin
# that almost worked
#esptool.py --port /dev/ttyUSB0 --baud 57600 write_flash --flash_mode dio --flash_size 1MB 0x00000 .pio/build/esp01/firmware.bin 0x80000 spiffs.bin
#pio does this
esptool.py --chip esp8266 --port "/dev/ttyUSB0" --baud 921600 write_flash 0x0 .pio/build/esp01/firmware.bin 0x000eb000 spiffs.bin
esptool.py --port /dev/ttyUSB0 --baud 57600 write_flash 43827 spiffs.bin
# for 4MB Flash Size, 3MB SPIFFS
#spiffs.bin:
# mkspiffs -c data -p 256 -b 4096 -s 3145728 spiffs.bin
#
#upload-spiffs.bin:
# esptool --port /dev/ttyUSB0 write_flash 0x300000 spiffs.bin

2
api.md
View File

@@ -51,7 +51,7 @@ Examples:
curl -v -X POST \ curl -v -X POST \
--data "topic=pixels/colorWheel" \ --data "topic=pixels/colorWheel" \
--data "payload=20" \ --data "payload=20" \
http://illucat/pixel/api http://192.168.4.1/pixel/api
# set color only on current node # set color only on current node
curl -v -X POST \ curl -v -X POST \

View File

@@ -1,9 +0,0 @@
{
"mqttClientName": "illucat1",
"mqttBrokerHost": "192.168.88.110",
"mqttBrokerPort": 1883,
"mqttRootTopic": "wirelos/illucat",
"mqttUser": "",
"mqttPass": ""
}

View File

@@ -1,9 +1,9 @@
{ {
"stationMode": 1, "stationMode": 0,
"hostname": "illucat", "hostname": "illucat",
"apSSID": "illucat", "apSSID": "illucat",
"apPassword": "illumination", "apPassword": "illumination",
"connectTimeout": 5000, "connectTimeout": 15000,
"stationSSID": "thobens-416257", "stationSSID": "dis-wifi",
"stationPassword": "467304645DB5" "stationPassword": "dis-wifi-passwort"
} }

View File

@@ -1,9 +1,6 @@
{ {
"mqttClientName": "illucat1", "mqttClientName" : "illucat1",
"mqttBrokerHost": "192.168.4.1", "mqttBrokerHost" : "192.168.1.2",
"mqttBrokerPort": 1883, "mqttBrokerPort" : 1883,
"mqttRootTopic": "wirelos/illucat", "mqttRootTopic" : "wirelos/illucat"
"mqttUser": "foo",
"mqttPass": ""
} }

View File

@@ -1,7 +1,7 @@
{ {
"pin": 4, "pin": 4,
"length": 8, "length": 8,
"brightness": 127, "brightness": 50,
"updateInterval": 100, "updateInterval": 100,
"defaultColor": 100 "defaultColor": 100
} }

View File

@@ -16,24 +16,47 @@
<span class="heading">Pixels</span> <span class="heading">Pixels</span>
<div class="content"> <div class="content">
<ul> <ul>
<li class="form-row ParamSelect" data-label="Hue" data-name="hue" data-topic="pixels/hue" data-default="0" <li class="form-row ParamSelect"
data-label="Hue"
data-name="hue"
data-topic="pixels/hue"
data-default="0"
data-external="/gradients.json"> data-external="/gradients.json">
</li> </li>
<li class="form-row ParamColor" data-name="color" data-topic="pixels/color" data-label="Color"> <li class="form-row ParamColor"
data-name="color"
data-topic="pixels/color"
data-label="Color">
</li> </li>
<li class="form-row ParamColor" data-name="color" data-topic="pixels/color2" data-label="Color 2"> <li class="form-row ParamColor"
data-name="color"
data-topic="pixels/color2"
data-label="Color 2">
</li> </li>
<!-- data-entries='[{"text": "Color", "value": "0"}, {"text": "Rainbow", "value": "1"}, {"text": "TheaterChase", "value": "2"}, {"text": "Wipe", "value": "3"}, {"text": "Scanner", "value": "4"}, {"text": "Fade", "value": "5"}]' --> <!-- data-entries='[{"text": "Color", "value": "0"}, {"text": "Rainbow", "value": "1"}, {"text": "TheaterChase", "value": "2"}, {"text": "Wipe", "value": "3"}, {"text": "Scanner", "value": "4"}, {"text": "Fade", "value": "5"}]' -->
<li class="form-row ParamSelect" data-label="Pattern" data-name="pattern" data-topic="pixels/pattern" <li class="form-row ParamSelect"
data-default="0" data-label="Pattern"
data-entries='[{"text": "None", "value": "0"}, {"text": "Rainbow", "value": "1"}, {"text": "TheaterChase", "value": "2"}, {"text": "Color Wipe", "value": "3"}, {"text": "Scanner", "value": "4"}, {"text": "Fade", "value": "5"}, {"text": "Fire", "value": "6"}]'> data-name="pattern"
</li> data-topic="pixels/pattern"
<li class="form-row ParamSlider" data-name="brightness" data-min="0" data-max="255" data-value="64" data-default="0"
data-topic="pixels/brightness" data-label="Brightness"> data-entries='[{"text": "None", "value": "0"}, {"text": "Rainbow", "value": "1"}, {"text": "TheaterChase", "value": "2"}, {"text": "Color Wipe", "value": "3"}, {"text": "Scanner", "value": "4"}, {"text": "Fade", "value": "5"}, {"text": "Fire", "value": "6"}]'
</li> ></li>
<li class="form-row ParamSlider" data-name="totalSteps" data-min="1" data-max="255" data-value="16" <li class="form-row ParamSlider"
data-topic="pixels/totalSteps" data-label="Steps"> data-name="brightness"
data-min="0"
data-max="255"
data-value="64"
data-topic="pixels/brightness"
data-label="Brightness">
</li> </li>
<li class="form-row ParamSlider"
data-name="totalSteps"
data-min="1"
data-max="255"
data-value="16"
data-topic="pixels/totalSteps"
data-label="Steps">
</li>
</ul> </ul>
</div> </div>
</form> </form>
@@ -46,30 +69,27 @@
<div class="settings container collapsible"> <div class="settings container collapsible">
<span class="heading">Settings</span> <span class="heading">Settings</span>
<div class="content"> <div class="content">
<h2>Network</h2> <h2>Network</h2>
<div class="Form" data-fileName="/config/wifi.json" data-name="configForm" data-from="/config/wifi.json" <div class="Form" data-fileName="/config/wifi.json" data-name="configForm" data-from="/config/wifi.json" data-endpoint="/config"></div>
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" <!-- <h2>MQTT</h2>
data-endpoint="/config"></div> <div class="Form" data-fileName="/mqttConfig.json" data-name="configForm" data-from="/mqttConfig.json" data-endpoint="/config"></div>
<h2>MQTT</h2> <h2>IRC</h2>
<div class="Form" data-fileName="/config/mqtt.json" data-name="configForm" data-from="/config/mqtt.json"
data-endpoint="/config"></div>
<!-- <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>
</div> </div>
<div class="settings container collapsible"> <div class="settings container collapsible">
<span class="heading">System</span> <span class="heading">System</span>
<div class="content"> <div class="content">
<div><label>Free Heap: </label><span class="js-heap"></span><span>&nbsp;bytes</span><br><br></div> <div><label>Free Heap: </label><span class="js-heap"></span><span>&nbsp;bytes</span><br><br></div>
<form method='POST' action='/update' enctype='multipart/form-data'> <form method='POST' action='/update' enctype='multipart/form-data'>
<input type='file' name='update'><input type='submit' value='Update'> <input type='file' name='update'><input type='submit' value='Update'>
</form> </form>
<br> <br>
<button class="js-restart">Restart</button> <button class="js-restart">Restart</button>
</div>
</div> </div>
</div>
</div> </div>
</body> </body>

View File

@@ -8,28 +8,64 @@
; Please visit documentation for the other options and examples ; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html ; http://docs.platformio.org/page/projectconf.html
;[platformio] [platformio]
;env_default = build env_default = build
[common] [common]
framework = arduino framework = arduino
platform = espressif8266@2.0.4 platform = platformio/espressif8266@2.3.2
board = esp12e board = esp12e
upload_speed = 115200 upload_speed = 115200
monitor_baud = 74880 monitor_baud = 115200
lib_deps = lib_deps =
Hash Hash
TaskScheduler TaskScheduler
SPIFFS
ArduinoJson@5.13.4 ArduinoJson@5.13.4
Adafruit NeoPixel adafruit/Adafruit NeoPixel@1.7.0
ESPAsyncTCP me-no-dev/ESPAsyncTCP@1.2.0
me-no-dev/ESPAsyncWebServer@1.2.3
me-no-dev/AsyncTCP@1.1.1
ESP8266mDNS ESP8266mDNS
ESP Async WebServer ;symlink://../../core
https://gitlab.com/wirelos/sprocket-lib.git#develop ;symlink://../../plugins/neopixel
https://gitlab.com/wirelos/sprocket-plugin-neopixel.git https://gitlab.com/wirelos/sprocket-lib.git#master
https://gitlab.com/wirelos/sprocket-plugin-neopixel.git#master
[env:esp01]
src_filter = +<*> -<var/> +<var/wifi/>
platform = ${common.platform}
board = esp01_1m
board_build.f_cpu = 80000000L
board_build.flash_mode = qio
board_build.filesystem = spiffs
board_build.ldscript = eagle.flash.1m256.ld
upload_speed = ${common.upload_speed}
monitor_baud = ${common.monitor_baud}
framework = ${common.framework}
build_flags = -Wl,-Teagle.flash.1m256.ld -DSPROCKET_PRINT=1
lib_deps = ${common.lib_deps}
;symlink://../../network/wifi
;symlink://../../plugins/web
https://gitlab.com/wirelos/sprocket-network-wifi.git#master
https://gitlab.com/wirelos/sprocket-plugin-web.git#master
;[env:build-esp32]
;platform = espressif32
;board = esp32dev
;src_filter = +<*> -<var/> +<var/wifi/>
;upload_speed = ${common.upload_speed}
;monitor_baud = ${common.monitor_baud}
;framework = ${common.framework}
;build_flags = -DSPROCKET_PRINT=1
;lib_deps = ${common.lib_deps}
; symlink://../../network/wifi
; symlink://../../plugins/web
; ;https://gitlab.com/wirelos/sprocket-network-wifi.git#next
; ;https://gitlab.com/wirelos/sprocket-plugin-web.git#next
;
;
[env:build] [env:build]
src_filter = +<*> -<var/> +<var/wifi/> src_filter = +<*> -<var/> +<var/wifi/>
platform = ${common.platform} platform = ${common.platform}
@@ -40,22 +76,10 @@ framework = ${common.framework}
build_flags = -Wl,-Teagle.flash.4m1m.ld build_flags = -Wl,-Teagle.flash.4m1m.ld
-DSPROCKET_PRINT=1 -DSPROCKET_PRINT=1
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
https://gitlab.com/wirelos/sprocket-network-wifi.git#next ;symlink://../../network/wifi
https://gitlab.com/wirelos/sprocket-plugin-web.git#next ;symlink://../../plugins/web
https://gitlab.com/wirelos/sprocket-network-wifi.git#master
https://gitlab.com/wirelos/sprocket-plugin-web.git#master
[env:build-mesh]
src_filter = +<*> -<var/> +<var/wifiMesh/>
platform = ${common.platform}
board = ${common.board}
upload_speed = ${common.upload_speed}
monitor_baud = ${common.monitor_baud}
framework = ${common.framework}
build_flags = -Wl,-Teagle.flash.4m1m.ld
-DSPROCKET_PRINT=1
lib_deps = ${common.lib_deps}
https://gitlab.com/wirelos/painlessMesh.git
https://gitlab.com/wirelos/sprocket-network-mesh.git#forked-mesh
[env:release] [env:release]
src_filter = +<*> -<var/> +<var/wifi/> src_filter = +<*> -<var/> +<var/wifi/>
@@ -67,38 +91,69 @@ framework = ${common.framework}
build_flags = -Wl,-Teagle.flash.4m1m.ld build_flags = -Wl,-Teagle.flash.4m1m.ld
-DSPROCKET_PRINT=0 -DSPROCKET_PRINT=0
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
https://gitlab.com/wirelos/sprocket-network-wifi.git#next ;symlink://../../network/wifi
https://gitlab.com/wirelos/sprocket-plugin-web.git#next ;symlink://../../plugins/web
https://gitlab.com/wirelos/sprocket-network-wifi.git#master
https://gitlab.com/wirelos/sprocket-plugin-web.git#master
[env:mqcatt] ;[env:build-mesh]
src_filter = +<*> -<var/> +<var/mqcatt/> ;src_filter = +<*> -<var/> +<var/wifiMesh/>
platform = ${common.platform} ;platform = ${common.platform}
board = ${common.board} ;board = ${common.board}
upload_speed = ${common.upload_speed} ;upload_speed = ${common.upload_speed}
monitor_baud = ${common.monitor_baud} ;monitor_baud = ${common.monitor_baud}
framework = ${common.framework} ;framework = ${common.framework}
build_flags = -Wl,-Teagle.flash.4m1m.ld ;build_flags = -Wl,-Teagle.flash.4m1m.ld
-DSPROCKET_PRINT=1 ; -DSPROCKET_PRINT=1
lib_deps = ${common.lib_deps} ;lib_deps = ${common.lib_deps}
https://gitlab.com/wirelos/sprocket-network-wifi.git#next ; https://gitlab.com/wirelos/painlessMesh.git
https://gitlab.com/wirelos/sprocket-plugin-web.git#next ; https://gitlab.com/wirelos/sprocket-network-mesh.git#forked-mesh
https://gitlab.com/wirelos/sprocket-plugin-mqtt.git#next ;
PubSubClient ;[env:release]
;src_filter = +<*> -<var/> +<var/wifi/>
[env:illuchat] ;platform = ${common.platform}
src_filter = +<*> -<var/> +<var/illuchat/> ;board = ${common.board}
platform = ${common.platform} ;upload_speed = ${common.upload_speed}
board = ${common.board} ;monitor_baud = ${common.monitor_baud}
upload_speed = ${common.upload_speed} ;framework = ${common.framework}
monitor_baud = ${common.monitor_baud} ;build_flags = -Wl,-Teagle.flash.4m1m.ld
framework = ${common.framework} ; -DSPROCKET_PRINT=0
build_flags = -Wl,-Teagle.flash.4m1m.ld ;lib_deps = ${common.lib_deps}
-DSPROCKET_PRINT=1 ; symlink://../../network/wifi
lib_deps = ${common.lib_deps} ; symlink://../../plugins/web
https://gitlab.com/wirelos/sprocket-network-wifi.git#next ; ;https://gitlab.com/wirelos/sprocket-network-wifi.git#next
https://gitlab.com/wirelos/sprocket-plugin-web.git#next ; ;https://gitlab.com/wirelos/sprocket-plugin-web.git#next
https://gitlab.com/wirelos/sprocket-plugin-irc.git ;
https://gitlab.com/wirelos/sprocket-plugin-mqtt.git#next ;[env:mqcatt]
PubSubClient ;src_filter = +<*> -<var/> +<var/mqcatt/>
ArduinoIRC ;platform = ${common.platform}
;board = ${common.board}
;upload_speed = ${common.upload_speed}
;monitor_baud = ${common.monitor_baud}
;framework = ${common.framework}
;build_flags = -Wl,-Teagle.flash.4m1m.ld
; -DSPROCKET_PRINT=1
;lib_deps = ${common.lib_deps}
; https://gitlab.com/wirelos/sprocket-network-wifi.git#next
; https://gitlab.com/wirelos/sprocket-plugin-web.git#next
; https://gitlab.com/wirelos/sprocket-plugin-mqtt.git#next
; PubSubClient
;
;[env:illuchat]
;src_filter = +<*> -<var/> +<var/illuchat/>
;platform = ${common.platform}
;board = ${common.board}
;upload_speed = ${common.upload_speed}
;monitor_baud = ${common.monitor_baud}
;framework = ${common.framework}
;build_flags = -Wl,-Teagle.flash.4m1m.ld
; -DSPROCKET_PRINT=1
;lib_deps = ${common.lib_deps}
; https://gitlab.com/wirelos/sprocket-network-wifi.git#next
; https://gitlab.com/wirelos/sprocket-plugin-web.git#next
; https://gitlab.com/wirelos/sprocket-plugin-irc.git
; https://gitlab.com/wirelos/sprocket-plugin-mqtt.git#next
; PubSubClient
; ArduinoIRC
;

View File

@@ -7,23 +7,23 @@
#define _TASK_PRIORITY #define _TASK_PRIORITY
// Chip config // Chip config
#define SPROCKET_TYPE "ILLUCAT" #define SPROCKET_TYPE "ILLUCAT"
#define SERIAL_BAUD_RATE 74880 #define SERIAL_BAUD_RATE 115200
#define STARTUP_DELAY 5000 #define STARTUP_DELAY 1000
// Mesh config // Mesh config
#define SPROCKET_MODE 0 #define SPROCKET_MODE 0
#define WIFI_CHANNEL 11 #define WIFI_CHANNEL 11
#define MESH_PORT 5555 #define MESH_PORT 5555
#define AP_SSID "illucat" #define AP_SSID "illucat"
#define AP_PASSWORD "illumination" #define AP_PASSWORD "illumination"
#define MESH_PREFIX "illucat-mesh" #define MESH_PREFIX "illucat-mesh"
#define MESH_PASSWORD "th3r31sn0sp00n" #define MESH_PASSWORD "th3r31sn0sp00n"
#define STATION_SSID "thobens-416257" #define STATION_SSID "MyAP"
#define STATION_PASSWORD "467304645DB5" #define STATION_PASSWORD "th3r31sn0sp00n"
#define HOSTNAME "illucat" #define HOSTNAME "illucat"
#define CONNECT_TIMEOUT 10000 #define CONNECT_TIMEOUT 10000
#define MESH_DEBUG_TYPES ERROR | STARTUP | CONNECTION #define MESH_DEBUG_TYPES ERROR | STARTUP | CONNECTION
//#define MESH_DEBUG_TYPES ERROR | MESH_STATUS | CONNECTION | SYNC | COMMUNICATION | GENERAL | MSG_TYPES | REMOTE //#define MESH_DEBUG_TYPES ERROR | MESH_STATUS | CONNECTION | SYNC | COMMUNICATION | GENERAL | MSG_TYPES | REMOTE
#define PIXEL_CONFIG_FILE "/pixelConfig.json" #define PIXEL_CONFIG_FILE "/pixelConfig.json"
@@ -46,6 +46,5 @@
#define LED_STRIP_DEFAULT_COLOR 100 #define LED_STRIP_DEFAULT_COLOR 100
#define COLOR_CONNECTED LED_STRIP_DEFAULT_COLOR #define COLOR_CONNECTED LED_STRIP_DEFAULT_COLOR
#define COLOR_NOT_CONNECTED 255 #define COLOR_NOT_CONNECTED 255
#define LED_STRIP_DEFAULT_PATTERN 1
#endif #endif

View File

@@ -1,7 +1,6 @@
#include "mqcatt_config.h" #include "mqcatt_config.h"
#include <WiFiNet.h> #include <WiFiNet.h>
#include <Sprocket.h> #include <Sprocket.h>
#include "../../IlluCat.h"
#include <ESPAsyncWebServer.h> #include <ESPAsyncWebServer.h>
#include <WebServerConfig.h> #include <WebServerConfig.h>
#include <WebServerPlugin.h> #include <WebServerPlugin.h>
@@ -22,7 +21,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});
mqttPlugin = new MqttPlugin({MQTT_CLIENT_NAME, MQTT_HOST, MQTT_PORT, MQTT_ROOT_TOPIC, MQTT_USER, MQTT_PASS}); 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);
@@ -43,7 +42,7 @@ void setup()
network->connect(); network->connect();
webServerPlugin->server->serveStatic(PIXEL_CONFIG_FILE, SPIFFS, "pixelConfig.json"); webServerPlugin->server->serveStatic(PIXEL_CONFIG_FILE, SPIFFS, "pixelConfig.json");
webServerPlugin->server->serveStatic(MQTT_CONFIG_FILE, SPIFFS, "config/mqtt.json"); webServerPlugin->server->serveStatic(MQTT_CONFIG_FILE, SPIFFS, "mqttConfig.json");
sprocket->activate(); sprocket->activate();
sprocket->publish("pixels/pattern", "1"); sprocket->publish("pixels/pattern", "1");

View File

@@ -7,25 +7,25 @@
#define _TASK_PRIORITY #define _TASK_PRIORITY
// Chip config // Chip config
#define SPROCKET_TYPE "ILLUCAT" #define SPROCKET_TYPE "ILLUCAT"
#define SERIAL_BAUD_RATE 74880 #define SERIAL_BAUD_RATE 115200
#define STARTUP_DELAY 5000 #define STARTUP_DELAY 1000
// Network config // Network config
#define WIFI_MODE 0 #define WIFI_MODE 0
#define WIFI_CHANNEL 11 #define WIFI_CHANNEL 11
#define AP_SSID "illucat" #define AP_SSID "illucat"
#define AP_PASSWORD "illumination" #define AP_PASSWORD "illumination"
#define MESH_PREFIX "illucat-mesh" #define MESH_PREFIX "illucat-mesh"
#define MESH_PASSWORD "th3r31sn0sp00n" #define MESH_PASSWORD "th3r31sn0sp00n"
#define STATION_SSID "thobens-416257" #define STATION_SSID "MyAP"
#define STATION_PASSWORD "467304645DB5" #define STATION_PASSWORD "th3r31sn0sp00n"
#define HOSTNAME "illucat" #define HOSTNAME "illucat"
#define CONNECT_TIMEOUT 10000 #define CONNECT_TIMEOUT 10000
// config files // config files
#define PIXEL_CONFIG_FILE "/pixelConfig.json" #define PIXEL_CONFIG_FILE "/pixelConfig.json"
#define MQTT_CONFIG_FILE "/config/mqtt.json" #define MQTT_CONFIG_FILE "/mqttConfig.json"
// NeoPixel // NeoPixel
#define LED_STRIP_PIN D2 #define LED_STRIP_PIN D2
@@ -35,19 +35,17 @@
#define LED_STRIP_DEFAULT_COLOR 100 #define LED_STRIP_DEFAULT_COLOR 100
#define COLOR_CONNECTED LED_STRIP_DEFAULT_COLOR #define COLOR_CONNECTED LED_STRIP_DEFAULT_COLOR
#define COLOR_NOT_CONNECTED 255 #define COLOR_NOT_CONNECTED 255
#define LED_STRIP_DEFAULT_PATTERN 1
// OTA config // OTA config
#define OTA_PORT 8266 #define OTA_PORT 8266
#define OTA_PASSWORD "" #define OTA_PASSWORD ""
// mqtt config // mqtt config
#define MQTT_CLIENT_NAME "illucat" #define MQTT_CLIENT_NAME "illucat"
#define MQTT_HOST "192.168.88.110" #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"
#define MQTT_USER ""
#define MQTT_PASS ""
// WebServer // WebServer
#define WEB_CONTEXT_PATH "/" #define WEB_CONTEXT_PATH "/"
@@ -55,4 +53,5 @@
#define WEB_DEFAULT_FILE "index.html" #define WEB_DEFAULT_FILE "index.html"
#define WEB_PORT 80 #define WEB_PORT 80
#endif #endif