Compare commits

...

9 Commits

Author SHA1 Message Date
Magnus
433502e7a0 Minor updates to docs 2023-02-03 11:05:44 +01:00
Magnus
cd1ada6744
Merge pull request #125 from mp-se/dev
Fix bug in template engine
2023-01-24 21:12:39 +01:00
GitHub Action
22a4f40f41 GitHub Action Build 2023-01-24 20:00:27 +00:00
Magnus
59b95cd68b Revert arduino baseline 2023-01-24 15:21:00 +01:00
Magnus
88c396398d Update release notes 2023-01-23 12:15:28 +01:00
GitHub Action
5477ab4683 GitHub Action Build 2023-01-19 12:02:29 +00:00
Magnus
a8773a7ba1 Fixed templating bug and update test cases 2023-01-19 12:55:46 +01:00
Magnus
71e67ca3f1 Fix shield.io links 2022-12-25 10:36:58 +01:00
Magnus
b76c7a55b4 FIxed ota link under install 2022-12-08 20:26:12 +01:00
19 changed files with 109 additions and 29 deletions

View File

@ -3,8 +3,8 @@
![release](https://img.shields.io/github/v/release/mp-se/gravitymon?label=latest%20release)
![issues](https://img.shields.io/github/issues/mp-se/gravitymon)
![pr](https://img.shields.io/github/issues-pr/mp-se/gravitymon)
![dev_build](https://img.shields.io/github/workflow/status/mp-se/gravitymon/PlatformIO%20CI/dev?label=dev%20build)
![doc_build](https://img.shields.io/github/workflow/status/mp-se/gravitymon/Sphinx%20Build/dev?label=doc%20build)
![dev_build](https://img.shields.io/github/actions/workflow/status/mp-se/gravitymon/pio-build.yaml?branch=dev)
![doc_build](https://img.shields.io/github/actions/workflow/status/mp-se/gravitymon/doc-build.yaml?branch=master)
# Gravity Monitor for Beer Brewing

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
{ "project":"gravmon", "version":"1.2.0", "html": [ ] }
{ "project":"gravmon", "version":"1.2.1", "html": [ ] }

View File

@ -39,21 +39,21 @@ build_flags =
-DUSE_LITTLEFS=true
-DUSER_SSID=\""\"" # =\""myssid\""
-DUSER_SSID_PWD=\""\"" # =\""mypwd\""
-DCFG_APPVER="\"1.2.0\""
-DCFG_APPVER="\"1.2.1\""
#-DCFG_GITREV=\""beta-3\""
!python script/git_rev.py
lib_deps =
# Using local copy of these libraries
# https://github.com/mp-se/i2cdevlib.git#<document>
# https://github.com/mp-se/i2cdevlib.git#<document>
# https://github.com/mp-se/OneWire
# https://github.com/mp-se/Arduino-Temperature-Control-Library
# https://github.com/khoih-prog/ESP_WiFiManager
# https://github.com/khoih-prog/ESP_DoubleResetDetector
https://github.com/mp-se/tinyexpr # https://github.com/codeplea/tinyexpr
https://github.com/mp-se/tinyexpr # https://github.com/codeplea/tinyexpr
https://github.com/mp-se/Arduino-Log#1.1.1 # https://github.com/thijse/Arduino-Log
https://github.com/mp-se/ArduinoJson#v6.18.5 # https://github.com/bblanchon/ArduinoJson
https://github.com/mp-se/arduinoCurveFitting#v1.0.6 # https://github.com/Rotario/arduinoCurveFitting
https://github.com/mp-se/arduino-mqtt#v2.5.0 # https://github.com/256dpi/arduino-mqtt
https://github.com/mp-se/ArduinoJson#v6.18.5 # https://github.com/bblanchon/ArduinoJson
https://github.com/mp-se/arduinoCurveFitting#v1.0.6 # https://github.com/Rotario/arduinoCurveFitting
https://github.com/mp-se/arduino-mqtt#v2.5.0 # https://github.com/256dpi/arduino-mqtt
lib_deps32 =
https://github.com/mp-se/NimBLE-Arduino#1.3.8 # https://github.com/h2zero/NimBLE-Arduino
extra_scripts =
@ -102,8 +102,10 @@ lib_deps =
${common_env_data.lib_deps}
board = ${common_env_data.board}
build_type = release
#build_type = debug
board_build.filesystem = littlefs
build_src_filter = +<*> -<../test/tests*.cpp>
monitor_filters = esp8266_exception_decoder
[env:gravity-unit]
upload_speed = ${common_env_data.upload_speed}
@ -120,9 +122,10 @@ lib_deps =
https://github.com/bxparks/AUnit#v1.6.1
${common_env_data.lib_deps}
board = ${common_env_data.board}
build_type = release
build_type = debug
board_build.filesystem = littlefs
build_src_filter = +<*> -<main.cpp> +<../test/tests*.cpp>
monitor_filters = esp8266_exception_decoder
[env:gravity32-release]
framework = ${common_env_data.framework}

View File

@ -194,4 +194,17 @@ const char* TemplatingEngine::create(TemplatingEngine::Templates idx,
return "";
}
// added to support more unit test scenarios.
const char* TemplatingEngine::create(const char* formatTemplate) {
_baseTemplate = String(formatTemplate);
// Insert data into template.
transform();
_baseTemplate.clear();
if (_output) return _output;
return "";
}
// EOF

View File

@ -160,7 +160,8 @@ class TemplatingEngine {
}
}
}
strncat(_output, format + k, size - k);
// strncat(_output, format + k, size - k);
strncat(_output, format + k, strlen(format + k));
Log.notice(F("TPL : Transformed template %d chars to %d chars" CR),
strlen(format), strlen(_output));
@ -202,6 +203,7 @@ class TemplatingEngine {
float tempC, float runTime);
const char *create(TemplatingEngine::Templates idx,
bool useDefaultTemplate = false);
const char *create(const char *formatTemplate);
};
#endif // SRC_TEMPLATING_HPP_

View File

@ -10,7 +10,7 @@ To reduce the need for adding custom endpoints for various services there is an
.. warning::
Since the format templates can be big this function can be quite slow on a small device such as the esp8266.
If format templates are large this feature can be slow on a small device such as the esp8266.
.. image:: images/format.png
:width: 800

View File

@ -18,11 +18,11 @@
# -- Project information -----------------------------------------------------
project = 'GravityMon'
copyright = '2021-2022, Magnus Persson'
copyright = '2021-2023, Magnus Persson'
author = 'Magnus Persson'
# The full version, including alpha/beta/rc tags
release = '1.2.0'
release = '1.2.1'
# -- General configuration ---------------------------------------------------

View File

@ -165,7 +165,7 @@ Name of organisation in Influx.
* **Influx DB v2 Bucket:**
Identifier for bucket.
Token for bucket. Don't use the bucket name.
* **Influx DB v2 Token:**

View File

@ -7,7 +7,7 @@ Welcome to GravityMon
#####################
.. note::
This documentation reflects **v1.2.0**. Last updated 2022-12-06
This documentation reflects **v1.2.1**. Last updated 2023-02-03
What is GravityMon?
--------------------

View File

@ -97,7 +97,7 @@ OTA Option
You can use the OTA option by adding this URL to your configuration and when the device starts up in configuration mode it
will check for a new version and if it finds a newer version it will do an update.
``https://mp-se.github.io/gravitymon/release/``
``https://gravitymon.com/firmware/``
Manual update
*************

View File

@ -1,6 +1,22 @@
Q & A
#####
User interface does not render correctly
----------------------------------------
Since the user interface is built using bootstrap v5 the device requires access to the internet
to download required javascript and css files. Due to size it would not be possible to store these
on the device. Make sure the device can access: https://cdn.jsdelivr.net/npm/bootstrap
Data is not populated in the fields
------------------------------------
The user interface uses JQuery to fetch data from the device. This javascript library needs to be downloaded
from the internet. Due to size it would not be possible to store these on the device. Make sure the
device can access: https://code.jquery.com
Also ensure that any security tools does not block the execution of these features.
My device is no going in to sleep after fully charged
-----------------------------------------------------
- Calibrate the device in the web interface
@ -11,7 +27,7 @@ My device is no going in to sleep after fully charged
My device reports a temperature of -273C or -491F
-------------------------------------------------
- The DS18B20 temperature sensor cannot be found and this is the default value reported in this case.
- Check the orientation of the sensor and soldering.
- Check the orientation of the sensor and the soldering.
Calibration error (unable to find a valid formula)
--------------------------------------------------
@ -30,18 +46,26 @@ To fix these this you can;
In the case above this parameter was changed from 1.6 SG to 4 SG and the formula was accepted. The deviation on this point was just above 3 SG.
User interface does not render correctly
----------------------------------------
How can I filter data on influxdb without needing to know the time range
------------------------------------------------------------------------
Since the user interface is built using bootstrap v5 the device requires access to the internet
to download required javascript and css files. Due to size it would not be possible to store these
on the device. Make sure the device can access: https://cdn.jsdelivr.net/npm/bootstrap
You can use any of the available fields to enter your custom data. An option is to use the token fields to
add some custom information to identify your brew. This can then be used to filter your data in influxdb.
Data is not populated in the fields
------------------------------------
When you switch brews you need to go in and change the token to identify the brewing session.
The user interface uses JQuery to fetch data from the device. This javascript library needs to be downloaded
from the internet. Due to size it would not be possible to store these on the device. Make sure the
device can access: https://code.jquery.com
Change the format template for the influx target to include the token field. Now you will have an
field called event that you can filter on in influx.
.. code-block::
gravity-format=${gravity-unit} gravity=${gravity},corr-gravity=${corr-gravity},
angle=${angle},temp=${temp},battery=${battery},rssi=${rssi}
to
.. code-block::
gravity-format=${gravity-unit} gravity=${gravity},corr-gravity=${corr-gravity},
angle=${angle},temp=${temp},battery=${battery},rssi=${rssi},event=${token}
Also ensure that any security tools does not block the execution of these features.

View File

@ -3,6 +3,22 @@
Releases
########
v1.2.1
======
Issues adressed
++++++++++++++++
* BUG: Under some circumstances the last part of the format template was omitted.
Other
+++++
* Update tinyexpr library to latest baseline. For forumula evaluation.
Documentation
+++++++++++++
* Minor updates and corrections to the documetation.
* Updated Q&A section
v1.2.0
======

View File

@ -125,4 +125,26 @@ test(template_applyTemplate5) {
assertEqual(s, v);
}
test(template_applyTemplate6) {
TemplatingEngine e;
char buffer[20];
myConfig.setMDNS("gravitymon");
const char* tpl =
"<prtg><result><channel>Densite</channel><float>1</float><value>${gravity}</value></result>"
"<result><channel>Batterie</channel><float>1</float><value>${battery}</value></result>"
"<result><channel>Temperature</channel><float>1</float><value>${temp}</value></result></prtg>";
e.initialize(45.0, 1.123, 1.223, 21.2, 2.98);
String s = e.create(tpl);
String batt =
convertFloatToString(myBatteryVoltage.getVoltage(), &buffer[0], 2);
batt.trim();
String v = "<prtg><result><channel>Densite</channel><float>1</float><value>1.1230</value></result>"
"<result><channel>Batterie</channel><float>1</float><value>" + batt + "</value></result>"
"<result><channel>Temperature</channel><float>1</float><value>21.2</value></result></prtg>";
assertEqual(s, v);
}
// EOF