From 970d05191c4a3ca8b10af51bd52de0849306596a Mon Sep 17 00:00:00 2001 From: Thomas Hooge Date: Sun, 12 Jan 2025 18:01:54 +0100 Subject: [PATCH 1/2] Fix missing data bindings for page fluid --- lib/obp60task/PageFluid.cpp | 16 +++++++++++----- lib/obp60task/config.json | 31 +++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/lib/obp60task/PageFluid.cpp b/lib/obp60task/PageFluid.cpp index 9d4a092..c01e83b 100644 --- a/lib/obp60task/PageFluid.cpp +++ b/lib/obp60task/PageFluid.cpp @@ -59,11 +59,13 @@ static unsigned char gasoline_bits[] = { class PageFluid : public Page{ bool keylock = false; // Keylock + bool holdvalues = false; int fluidtype; public: PageFluid(CommonData &common){ common.logger->logDebug(GwLog::LOG,"Instantiate PageFluid"); + holdvalues = common.config->getBool(common.config->holdvalues); } virtual int handleKey(int key){ @@ -83,6 +85,9 @@ class PageFluid : public Page{ GwConfigHandler *config = commonData.config; GwLog *logger=commonData.logger; + // Old values for hold function + static double value1old; + // Get config data String flashLED = config->getString(config->flashLED); String backlightMode = config->getString(config->backlight); @@ -93,13 +98,14 @@ class PageFluid : public Page{ setFlashLED(false); } - // Logging boat values - LOG_DEBUG(GwLog::LOG,"Drawing at PageFluid"); - GwApi::BoatValue *bvalue1 = pageData.values[0]; String name1 = bvalue1->getName(); - double value1 = bvalue1->value; - bool valid1 = bvalue1->valid; + if (holdvalues and bvalue1->valid) { + value1old = bvalue1->value; + } + + // Logging boat values + LOG_DEBUG(GwLog::LOG,"Drawing at PageFluid: value=%f", bvalue1->value); // Draw page //*********************************************************** diff --git a/lib/obp60task/config.json b/lib/obp60task/config.json index 30dbb76..49ac39d 100644 --- a/lib/obp60task/config.json +++ b/lib/obp60task/config.json @@ -1012,6 +1012,9 @@ }, { "page1type": "WindRoseFlex" + }, + { + "page1type": "Fluid" } ] }, @@ -1266,7 +1269,11 @@ }, { "page2type": "WindRoseFlex" + }, + { + "page2type": "Fluid" } + ] }, { @@ -1517,6 +1524,9 @@ }, { "page3type": "WindRoseFlex" + }, + { + "page3type": "Fluid" } ] }, @@ -1765,6 +1775,9 @@ }, { "page4type": "WindRoseFlex" + }, + { + "page4type": "Fluid" } ] }, @@ -2010,6 +2023,9 @@ }, { "page5type": "WindRoseFlex" + }, + { + "page5type": "Fluid" } ] }, @@ -2252,6 +2268,9 @@ }, { "page6type": "WindRoseFlex" + }, + { + "page6type": "Fluid" } ] }, @@ -2491,6 +2510,9 @@ }, { "page7type": "WindRoseFlex" + }, + { + "page7type": "Fluid" } ] }, @@ -2727,6 +2749,9 @@ }, { "page8type": "WindRoseFlex" + }, + { + "page8type": "Fluid" } ] }, @@ -2960,6 +2985,9 @@ }, { "page9type": "WindRoseFlex" + }, + { + "page9type": "Fluid" } ] }, @@ -3190,6 +3218,9 @@ }, { "page10type": "WindRoseFlex" + }, + { + "page10type": "Fluid" } ] }, From 9fc090a5a8c7f89c794ec6f23ea544c442ef779c Mon Sep 17 00:00:00 2001 From: norbert-walter Date: Sun, 12 Jan 2025 23:50:38 +0100 Subject: [PATCH 2/2] Fix flag error in platformio.ini --- lib/obp60task/platformio.ini | 12 +++--- lib/obp60task/platformio.ini.orig | 61 +++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 lib/obp60task/platformio.ini.orig diff --git a/lib/obp60task/platformio.ini b/lib/obp60task/platformio.ini index d11edcf..9485522 100644 --- a/lib/obp60task/platformio.ini +++ b/lib/obp60task/platformio.ini @@ -9,10 +9,10 @@ board_build.variants_dir = variants #board = obp60_s3_n8 #ESP32-S3 N8, 8MB flash, no PSRAM #board = obp60_s3_n16 #ESP32-S3 N16,16MB flash, no PSRAM, zero series #board = obp60_s3_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM -#board = obp60_s3_n16r8 #ESP32-S3 N16R8, 16MB flash, 8MB PSRAM, production series -board = obp60_s3_light_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM, OBP60 clone -board_build.partitions = default_8MB.csv #ESP32-S3 N8, 8MB flash -#board_build.partitions = default_16MB.csv #ESP32-S3 N16, 16MB flash +board = obp60_s3_n16r8 #ESP32-S3 N16R8, 16MB flash, 8MB PSRAM, production series +#board = obp60_s3_light_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM, OBP60 clone +#board_build.partitions = default_8MB.csv #ESP32-S3 N8, 8MB flash +board_build.partitions = default_16MB.csv #ESP32-S3 N16, 16MB flash framework = arduino lib_deps = ${basedeps.lib_deps} @@ -46,8 +46,8 @@ build_flags= -D DISABLE_DIAGNOSTIC_OUTPUT #Disable diagnostic output for GxEPD2 lib -D BOARD_OBP60S3 #Board OBP60 V2.1 with ESP32S3 # -D HARDWARE_V20 #OBP60 hardware revision V2.0 -# -D HARDWARE_V21 #OBP60 hardware revision V2.1 - -D HARDWARE_LIGHT #OBP60 hardware clone + -D HARDWARE_V21 #OBP60 hardware revision V2.1 +# -D HARDWARE_LIGHT #OBP60 hardware clone # -D DISPLAY_GDEW042T2 #old E-Ink display from Waveshare, R10 0.47 ohm -D DISPLAY_GDEY042T81 #new E-Ink display from Waveshare, R10 2.2 ohm # -D DISPLAY_GYE042A87 #alternativ E-Ink display from Genyo Optical, R10 2.2 ohm diff --git a/lib/obp60task/platformio.ini.orig b/lib/obp60task/platformio.ini.orig new file mode 100644 index 0000000..9485522 --- /dev/null +++ b/lib/obp60task/platformio.ini.orig @@ -0,0 +1,61 @@ +[platformio] +#if you want a pio run to only build +#your special environments you can set this here +#by uncommenting the next line +default_envs = obp60_s3 +[env:obp60_s3] +platform = espressif32@6.8.1 +board_build.variants_dir = variants +#board = obp60_s3_n8 #ESP32-S3 N8, 8MB flash, no PSRAM +#board = obp60_s3_n16 #ESP32-S3 N16,16MB flash, no PSRAM, zero series +#board = obp60_s3_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM +board = obp60_s3_n16r8 #ESP32-S3 N16R8, 16MB flash, 8MB PSRAM, production series +#board = obp60_s3_light_n8r8 #ESP32-S3 N8R8, 8MB flash, 8MB PSRAM, OBP60 clone +#board_build.partitions = default_8MB.csv #ESP32-S3 N8, 8MB flash +board_build.partitions = default_16MB.csv #ESP32-S3 N16, 16MB flash +framework = arduino +lib_deps = + ${basedeps.lib_deps} + Wire + SPI + esphome/AsyncTCP-esphome@2.0.1 + robtillaart/PCF8574@0.3.9 + adafruit/Adafruit Unified Sensor @ 1.1.13 + blemasle/MCP23017@2.0.0 + adafruit/Adafruit BusIO@1.5.0 + adafruit/Adafruit GFX Library@1.11.9 + #zinggjm/GxEPD2@1.5.8 + #https://github.com/ZinggJM/GxEPD2 + https://github.com/thooge/GxEPD2 + sstaub/Ticker@4.4.0 + adafruit/Adafruit BMP280 Library@2.6.2 + adafruit/Adafruit BME280 Library@2.2.2 + adafruit/Adafruit BMP085 Library@1.2.1 + enjoyneering/HTU21D@1.2.1 + robtillaart/INA226@0.2.0 + paulstoffregen/OneWire@2.3.8 + milesburton/DallasTemperature@3.11.0 + signetica/SunRise@2.0.2 + adafruit/Adafruit FRAM I2C@^2.0.3 +build_flags= + #https://thingpulse.com/usb-settings-for-logging-with-the-esp32-s3-in-platformio/?srsltid=AfmBOopGskbkr4GoeVkNlFaZXe_zXkLceKF6Rn-tmoXABCeAR2vWsdHL +# -D ARDUINO_USB_MODE=1 #0=OTG (to implement other external devices), 1=CDC (is a serial device) +# -D ARDUINO_USB_CDC_ON_BOOT=1 #0=JTAG, 1=CDC (serial device) +# -D CORE_DEBUG_LEVEL=1 #Debug level for CPU core via CDC (seral device) +# -D TIME=$UNIX_TIME #Set PC time for RTC (only settable via VSC) + -D DISABLE_DIAGNOSTIC_OUTPUT #Disable diagnostic output for GxEPD2 lib + -D BOARD_OBP60S3 #Board OBP60 V2.1 with ESP32S3 +# -D HARDWARE_V20 #OBP60 hardware revision V2.0 + -D HARDWARE_V21 #OBP60 hardware revision V2.1 +# -D HARDWARE_LIGHT #OBP60 hardware clone +# -D DISPLAY_GDEW042T2 #old E-Ink display from Waveshare, R10 0.47 ohm + -D DISPLAY_GDEY042T81 #new E-Ink display from Waveshare, R10 2.2 ohm +# -D DISPLAY_GYE042A87 #alternativ E-Ink display from Genyo Optical, R10 2.2 ohm +# -D DISPLAY_SE0420NQ04 #alternativ E-Ink display from SID Technology, R10 2.2 ohm + ${env.build_flags} +#CONFIG_ESP_TASK_WDT_TIMEOUT_S = 10 #Task Watchdog timeout period (seconds) [1...60] 5 default +#upload_port = /dev/ttyACM0 #OBP60 original +upload_port = /dev/ttyUSB0 #OBP60 clone +upload_protocol = esptool #firmware upload via USB OTG seriell, by first upload need to set the ESP32-S3 in the upload mode with shortcut GND to Pin27 +upload_speed = 230400 +monitor_speed = 115200