diff --git a/.github/workflows/pio-build.yaml b/.github/workflows/pio-build.yaml index e08b053..4314c3a 100644 --- a/.github/workflows/pio-build.yaml +++ b/.github/workflows/pio-build.yaml @@ -43,7 +43,7 @@ jobs: uses: karniv00l/platformio-run-action@v1 with: environments: "pressure-32s3_mini,pressure-32s2_mini,pressure-32c3_pico" - jobs: 6 + jobs: 1 silent: false verbose: true disable-auto-clean: false diff --git a/.gitignore b/.gitignore index 11d7055..6878fd9 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ src_docs/.env/ src_docs/_build fp-* _autosave* -*.bak \ No newline at end of file +*.bak +idf_* \ No newline at end of file diff --git a/3d/Pressuremon case.3mf b/3d/Pressuremon case.3mf new file mode 100644 index 0000000..69b0d59 Binary files /dev/null and b/3d/Pressuremon case.3mf differ diff --git a/3d/Pressuremon lid.3mf b/3d/Pressuremon lid.3mf new file mode 100644 index 0000000..e50e8ef Binary files /dev/null and b/3d/Pressuremon lid.3mf differ diff --git a/README.md b/README.md index cb70941..8d3fdca 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,9 @@ ![pr](https://img.shields.io/github/issues-pr/mp-se/pressuremon) ![dev_build](https://img.shields.io/github/actions/workflow/status/mp-se/pressuremon/pio-build.yaml?branch=dev) ![doc_build](https://img.shields.io/github/actions/workflow/status/mp-se/pressuremon/doc-build.yaml?branch=master) +![License](https://img.shields.io/github/license/mp-se/pressuremon) +![GitHub Stars](https://img.shields.io/github/stars/mp-se/pressuremon) +![Last Commit](https://img.shields.io/github/last-commit/mp-se/pressuremon) # Pressure Monitor for Beer Brewing @@ -18,6 +21,8 @@ The documentation can be found [here](https://mp-se.github.io/pressuremon/) PCB design is located [here](https://github.com/mp-se/pcb-designs/) +3D models for a case can be found in the 3d directory on github. + If you want to support my work you can do that through these options [](https://www.buymeacoffee.com/mpse/) [](https://github.com/sponsors/mp-se) diff --git a/bin/firmware32c3pico.bin b/bin/firmware32c3pico.bin index 92d8d76..6736ce8 100644 Binary files a/bin/firmware32c3pico.bin and b/bin/firmware32c3pico.bin differ diff --git a/bin/firmware32s2mini.bin b/bin/firmware32s2mini.bin index fa1d183..7a747e2 100644 Binary files a/bin/firmware32s2mini.bin and b/bin/firmware32s2mini.bin differ diff --git a/bin/firmware32s3mini.bin b/bin/firmware32s3mini.bin index 9ebc45f..06b166c 100644 Binary files a/bin/firmware32s3mini.bin and b/bin/firmware32s3mini.bin differ diff --git a/html/app.css.gz b/html/app.css.gz index dd5634b..1f822a3 100644 Binary files a/html/app.css.gz and b/html/app.css.gz differ diff --git a/html/app.js.gz b/html/app.js.gz index f934ecb..4487d60 100644 Binary files a/html/app.js.gz and b/html/app.js.gz differ diff --git a/html/favicon.ico.gz b/html/favicon.ico.gz index 9675e51..c704f05 100644 Binary files a/html/favicon.ico.gz and b/html/favicon.ico.gz differ diff --git a/platformio.ini b/platformio.ini index 207be0b..8235a1b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -17,16 +17,18 @@ include_dir = lib upload_speed = 460800 monitor_speed = 115200 ; ESP32 - Arduino 2.x -platform32 = espressif32@6.11.0 +platform2 = espressif32@6.11.0 partitions = part32.csv # For arduino 2.x -; ESP32 - Arduino 3.x -; platform32 = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip # Arduino 3.x -; platform32 = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.31/platform-espressif32.zip # Arduino 3.x +; ESP32 - Arduino 3.x - currently too large for the current flash layout +; platform3 = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.35/platform-espressif32.zip +; platform3 = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.32/platform-espressif32.zip +; platform3 = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip # Arduino 3.x ; partitions = part32_2.0Mb.csv # For arduino 3.x (0x1f0000 app size) build_unflags = build_flags = -Wl,-Map,output.map -Os + -g0 -Wno-pedantic -D CORE_DEBUG_LEVEL=0 -D BAUD=${common_env_data.monitor_speed} @@ -34,9 +36,9 @@ build_flags = -D PRESSUREMON=1 -D CFG_APPNAME="\"pressuremon\"" -D CFG_APPVER="\"0.7.0\"" - -D CFG_GITREV=\""beta-2\"" + ; -D CFG_GITREV=\""dev-1\"" + !python script/git_rev.py ; -D CORE_DEBUG_LEVEL=5 - ; !python script/git_rev.py ; -D SKIP_SLEEPMODE=1 ; -D COLLECT_PERFDATA=1 ; -D CORE_DEBUG_LEVEL=2 @@ -51,19 +53,19 @@ build_flags = build_src_flags = -Wno-c++11-extensions lib_deps = - https://github.com/mp-se/espframework#1.2.7 - https://github.com/mp-se/gravitymon#v2.3.0-build1 + https://github.com/mp-se/espframework#1.2.12 + https://github.com/mp-se/gravitymon#v2.4.0-dev1 https://github.com/wollewald/ADS1115_WE#1.5.4 https://github.com/bblanchon/ArduinoJson#v7.4.2 https://github.com/256dpi/arduino-mqtt#v2.5.2 - https://github.com/ESP32Async/ESPAsyncWebServer#v3.8.1 - https://github.com/pstolarz/OneWireNg#0.14.0 + https://github.com/ESP32Async/ESPAsyncWebServer#v3.9.3 + https://github.com/pstolarz/OneWireNg#0.14.1 https://github.com/pstolarz/Arduino-Temperature-Control-Library.git#d2d70abe03299650b860e8ef74d7322d3f305cad https://github.com/ThingPulse/esp8266-oled-ssd1306#4.6.1 https://github.com/stevemarple/SoftWire#v2.0.10 https://github.com/stevemarple/AsyncDelay#v1.1.2 - https://github.com/ESP32Async/AsyncTCP#v3.4.8 - https://github.com/h2zero/NimBLE-Arduino#2.3.6 + https://github.com/ESP32Async/AsyncTCP#v3.4.9 + https://github.com/h2zero/NimBLE-Arduino#2.3.7 extra_scripts = pre:script/board.py script/copy_firmware.py @@ -79,7 +81,7 @@ html_files = upload_speed = ${common_env_data.upload_speed} monitor_speed = ${common_env_data.monitor_speed} framework = arduino -platform = ${common_env_data.platform32} +platform = ${common_env_data.platform2} extra_scripts = ${common_env_data.extra_scripts} build_unflags = ${common_env_data.build_unflags} build_flags = @@ -103,7 +105,7 @@ monitor_filters = esp32_exception_decoder [env:pressure-32s3_mini] ; ESP32-S3 Mini - Full featured with BLE, dual I2C, second sensor support framework = arduino -platform = ${common_env_data.platform32} +platform = ${common_env_data.platform2} upload_speed = ${common_env_data.upload_speed} monitor_speed = ${common_env_data.monitor_speed} extra_scripts = @@ -131,7 +133,7 @@ board_build.embed_txtfiles = ${common_env_data.html_files} [env:pressure-32s2_mini] ; ESP32-S2 Mini - Single I2C (SoftWire for second sensor), no BLE, USB CDC framework = arduino -platform = ${common_env_data.platform32} +platform = ${common_env_data.platform2} upload_speed = ${common_env_data.upload_speed} monitor_speed = ${common_env_data.monitor_speed} extra_scripts = @@ -161,7 +163,7 @@ monitor_filters = esp32_exception_decoder [env:pressure-32c3_pico] ; ESP32-C3 Pico - Compact board with BLE, single I2C (SoftWire for second sensor) framework = arduino -platform = ${common_env_data.platform32} +platform = ${common_env_data.platform2} upload_speed = ${common_env_data.upload_speed} monitor_speed = ${common_env_data.monitor_speed} extra_scripts = @@ -189,4 +191,3 @@ board_build.partitions = ${common_env_data.partitions} board_build.filesystem = littlefs board_build.embed_txtfiles = ${common_env_data.html_files} monitor_filters = esp32_exception_decoder - diff --git a/src/ble_pressuremon.cpp b/src/ble_pressuremon.cpp index 5b9890a..36e145d 100644 --- a/src/ble_pressuremon.cpp +++ b/src/ble_pressuremon.cpp @@ -40,63 +40,16 @@ void BleSender::init() { _initFlag = true; } -/*void BleSender::sendEddystoneData(float battery, float tempC, float -pressurePsi, float pressurePsi1) { Log.info(F("Starting eddystone data -transmission" CR)); - - char beacon_data[25]; - - uint16_t p = pressurePsi * 100; - uint16_t p1 = pressurePsi1 * 100; - uint16_t t = tempC * 1000; - uint16_t b = battery * 1000; - uint32_t chipId = 0; - - for (int i = 0; i < 17; i = i + 8) { - chipId |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i; - } - - beacon_data[0] = 0x20; // Eddystone Frame Type (Unencrypted Eddystone-TLM) - beacon_data[1] = 0x00; // TLM version - beacon_data[2] = (b >> 8); - beacon_data[3] = (b & 0xFF); - beacon_data[4] = (t >> 8); - beacon_data[5] = (t & 0xFF); - beacon_data[6] = (p >> 8); - beacon_data[7] = (p & 0xFF); - beacon_data[8] = (p1 >> 8); - beacon_data[9] = (p1 & 0xFF); - beacon_data[10] = ((chipId & 0xFF000000) >> 24); - beacon_data[11] = ((chipId & 0xFF0000) >> 16); - beacon_data[12] = ((chipId & 0xFF00) >> 8); - beacon_data[13] = (chipId & 0xFF); - - BLEAdvertisementData advData = BLEAdvertisementData(); - BLEAdvertisementData respData = BLEAdvertisementData(); - - respData.setFlags(0x06); - respData.setCompleteServices(BLEUUID("feaa")); - respData.setServiceData(BLEUUID("feaa"), std::string(beacon_data, 14)); - - advData.setName("pressuremon"); - _advertising->setAdvertisementData(advData); - _advertising->setScanResponseData(respData); - - _advertising->start(); - delay(_beaconTime); - _advertising->stop(); -}*/ - void BleSender::sendCustomBeaconData(float battery, float tempC, float pressurePsi, float pressurePsi1) { Log.info(F("Starting custom beacon data transmission" CR)); _advertising->stop(); - uint16_t p = pressurePsi * 100; - uint16_t p1 = pressurePsi1 * 100; + uint16_t p = isnan(pressurePsi) ? 0xffff : pressurePsi * 100; + uint16_t p1 = isnan(pressurePsi1) ? 0xffff : pressurePsi1 * 100; uint16_t t = tempC * 1000; - uint16_t b = battery * 1000; + uint16_t b = isnan(battery) ? 0xffff : battery * 1000; uint32_t chipId = 0; for (int i = 0; i < 17; i = i + 8) { diff --git a/src/ble_pressuremon.hpp b/src/ble_pressuremon.hpp index d3a6b12..aa30473 100644 --- a/src/ble_pressuremon.hpp +++ b/src/ble_pressuremon.hpp @@ -47,8 +47,6 @@ class BleSender { void init(); // Beacons - /*void sendEddystoneData(float battery, float tempC, float pressurePsi, - float pressurePsi1);*/ void sendCustomBeaconData(float battery, float tempC, float pressurePsi, float pressurePsi1); }; diff --git a/src/main_pressuremon.cpp b/src/main_pressuremon.cpp index 2c11ed0..021d774 100644 --- a/src/main_pressuremon.cpp +++ b/src/main_pressuremon.cpp @@ -421,12 +421,12 @@ void loopPressureOnInterval() { #if defined(ENABLE_SECOND_SENSOR) Log.notice( - F("Loop: Pressure=%F, Pressure2=%F, Battery=%F." CR), - myPressureSensor.getPressurePsi(), myPressureSensor1.getPressurePsi(), myBatteryVoltage.getVoltage()); + F("Loop: Pressure=%F, Pressure2=%F, Temp=%F, Battery=%F." CR), + myPressureSensor.getPressurePsi(), myPressureSensor1.getPressurePsi(), myTempSensor.getTempC(), myBatteryVoltage.getVoltage()); #else Log.notice( - F("Loop: Pressure=%F, Battery=%F." CR), - myPressureSensor.getPressurePsi(), myBatteryVoltage.getVoltage()); + F("Loop: Pressure=%F, Temp=%F, Battery=%F." CR), + myPressureSensor.getPressurePsi(), myTempSensor.getTempC(), myBatteryVoltage.getVoltage()); #endif } } diff --git a/src/web_pressuremon.cpp b/src/web_pressuremon.cpp index ba28eb6..7320d3c 100644 --- a/src/web_pressuremon.cpp +++ b/src/web_pressuremon.cpp @@ -133,7 +133,9 @@ void PressuremonWebServer::doWebStatus(JsonObject &obj) { temp = convertCtoF(temp); } - obj[PARAM_TEMP] = serialized(String(temp, DECIMALS_TEMP)); + if(!isnan(temp)) { + obj[PARAM_TEMP] = serialized(String(temp, DECIMALS_TEMP)); + } obj[CONFIG_PRESSURE_UNIT] = myConfig.getPressureUnit(); obj[PARAM_TEMP_UNIT] = String(myConfig.getTempUnit()); diff --git a/src_docs/source/index.rst b/src_docs/source/index.rst index dbb3294..a168983 100644 --- a/src_docs/source/index.rst +++ b/src_docs/source/index.rst @@ -7,7 +7,7 @@ Welcome to PressureMon ###################### .. note:: - This documentation reflects **v0.6.0 - development**. Last updated 2025-06-08 + This documentation reflects **v0.7.0**. Last updated 2025-12-28 What is PressureMon? diff --git a/src_docs/source/releases.rst b/src_docs/source/releases.rst index 5263257..4d38360 100644 --- a/src_docs/source/releases.rst +++ b/src_docs/source/releases.rst @@ -3,6 +3,18 @@ Releases ######## +v0.7.0 +====== + +* Fixed BLE data format when sensor is not available. When data is invalid send 0xffff in the ble payload to indicate that. +* Updated dependencies to latest versions. +* Fixed battery reading setup +* Added meta data to mDNS broadcast (app, version, id), used by GravityMon Gateway to map device id towards name when using BLE. +* Updated code to use NAN instead of -273 as invalid temperature +* Split hardware view into hardware and sensor view for better clarity. +* Updated file view to improve display of device files +* Added 3d model for a case that fits my PCB. + v0.6.0 ======