Updated documentation and UI
This commit is contained in:
48
README.md
48
README.md
@ -1,8 +1,19 @@
|
|||||||
# Gravity Monitor for Beer Brewing
|
# Gravity Monitor for Beer Brewing
|
||||||
|
|
||||||
I started this project out of curiosity for how a motion sensor is working and since I like to brew beer this was the result. This software can be used with iSpindle hardware and utilizes the same hardware configuration. No part of this software has been copied from that project.
|
I started this project out of curiosity for how a motion sensor is working and since I like to brew beer this was the result. This software can be used with iSpindle hardware and utilizes the same hardware configuration. No code has been reused from the iSpindle project.
|
||||||
|
|
||||||
## Functionallity
|
### TODO
|
||||||
|
|
||||||
|
* Add support for Plato in device (today it assumes that formula is in SG).
|
||||||
|
* Add support for converting between SG/Plato in device.
|
||||||
|
* Add support for InfluxDB as endpoint
|
||||||
|
* Add support for Blynk as endpoint
|
||||||
|
* Add support for https connections (push)
|
||||||
|
* Add support for https web server (will require certificates to be created as part of build process)
|
||||||
|
* Add option to enter SSID/Password as part of build proccess (since WifiManager does not support secure connections)
|
||||||
|
* Add iSpindle 3D print cradle + small PCB (what I use for my builds)
|
||||||
|
|
||||||
|
# Functionallity
|
||||||
|
|
||||||
I have made a few differnt design decision compared to the standard iSpindle software.
|
I have made a few differnt design decision compared to the standard iSpindle software.
|
||||||
|
|
||||||
@ -22,7 +33,7 @@ In this version the software supports sending data to standad HTTP endpoint and
|
|||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Configuration is accessed by entering the URL for the device, this will be the mDNS name __device.local__ or the IP adress.
|
Configuration is accessed by entering the URL for the device, this will be the mDNS name __device.local__ or the IP adress. The following chapter assumes the device name is __gravmon__.
|
||||||
|
|
||||||
### Index page
|
### Index page
|
||||||
|
|
||||||
@ -50,20 +61,33 @@ This page is divided into several categories of settings. The first one contains
|
|||||||
|
|
||||||
The second section contains the push settings, two URL's for http sending and one for Brewfather. The interval setting is the amount of time the device will be in sleep mode between readings (interval is in seconds).
|
The second section contains the push settings, two URL's for http sending and one for Brewfather. The interval setting is the amount of time the device will be in sleep mode between readings (interval is in seconds).
|
||||||
|
|
||||||
This is the format used for standard http posts.
|
### This is the format used for standard http posts.
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
"name" : "gravmon", // mDNS name
|
"name" : "gravmon", // mDNS name
|
||||||
"ID": "gravmon", // mDNS name
|
"ID": "2E6753", // esp device id
|
||||||
"token" : "gravmon",
|
"token" : "gravmon",
|
||||||
"interval": 900,
|
"interval": 900,
|
||||||
"temperature": 20.5,
|
"temperature": 20.5, // C or F based on setting, adjusted value.
|
||||||
"temp-units": "C",
|
"temp-units": "C", // C or F based on setting
|
||||||
"gravity": 1.0050,
|
"gravity": 1.0050, //
|
||||||
"angle": 45.34,
|
"angle": 45.34,
|
||||||
"battery": 3.67,
|
"battery": 3.67,
|
||||||
"rssi": -12,
|
"rssi": -12,
|
||||||
"run-time": 2.30, // Runtime for this reading
|
"run-time": 2.30, // Runtime for this reading, this is an extension
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### This is the format for Brewfather
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"name" : "gravmon", // mDNS name
|
||||||
|
"temp": 20.5,
|
||||||
|
"temp-unit": "C",
|
||||||
|
"battery": 3.67,
|
||||||
|
"gravity": 1.0050,
|
||||||
|
"gravity_unit": "G", // G = SG, Plato is not yet supported
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -71,7 +95,7 @@ This is the format used for standard http posts.
|
|||||||
|
|
||||||
The third section contains the gravity options, formlua and option for temperature correcting gravity.
|
The third section contains the gravity options, formlua and option for temperature correcting gravity.
|
||||||
|
|
||||||
* Gravity formula is compatible with standard iSpindle formulas so any existing calculation option can be used. I use the tool fermentrack for controlling my fermentation and I use this tool for calculating gravity.
|
* Gravity formula is compatible with standard iSpindle formulas so any existing calculation option can be used. I use the tool fermentrack for controlling my fermentation and I use this tool for calculating gravity. The formula can handle two keywords, __tilt__ and __temp__. This is an example of a formula; __0.00145*tilt^3+0.1445*tilt^2+0.00179*tilt+0.9436__
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -91,6 +115,10 @@ Contents version.json
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
# Building a device
|
||||||
|
|
||||||
|
Not yet complete.
|
||||||
|
|
||||||
# Compiling the software
|
# Compiling the software
|
||||||
|
|
||||||
I recommend that VSCODE with PlatformIO and Minfy extensions are used. Minify is used to reduce the size of the HTML files which are embedded into the firmware or uploaded to the file system. When using minify on a file, for example index.htm the output will be called index.min.htm. This is the file that will be used when buildning the image.
|
I recommend that VSCODE with PlatformIO and Minfy extensions are used. Minify is used to reduce the size of the HTML files which are embedded into the firmware or uploaded to the file system. When using minify on a file, for example index.htm the output will be called index.min.htm. This is the file that will be used when buildning the image.
|
||||||
|
@ -156,10 +156,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="push-interval" class="col-sm-4 col-form-label">Interval:</label>
|
<label for="push-interval" class="col-sm-4 col-form-label">Interval (seconds):</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-4">
|
||||||
<input type="number" min="10" max="10000" class="form-control" name="push-interval" id="push-interval">
|
<input type="number" min="10" max="10000" class="form-control" name="push-interval" id="push-interval">
|
||||||
</div>
|
</div>
|
||||||
|
<label for="push-interval" class="col-sm-4 col-form-label" id="push-interval-info"></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-sm-8 offset-sm-4">
|
<div class="col-sm-8 offset-sm-4">
|
||||||
@ -280,6 +281,14 @@
|
|||||||
} );
|
} );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function updatePushInfo() {
|
||||||
|
var i = $("#push-interval").val()
|
||||||
|
$("#push-interval-info").text( Math.floor(i/60) + " m " + (i%60) + " s" )
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trigger the calibration
|
||||||
|
$("#push-interval").keyup(updatePushInfo);
|
||||||
|
|
||||||
function setButtonDisabled( b ) {
|
function setButtonDisabled( b ) {
|
||||||
$("#device-btn").prop("disabled", b);
|
$("#device-btn").prop("disabled", b);
|
||||||
$("#calibrate-btn").prop("disabled", b);
|
$("#calibrate-btn").prop("disabled", b);
|
||||||
@ -293,7 +302,7 @@
|
|||||||
setButtonDisabled( true );
|
setButtonDisabled( true );
|
||||||
|
|
||||||
var url = "/api/config";
|
var url = "/api/config";
|
||||||
//var url = "/test/config.json";
|
var url = "/test/config.json";
|
||||||
$('#spinner').show();
|
$('#spinner').show();
|
||||||
$.getJSON(url, function (cfg) {
|
$.getJSON(url, function (cfg) {
|
||||||
console.log( cfg );
|
console.log( cfg );
|
||||||
@ -326,6 +335,7 @@
|
|||||||
.always(function() {
|
.always(function() {
|
||||||
$('#spinner').hide();
|
$('#spinner').hide();
|
||||||
setButtonDisabled( false );
|
setButtonDisabled( false );
|
||||||
|
updatePushInfo();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
File diff suppressed because one or more lines are too long
@ -118,7 +118,7 @@
|
|||||||
$('#spinner').show();
|
$('#spinner').show();
|
||||||
$.getJSON(url, function (cfg) {
|
$.getJSON(url, function (cfg) {
|
||||||
console.log( cfg );
|
console.log( cfg );
|
||||||
$("#app-ver").text(cfg["app-ver"] + " (html 0.3.0)");
|
$("#app-ver").text(cfg["app-ver"] + " (html 0.3.2)");
|
||||||
$("#mdns").text(cfg["mdns"]);
|
$("#mdns").text(cfg["mdns"]);
|
||||||
$("#id").text(cfg["id"]);
|
$("#id").text(cfg["id"]);
|
||||||
})
|
})
|
||||||
|
@ -14,4 +14,4 @@
|
|||||||
<button type="button" class="btn btn-warning" id="wifi-reset-btn">Factory default settings</button>
|
<button type="button" class="btn btn-warning" id="wifi-reset-btn">Factory default settings</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
--><hr class="my-4"></div><script type="text/javascript">function getConfig(){var n="/api/device";$("#spinner").show(),$.getJSON(n,function(n){console.log(n),$("#app-ver").text(n["app-ver"]+" (html 0.3.0)"),$("#mdns").text(n.mdns),$("#id").text(n.id)}).fail(function(){showError("Unable to get data from the device.")}).always(function(){$("#spinner").hide()})}window.onload=getConfig</script><!-- START FOOTER --><div class="container-fluid themed-container bg-primary text-light">(C) Copyright 2021 Magnus Persson</div></body></html>
|
--><hr class="my-4"></div><script type="text/javascript">function getConfig(){var n="/api/device";$("#spinner").show(),$.getJSON(n,function(n){console.log(n),$("#app-ver").text(n["app-ver"]+" (html 0.3.2)"),$("#mdns").text(n.mdns),$("#id").text(n.id)}).fail(function(){showError("Unable to get data from the device.")}).always(function(){$("#spinner").hide()})}window.onload=getConfig</script><!-- START FOOTER --><div class="container-fluid themed-container bg-primary text-light">(C) Copyright 2021 Magnus Persson</div></body></html>
|
@ -25,7 +25,7 @@ build_flags = #-O0 -Wl,-Map,output.map
|
|||||||
#-D SKIP_SLEEPMODE
|
#-D SKIP_SLEEPMODE
|
||||||
-D USE_LITTLEFS=true
|
-D USE_LITTLEFS=true
|
||||||
-D EMBED_HTML
|
-D EMBED_HTML
|
||||||
-D CFG_APPVER="\"0.3.1\""
|
-D CFG_APPVER="\"0.3.2\""
|
||||||
lib_deps =
|
lib_deps =
|
||||||
# https://github.com/jrowberg/i2cdevlib.git # Using local copy of this library
|
# https://github.com/jrowberg/i2cdevlib.git # Using local copy of this library
|
||||||
https://github.com/codeplea/tinyexpr
|
https://github.com/codeplea/tinyexpr
|
||||||
|
@ -131,7 +131,7 @@ void PushTarget::sendHttp( String serverPath, float angle, float gravity, float
|
|||||||
|
|
||||||
// Use iSpindle format for compatibility
|
// Use iSpindle format for compatibility
|
||||||
doc["name"] = myConfig.getMDNS();
|
doc["name"] = myConfig.getMDNS();
|
||||||
doc["ID"] = myConfig.getMDNS();
|
doc["ID"] = myConfig.getID();
|
||||||
doc["token"] = "gravmon";
|
doc["token"] = "gravmon";
|
||||||
doc["interval"] = myConfig.getPushInterval();
|
doc["interval"] = myConfig.getPushInterval();
|
||||||
doc["temperature"] = reduceFloatPrecision( temp, 1 );
|
doc["temperature"] = reduceFloatPrecision( temp, 1 );
|
||||||
|
Reference in New Issue
Block a user