Skip to content

Commit

Permalink
Added build section to matrix and telemetry info
Browse files Browse the repository at this point in the history
  • Loading branch information
foorschtbar committed Oct 13, 2023
1 parent 788db9f commit 1895a6c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 22 deletions.
60 changes: 38 additions & 22 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,30 @@ extra_scripts = pre:extra_script.py
build_flags =
-DMATRIX_WIDTH=32 ; Pixel cols
-DMATRIX_HEIGHT=8 ; Pixel rows
esp32_build_flags =
${common.build_flags}
-DLDR_PIN=A0
-DMATRIX_PIN=27
-DDEFAULT_PIN_SCL="Pin_D1"
-DDEFAULT_PIN_SDA="Pin_D3"
-DDEFAULT_PIN_DFPRX="Pin_D7"
-DDEFAULT_PIN_DFPTX="Pin_D8"
-DDEFAULT_PIN_ONEWIRE="Pin_D1"
-DDEFAULT_MATRIX_TYPE=1
-DDEFAULT_LDR=GL5516
-DVBAT_PIN=0
esp8266_build_flags =
${common.build_flags}
-DLDR_PIN=A0
-DMATRIX_PIN=D2
-DDEFAULT_PIN_SCL="Pin_D1"
-DDEFAULT_PIN_SDA="Pin_D3"
-DDEFAULT_PIN_DFPRX="Pin_D7"
-DDEFAULT_PIN_DFPTX="Pin_D8"
-DDEFAULT_PIN_ONEWIRE="Pin_D1"
-DDEFAULT_MATRIX_TYPE=1
-DDEFAULT_LDR=GL5516
-DVBAT_PIN=0
lib_deps =
adafruit/Adafruit BME280 Library@^2.0.2
adafruit/Adafruit BME680 Library@^2.0.1
Expand Down Expand Up @@ -48,17 +72,8 @@ monitor_speed = ${common.monitor_speed}
extra_scripts = ${common.extra_scripts}
upload_speed = ${common.upload_speed}
build_flags =
${common.build_flags}
-DLDR_PIN=A0
-DMATRIX_PIN=27
-DDEFAULT_PIN_SCL="Pin_D1"
-DDEFAULT_PIN_SDA="Pin_D3"
-DDEFAULT_PIN_DFPRX="Pin_D7"
-DDEFAULT_PIN_DFPTX="Pin_D8"
-DDEFAULT_PIN_ONEWIRE="Pin_D1"
-DDEFAULT_MATRIX_TYPE=1
-DDEFAULT_LDR=GL5516
-DVBAT_PIN=0
${common.esp32_build_flags}
-DBUILD_SECTION="ESP32_generic"
platform_packages =
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.14
toolchain-xtensa32@~2.80400.0
Expand All @@ -78,17 +93,8 @@ monitor_speed = ${common.monitor_speed}
extra_scripts = ${common.extra_scripts}
upload_speed = ${common.upload_speed}
build_flags =
${common.build_flags}
-DLDR_PIN=A0
-DMATRIX_PIN=D2
-DDEFAULT_PIN_SCL="Pin_D1"
-DDEFAULT_PIN_SDA="Pin_D3"
-DDEFAULT_PIN_DFPRX="Pin_D7"
-DDEFAULT_PIN_DFPTX="Pin_D8"
-DDEFAULT_PIN_ONEWIRE="Pin_D1"
-DDEFAULT_MATRIX_TYPE=1
-DDEFAULT_LDR=GL5516
-DVBAT_PIN=0
${common.esp8266_build_flags}
-DBUILD_SECTION="ESP8266_generic"
lib_deps =
${common.lib_deps}
mr-glt/SHA-1 Hash@^1.1.0
Expand All @@ -98,14 +104,23 @@ lib_deps =
extends = env:ESP8266_generic
monitor_filters = esp8266_exception_decoder
board = d1_mini
build_flags =
${common.esp8266_build_flags}
-DBUILD_SECTION='ESP8266_d1_mini'

[env:ESP8266_nodemcuv2]
extends = env:ESP8266_generic
board = nodemcuv2
build_flags =
${common.esp8266_build_flags}
-DBUILD_SECTION="ESP8266_nodemcuv2"

[env:ESP32_d1_mini32]
extends = env:ESP32_generic
board = wemos_d1_mini32
build_flags =
${common.esp32_build_flags}
-DBUILD_SECTION="ESP32_d1_mini32"

[env:ESP32_ulanzi]
extends = env:ESP32_generic
Expand All @@ -124,3 +139,4 @@ build_flags =
-DDEFAULT_LDR=GL5516
-DMIN_BATTERY=475
-DMAX_BATTERY=665
-DBUILD_SECTION="ESP32_ulanzi"
5 changes: 5 additions & 0 deletions src/PixelIt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
// Version config - will be replaced by build piple with Git-Tag!
#define VERSION "0.0.0-beta" // will be replaced by build piple with Git-Tag!

// Workaround for String in defines
#define XSTR(x) #x
#define STR(x) XSTR(x)

Expand Down Expand Up @@ -2035,6 +2036,7 @@ String GetMatrixInfo()
//// Matrix Config
root["note"] = note;
root["hostname"] = hostname;
root["buildSection"] = STR(BUILD_SECTION);
root["freeSketchSpace"] = ESP.getFreeSketchSpace();
root["wifiRSSI"] = WiFi.RSSI();
root["wifiQuality"] = GetRSSIasQuality(WiFi.RSSI());
Expand Down Expand Up @@ -2103,10 +2105,13 @@ String GetTelemetry()
root["uuid"] = sha1(GetChipID());
root["version"] = VERSION;
root["type"] = isESP8266 ? "esp8266" : "esp32";
root["buildSection"] = STR(BUILD_SECTION);

JsonObject &matrix = root.createNestedObject("matrix");
matrix["type"] = matrixType;
matrix["name"] = MatrixTypeNames[matrixType - 1];
matrix["width"] = MATRIX_WIDTH;
matrix["height"] = MATRIX_HEIGHT;

JsonArray &sensors = root.createNestedArray("sensors");
sensors.add(LuxSensorNames[luxSensor]);
Expand Down

0 comments on commit 1895a6c

Please sign in to comment.