Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
44bac6617b
|
|||
8b0e6ac390
|
|||
b5413f120b
|
|||
cfa7ef843d
|
|||
a373ebbbfc
|
5
build.sh
5
build.sh
@ -17,7 +17,8 @@ fi
|
|||||||
|
|
||||||
if [ "$1" == "build" ]; then
|
if [ "$1" == "build" ]; then
|
||||||
pushd $PROJECT_DIR/libraries/esp8266boilerplate/ConfigGenerator && ./configGen.sh && popd
|
pushd $PROJECT_DIR/libraries/esp8266boilerplate/ConfigGenerator && ./configGen.sh && popd
|
||||||
env ARDUINO_SKETCHBOOK_DIR=$PROJECT_DIR arduino-cli compile --fqbn=esp8266:esp8266:nodemcu $PROJECT_DIR/sketch
|
# env ARDUINO_SKETCHBOOK_DIR=$PROJECT_DIR arduino-cli compile --fqbn=esp8266:esp8266:nodemcu $PROJECT_DIR/sketch
|
||||||
|
docker run -it --rm -v $PWD:/mnt registry.hottis.de/dockerized/build-env-arduino:latest env ARDUINO_SKETCHBOOK_DIR=/mnt arduino-cli compile -v --fqbn=esp8266:esp8266:nodemcu /mnt/sketch
|
||||||
cp sketch/sketch.esp8266.esp8266.nodemcu.* .
|
cp sketch/sketch.esp8266.esp8266.nodemcu.* .
|
||||||
elif [ "$1" == "clean" ]; then
|
elif [ "$1" == "clean" ]; then
|
||||||
for D in libraries/includes/configuration.h libraries/includes/configuration.cpp sketch/sketch.esp8266.esp8266.nodemcu.bin sketch/sketch.esp8266.esp8266.nodemcu.elf sketch.esp8266.esp8266.nodemcu.bin sketch.esp8266.esp8266.nodemcu.elf; do
|
for D in libraries/includes/configuration.h libraries/includes/configuration.cpp sketch/sketch.esp8266.esp8266.nodemcu.bin sketch/sketch.esp8266.esp8266.nodemcu.elf sketch.esp8266.esp8266.nodemcu.bin sketch.esp8266.esp8266.nodemcu.elf; do
|
||||||
@ -26,7 +27,7 @@ elif [ "$1" == "clean" ]; then
|
|||||||
done
|
done
|
||||||
elif [ "$1" == "upload" ]; then
|
elif [ "$1" == "upload" ]; then
|
||||||
echo "About to upload to device"
|
echo "About to upload to device"
|
||||||
esptool.py --port /dev/ttyUSB1 write_flash 0 sketch.esp8266.esp8266.nodemcu.bin
|
esptool --port /dev/ttyUSB0 write_flash 0 sketch.esp8266.esp8266.nodemcu.bin
|
||||||
else
|
else
|
||||||
echo "Unknown subcommand '$1'"
|
echo "Unknown subcommand '$1'"
|
||||||
exit 1
|
exit 1
|
||||||
|
Submodule libraries/esp8266mqttboilerplate updated: 50a1c84f30...eb6a11bf7d
@ -8,7 +8,7 @@
|
|||||||
#ifndef DEFINES_H_
|
#ifndef DEFINES_H_
|
||||||
#define DEFINES_H_
|
#define DEFINES_H_
|
||||||
|
|
||||||
// #define DEBUG
|
#define DEBUG
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -29,7 +29,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WS2811
|
#ifdef WS2811
|
||||||
#define PIXEL_PIN 1 // NODEMCU numbering
|
#ifdef ESP01
|
||||||
|
#define PIXEL_PIN 2
|
||||||
|
#endif
|
||||||
|
#ifdef NODEMCU
|
||||||
|
#define PIXEL_PIN D1
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PL9823
|
#ifdef PL9823
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"releaseTag": "v1.0.5",
|
"releaseTag": "v1.0.7",
|
||||||
"createReleaseTag": "true",
|
"createReleaseTag": "true",
|
||||||
"releaseName": "reset on wifi disconnect",
|
"releaseName": "colorPattern and watchdog",
|
||||||
"description": "in case of wifi disconnect trigger a reset of the system"
|
"description": "introduce the colorPattern config option (swap R and G) and use the mqtt boilerplate code with watchdog support"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,8 +11,10 @@ configItems = [
|
|||||||
{"label":"MQTT Topic Color Command", "key":"mqttTopicColorCommand", "type":"C", "length":64, "default":"IoT/RgbLed1/ColorCommand"},
|
{"label":"MQTT Topic Color Command", "key":"mqttTopicColorCommand", "type":"C", "length":64, "default":"IoT/RgbLed1/ColorCommand"},
|
||||||
{"label":"MQTT Topic Command", "key":"mqttTopicCommand", "type":"C", "length":64, "default":"IoT/RgbLed1/Command"},
|
{"label":"MQTT Topic Command", "key":"mqttTopicCommand", "type":"C", "length":64, "default":"IoT/RgbLed1/Command"},
|
||||||
{"label":"MQTT DebugTopic", "key":"mqttDebugTopic", "type":"C", "length":64, "default":"IoT/RgbLed1/Debug"},
|
{"label":"MQTT DebugTopic", "key":"mqttDebugTopic", "type":"C", "length":64, "default":"IoT/RgbLed1/Debug"},
|
||||||
|
{"label":"MQTT WatchdogTopic", "key":"mqttWatchdogTopic", "type":"C", "length":64, "default":"IoT/Watchdog"},
|
||||||
|
{"label":"Color pattern (rgb=0, grb=1", "key":"colorPattern", "type":"I", "default":0},
|
||||||
{"label":"DebugMode", "key":"debugMode", "type":"I", "default":0}
|
{"label":"DebugMode", "key":"debugMode", "type":"I", "default":0}
|
||||||
]
|
]
|
||||||
|
|
||||||
magic = 3235774470
|
magic = 3235774475
|
||||||
appName = "ESP8266 based RGB-LED-Light"
|
appName = "ESP8266 based RGB-LED-Light"
|
||||||
|
@ -43,7 +43,7 @@ typedef struct {
|
|||||||
|
|
||||||
|
|
||||||
// Adafruit_NeoPixel pixels(NUM_OF_LEDs, PIXEL_PIN, NEO_RGB + NEO_KHZ400);
|
// Adafruit_NeoPixel pixels(NUM_OF_LEDs, PIXEL_PIN, NEO_RGB + NEO_KHZ400);
|
||||||
Adafruit_NeoPixel pixels(NUM_OF_LEDs, PIXEL_PIN, NEO_GRB + NEO_KHZ800);
|
Adafruit_NeoPixel pixels(NUM_OF_LEDs, PIXEL_PIN, NEO_RGB + NEO_KHZ800);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool show = false;
|
bool show = false;
|
||||||
@ -102,7 +102,23 @@ void subscribeApplication() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void setColor(int16_t ledNumber, uint8_t red, uint8_t green, uint8_t blue) {
|
static void setColor(int16_t ledNumber, uint8_t x, uint8_t y, uint8_t z) {
|
||||||
|
uint8_t red, green, blue;
|
||||||
|
|
||||||
|
switch (configBlock.colorPattern) {
|
||||||
|
case 1:
|
||||||
|
red = y;
|
||||||
|
green = x;
|
||||||
|
blue = z;
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
red = x;
|
||||||
|
green = y;
|
||||||
|
blue = z;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (ledNumber == -1) {
|
if (ledNumber == -1) {
|
||||||
for (uint16_t i = 0; i < NUM_OF_LEDs; i++) {
|
for (uint16_t i = 0; i < NUM_OF_LEDs; i++) {
|
||||||
#ifdef WS2811
|
#ifdef WS2811
|
||||||
@ -188,6 +204,7 @@ void callbackApplication(char *topic, uint8_t tokenCnt, char **tokens) {
|
|||||||
void setupApplication() {
|
void setupApplication() {
|
||||||
mqttSetup();
|
mqttSetup();
|
||||||
|
|
||||||
|
|
||||||
#ifdef WS2811
|
#ifdef WS2811
|
||||||
FastLED.addLeds<NEOPIXEL, PIXEL_PIN>(leds, NUM_OF_LEDs);
|
FastLED.addLeds<NEOPIXEL, PIXEL_PIN>(leds, NUM_OF_LEDs);
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user