diff --git a/.github/workflows/compile_development.yml b/.github/workflows/compile_development.yml index ec435880..59460d5c 100644 --- a/.github/workflows/compile_development.yml +++ b/.github/workflows/compile_development.yml @@ -47,7 +47,7 @@ jobs: run: python convert.py - name: Run PlatformIO - run: pio run -d src --environment esp8266-release --environment esp8285-release --environment esp32-wroom32-release + run: pio run -d src --environment esp8266-release --environment esp8266-release-prometheus --environment esp8285-release --environment esp32-wroom32-release --environment esp32-wroom32-release-prometheus - name: Rename Binary files id: rename-binary-files diff --git a/.github/workflows/compile_release.yml b/.github/workflows/compile_release.yml index 91ae35bf..bd7cef5a 100644 --- a/.github/workflows/compile_release.yml +++ b/.github/workflows/compile_release.yml @@ -51,7 +51,7 @@ jobs: run: python convert.py - name: Run PlatformIO - run: pio run -d src --environment esp8266-release --environment esp8285-release --environment esp32-wroom32-release + run: pio run -d src --environment esp8266-release --environment esp8266-release-prometheus --environment esp8285-release --environment esp32-wroom32-release --environment esp32-wroom32-release-prometheus - name: Rename Binary files id: rename-binary-files diff --git a/scripts/getVersion.py b/scripts/getVersion.py index 4ecb714e..77c5816b 100644 --- a/scripts/getVersion.py +++ b/scripts/getVersion.py @@ -56,6 +56,11 @@ def readVersion(path, infile): src = path + ".pio/build/esp8266-release/firmware.bin" dst = path + "firmware/" + versionout os.rename(src, dst) + + versionout = version[:-1] + "_" + sha + "_esp8266_prometheus.bin" + src = path + ".pio/build/esp8266-release-prometheus/firmware.bin" + dst = path + "firmware/" + versionout + os.rename(src, dst) versionout = version[:-1] + "_" + sha + "_esp8285.bin" src = path + ".pio/build/esp8285-release/firmware.bin" @@ -68,6 +73,11 @@ def readVersion(path, infile): dst = path + "firmware/" + versionout os.rename(src, dst) + versionout = version[:-1] + "_" + sha + "_esp32_prometheus.bin" + src = path + ".pio/build/esp32-wroom32-release-prometheus/firmware.bin" + dst = path + "firmware/" + versionout + os.rename(src, dst) + # other ESP32 bin files src = path + ".pio/build/esp32-wroom32-release/" dst = path + "firmware/" diff --git a/src/CHANGES.md b/src/CHANGES.md index 27d64cd7..27937299 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -2,6 +2,16 @@ (starting from release version `0.5.66`) +## 0.5.97 +* Attention: re-ordered display types, check your settings! #746 +* improved saving settings of display #747, #746 +* disabled contrast for Nokia display #746 +* added Prometheus as compile option #719, #615 +* update MQTT lib to v1.4.1 +* limit decimal places to 2 in `live` +* added `-DPIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48` to esp8266 debug build #657 +* a `max-module-power` of `0` disables channel in live view `setup` + ## 0.5.96 * added Nokia display again for ESP8266 #764 * changed `var` / `VAr` to SI unit `var` #732 diff --git a/src/config/settings.h b/src/config/settings.h index 0e118bde..9dcca1c4 100644 --- a/src/config/settings.h +++ b/src/config/settings.h @@ -347,12 +347,12 @@ class settings { mCfg.plugin.display.contrast = 60; mCfg.plugin.display.pxShift = true; mCfg.plugin.display.rot = 0; - mCfg.plugin.display.disp_data = DEF_PIN_OFF; // SDA - mCfg.plugin.display.disp_clk = DEF_PIN_OFF; // SCL - mCfg.plugin.display.disp_cs = DEF_PIN_OFF; + mCfg.plugin.display.disp_data = DEF_PIN_OFF; // SDA + mCfg.plugin.display.disp_clk = DEF_PIN_OFF; // SCL + mCfg.plugin.display.disp_cs = DEF_PIN_OFF; mCfg.plugin.display.disp_reset = DEF_PIN_OFF; - mCfg.plugin.display.disp_busy = DEF_PIN_OFF; - mCfg.plugin.display.disp_dc = DEF_PIN_OFF; + mCfg.plugin.display.disp_busy = DEF_PIN_OFF; + mCfg.plugin.display.disp_dc = DEF_PIN_OFF; } void jsonWifi(JsonObject obj, bool set = false) { diff --git a/src/defines.h b/src/defines.h index f36c147f..13e525bc 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 5 -#define VERSION_PATCH 96 +#define VERSION_PATCH 97 //------------------------------------- typedef struct { diff --git a/src/platformio.ini b/src/platformio.ini index e52cf3fb..6d3f8d23 100644 --- a/src/platformio.ini +++ b/src/platformio.ini @@ -20,12 +20,12 @@ upload_speed = 921600 ;build_flags = ; ;;;;; Possible Debug options ;;;;;; ; https://docs.platformio.org/en/latest/platforms/espressif8266.html#debug-level - ;-DDEBUG_ESP_PORT=Serial + ;-DDEBUG_ESP_PORT=Serial ;-DDEBUG_ESP_CORE - ;-DDEBUG_ESP_WIFI - ;-DDEBUG_ESP_HTTP_CLIENT - ;-DDEBUG_ESP_HTTP_SERVER - ;-DDEBUG_ESP_OOM + ;-DDEBUG_ESP_WIFI + ;-DDEBUG_ESP_HTTP_CLIENT + ;-DDEBUG_ESP_HTTP_SERVER + ;-DDEBUG_ESP_OOM monitor_speed = 115200 @@ -35,18 +35,18 @@ extra_scripts = lib_deps = https://github.com/yubox-node-org/ESPAsyncWebServer - nrf24/RF24 - paulstoffregen/Time - https://github.com/bertmelis/espMqttClient#v1.3.3 - bblanchon/ArduinoJson + nrf24/RF24 + paulstoffregen/Time + https://github.com/bertmelis/espMqttClient#v1.4.1 + bblanchon/ArduinoJson https://github.com/JChristensen/Timezone olikraus/U8g2 zinggjm/GxEPD2@^1.5.0 - ;esp8266/DNSServer - ;esp8266/EEPROM - ;esp8266/ESP8266WiFi - ;esp8266/SPI - ;esp8266/Ticker + ;esp8266/DNSServer + ;esp8266/EEPROM + ;esp8266/ESP8266WiFi + ;esp8266/SPI + ;esp8266/Ticker [env:esp8266-release] @@ -55,8 +55,20 @@ board = esp12e board_build.f_cpu = 80000000L build_flags = -D RELEASE monitor_filters = - ;default ; Remove typical terminal control codes from input - ;time ; Add timestamp with milliseconds for each new line + ;default ; Remove typical terminal control codes from input + ;time ; Add timestamp with milliseconds for each new line + ;log2file ; Log data to a file “platformio-device-monitor-*.log” located in the current working directory + esp8266_exception_decoder + + +[env:esp8266-release-prometheus] +platform = espressif8266 +board = esp12e +board_build.f_cpu = 80000000L +build_flags = -D RELEASE -DENABLE_PROMETHEUS_EP +monitor_filters = + ;default ; Remove typical terminal control codes from input + ;time ; Add timestamp with milliseconds for each new line ;log2file ; Log data to a file “platformio-device-monitor-*.log” located in the current working directory esp8266_exception_decoder @@ -64,11 +76,11 @@ monitor_filters = platform = espressif8266 board = esp12e board_build.f_cpu = 80000000L -build_flags = -DDEBUG_LEVEL=DBG_DEBUG -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_OOM -DDEBUG_ESP_PORT=Serial +build_flags = -DDEBUG_LEVEL=DBG_DEBUG -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_OOM -DDEBUG_ESP_PORT=Serial -DPIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48 build_type = debug monitor_filters = - ;default ; Remove typical terminal control codes from input - time ; Add timestamp with milliseconds for each new line + ;default ; Remove typical terminal control codes from input + time ; Add timestamp with milliseconds for each new line log2file ; Log data to a file “platformio-device-monitor-*.log” located in the current working directory [env:esp8285-release] @@ -78,8 +90,8 @@ board_build.ldscript = eagle.flash.1m64.ld board_build.f_cpu = 80000000L build_flags = -D RELEASE monitor_filters = - ;default ; Remove typical terminal control codes from input - time ; Add timestamp with milliseconds for each new line + ;default ; Remove typical terminal control codes from input + time ; Add timestamp with milliseconds for each new line ;log2file ; Log data to a file “platformio-device-monitor-*.log” located in the current working directory [env:esp8285-debug] @@ -90,8 +102,8 @@ board_build.f_cpu = 80000000L build_flags = -DDEBUG_LEVEL=DBG_DEBUG -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_OOM -DDEBUG_ESP_PORT=Serial build_type = debug monitor_filters = - ;default ; Remove typical terminal control codes from input - time ; Add timestamp with milliseconds for each new line + ;default ; Remove typical terminal control codes from input + time ; Add timestamp with milliseconds for each new line log2file ; Log data to a file “platformio-device-monitor-*.log” located in the current working directory [env:esp32-wroom32-release] @@ -100,8 +112,19 @@ board = lolin_d32 build_flags = -D RELEASE -std=gnu++14 build_unflags = -std=gnu++11 monitor_filters = - ;default ; Remove typical terminal control codes from input - ;time ; Add timestamp with milliseconds for each new line + ;default ; Remove typical terminal control codes from input + ;time ; Add timestamp with milliseconds for each new line + ;log2file ; Log data to a file “platformio-device-monitor-*.log” located in the current working directory + esp32_exception_decoder + +[env:esp32-wroom32-release-prometheus] +platform = espressif32 +board = lolin_d32 +build_flags = -D RELEASE -std=gnu++14 -DENABLE_PROMETHEUS_EP +build_unflags = -std=gnu++11 +monitor_filters = + ;default ; Remove typical terminal control codes from input + ;time ; Add timestamp with milliseconds for each new line ;log2file ; Log data to a file “platformio-device-monitor-*.log” located in the current working directory esp32_exception_decoder @@ -112,6 +135,6 @@ build_flags = -DDEBUG_LEVEL=DBG_DEBUG -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ build_unflags = -std=gnu++11 build_type = debug monitor_filters = - ;default ; Remove typical terminal control codes from input - time ; Add timestamp with milliseconds for each new line + ;default ; Remove typical terminal control codes from input + time ; Add timestamp with milliseconds for each new line log2file ; Log data to a file “platformio-device-monitor-*.log” located in the current working directory diff --git a/src/plugins/Display/Display_Mono.cpp b/src/plugins/Display/Display_Mono.cpp index 57d3cf6b..ad27ebcc 100644 --- a/src/plugins/Display/Display_Mono.cpp +++ b/src/plugins/Display/Display_Mono.cpp @@ -22,6 +22,7 @@ DisplayMono::DisplayMono() { _dispY = 0; mTimeout = DISP_DEFAULT_TIMEOUT; // interval at which to power save (milliseconds) mUtcTs = NULL; + mType = 0; } @@ -29,17 +30,18 @@ DisplayMono::DisplayMono() { void DisplayMono::init(uint8_t type, uint8_t rot, uint8_t cs, uint8_t dc, uint8_t reset, uint8_t clock, uint8_t data, uint32_t *utcTs, const char* version) { if ((0 < type) && (type < 4)) { u8g2_cb_t *rot = (u8g2_cb_t *)((rot != 0x00) ? U8G2_R2 : U8G2_R0); + mType = type; switch(type) { case 1: - mDisplay = new U8G2_PCD8544_84X48_F_4W_SW_SPI(rot, clock, data, cs, dc, reset); - break; - case 2: mDisplay = new U8G2_SSD1306_128X64_NONAME_F_HW_I2C(rot, reset, clock, data); break; default: - case 3: + case 2: mDisplay = new U8G2_SH1106_128X64_NONAME_F_HW_I2C(rot, reset, clock, data); break; + case 3: + mDisplay = new U8G2_PCD8544_84X48_F_4W_SW_SPI(rot, clock, data, cs, dc, reset); + break; } mUtcTs = utcTs; @@ -50,7 +52,8 @@ void DisplayMono::init(uint8_t type, uint8_t rot, uint8_t cs, uint8_t dc, uint8_ calcLineHeights(); mDisplay->clearBuffer(); - mDisplay->setContrast(mLuminance); + if (3 != mType) + mDisplay->setContrast(mLuminance); printText("AHOY!", 0, 35); printText("ahoydtu.de", 2, 20); printText(version, 3, 46); @@ -76,7 +79,8 @@ void DisplayMono::disp(float totalPower, float totalYieldDay, float totalYieldTo mDisplay->clearBuffer(); // set Contrast of the Display to raise the lifetime - mDisplay->setContrast(mLuminance); + if (3 != mType) + mDisplay->setContrast(mLuminance); if ((totalPower > 0) && (isprod > 0)) { mTimeout = DISP_DEFAULT_TIMEOUT; diff --git a/src/plugins/Display/Display_Mono.h b/src/plugins/Display/Display_Mono.h index 1b62328f..ad04c9f4 100644 --- a/src/plugins/Display/Display_Mono.h +++ b/src/plugins/Display/Display_Mono.h @@ -21,6 +21,7 @@ class DisplayMono { U8G2* mDisplay; + uint8_t mType; bool mEnPowerSafe, mEnScreenSaver; uint8_t mLuminance; diff --git a/src/web/RestApi.h b/src/web/RestApi.h index e9479a0b..9b14e439 100644 --- a/src/web/RestApi.h +++ b/src/web/RestApi.h @@ -305,8 +305,8 @@ class RestApi { for(uint8_t j = 0; j < iv->channels; j ++) { obj2[F("ch_yield_cor")][j] = iv->config->yieldCor[j]; - obj2[F("ch_max_power")][j] = iv->config->chMaxPwr[j]; obj2[F("ch_name")][j] = iv->config->chName[j]; + obj2[F("ch_max_pwr")][j] = iv->config->chMaxPwr[j]; } } } @@ -344,6 +344,7 @@ class RestApi { // DC for(uint8_t j = 0; j < iv->channels; j ++) { obj[F("ch_name")][j+1] = iv->config->chName[j]; + obj[F("ch_max_pwr")][j+1] = iv->config->chMaxPwr[j]; JsonArray cur = ch.createNestedArray(); for (uint8_t fld = 0; fld < sizeof(dcList); fld++) { pos = (iv->getPosByChFld((j+1), dcList[fld], rec)); @@ -410,12 +411,12 @@ class RestApi { obj[F("disp_pxshift")] = (bool)mConfig->plugin.display.pxShift; obj[F("disp_rot")] = (uint8_t)mConfig->plugin.display.rot; obj[F("disp_cont")] = (uint8_t)mConfig->plugin.display.contrast; - obj[F("disp_clk")] = mConfig->plugin.display.disp_clk; - obj[F("disp_data")] = mConfig->plugin.display.disp_data; - obj[F("disp_cs")] = mConfig->plugin.display.disp_cs; - obj[F("disp_dc")] = mConfig->plugin.display.disp_dc; - obj[F("disp_rst")] = mConfig->plugin.display.disp_reset; - obj[F("disp_bsy")] = mConfig->plugin.display.disp_busy; + obj[F("disp_clk")] = (mConfig->plugin.display.type == 0) ? DEF_PIN_OFF : mConfig->plugin.display.disp_clk; + obj[F("disp_data")] = (mConfig->plugin.display.type == 0) ? DEF_PIN_OFF : mConfig->plugin.display.disp_data; + obj[F("disp_cs")] = (mConfig->plugin.display.type == 0) ? DEF_PIN_OFF : mConfig->plugin.display.disp_cs; + obj[F("disp_dc")] = (mConfig->plugin.display.type == 0) ? DEF_PIN_OFF : mConfig->plugin.display.disp_dc; + obj[F("disp_rst")] = (mConfig->plugin.display.type == 0) ? DEF_PIN_OFF : mConfig->plugin.display.disp_reset; + obj[F("disp_bsy")] = (mConfig->plugin.display.type == 0) ? DEF_PIN_OFF : mConfig->plugin.display.disp_busy; } void getIndex(JsonObject obj) { diff --git a/src/web/html/setup.html b/src/web/html/setup.html index 53ad13fd..e3188f05 100644 --- a/src/web/html/setup.html +++ b/src/web/html/setup.html @@ -136,6 +136,10 @@
+Note
A 'max module power' value of '0' disables the channel in 'live' view
General