Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
3d4c04333e | |||
2e3820ca73 | |||
d52615f8e3 | |||
786b8e9b19 | |||
10fa71d7ca | |||
aeda821396 | |||
3db3968e07 | |||
430f01943a | |||
ca97a586c1 | |||
5c80b780a0 | |||
2e42b86444 | |||
acb53bf611 | |||
5b99304d7f | |||
d94028a7b9 | |||
f4ca86e8ff | |||
2c9f5c72f2 | |||
f5aae4f2ea | |||
51daa23327 | |||
a5fb4f40b9 | |||
17e9b0d51b | |||
2877f91ef8 | |||
8dd509214b |
2
.github/workflows/pio-build.yaml
vendored
2
.github/workflows/pio-build.yaml
vendored
@ -36,7 +36,7 @@ jobs:
|
||||
git config --global advice.detachedHead false
|
||||
|
||||
- name: Run PlatformIO
|
||||
run: pio run -e gravity-release -e gravity-perf -e gravity32-release
|
||||
run: pio run -e gravity-release -e gravity-perf -e gravity32-release -e gravity32-perf
|
||||
|
||||
- uses: EndBug/add-and-commit@v7 # You can change this to use a specific version. https://github.com/marketplace/actions/add-commit
|
||||
with:
|
||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
BIN
bin/firmware.bin
BIN
bin/firmware.bin
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -445,6 +445,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-8 offset-sm-2">
|
||||
<button class="btn btn-info" id="firmware-btn">Upload firmware</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -529,6 +534,10 @@ function checkHeader(input) {
|
||||
} );
|
||||
});
|
||||
|
||||
$("#firmware-btn").click(function(e){
|
||||
window.location.href = "/firmware.htm";
|
||||
});
|
||||
|
||||
// Open the format editor
|
||||
$("#format-btn").click(function(e){
|
||||
window.location.href = "/format.htm";
|
||||
|
File diff suppressed because one or more lines are too long
@ -21,6 +21,11 @@
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbar">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="javascript:history.back()">Back to configuration</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="spinner-border text-light" id="spinner" role="status"></div>
|
||||
</div>
|
||||
</nav>
|
||||
@ -80,7 +85,7 @@
|
||||
-->
|
||||
<form id="uploadForm" enctype="multipart/form-data">
|
||||
<div class="col-md-8 custom-file">
|
||||
<input type="file" accept=".bin" class="custom-file-input" name="name" id="name">
|
||||
<input type="file" accept=".bin" class="custom-file-input" name="name" id="name" onchange="checkName()">
|
||||
<label class="custom-file-label" for="name">Choose file</label>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary" id="upload-btn" value="upload">Flash firmware</button>
|
||||
@ -132,6 +137,10 @@
|
||||
});
|
||||
});
|
||||
|
||||
function checkName() {
|
||||
setButtonDisabled( $("#name").val()!="" ? false : true );
|
||||
}
|
||||
|
||||
function progressHandler(event) {
|
||||
var percent = (event.loaded / event.total) * 100;
|
||||
setProgress(Math.round(percent));
|
||||
@ -141,7 +150,14 @@
|
||||
$('.progress-bar').css('width', val+'%').attr('aria-valuenow', val).text(val + "%");
|
||||
}
|
||||
|
||||
function setButtonDisabled( b ) {
|
||||
$("#upload-btn").prop("disabled", b);
|
||||
}
|
||||
|
||||
function getStatus() {
|
||||
|
||||
setButtonDisabled( true );
|
||||
|
||||
var url = "/api/status";
|
||||
//var url = "/test/status.json";
|
||||
$('#spinner').show();
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="description" content=""><title>Beer Gravity Monitor</title><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous"><script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script><script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-fQybjgWLrvvRgtW6bFlB7jaZrFsaBXjsOMm/tB9LTS58ONXgqbR9W8oWht/amnpF" crossorigin="anonymous"></script></head><body class="py-4"><!-- START MENU --><nav class="navbar navbar-expand-sm navbar-dark bg-primary"><a class="navbar-brand" href="/firmware.htm">Beer Gravity Monitor - Firmware upgrade</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button><div class="collapse navbar-collapse" id="navbar"><div class="spinner-border text-light" id="spinner" role="status"></div></div></nav><!-- START MAIN INDEX --><div class="container"><hr class="my-4"><div class="alert alert-success alert-dismissible fade hide show d-none" role="alert" id="alert"><div id="alert-msg">...</div><button type="button" id="alert-btn" class="close" aria-label="Close"><span aria-hidden="true">×</span></button></div><script type="text/javascript">function showError(s){$(".alert").removeClass("alert-success").addClass("alert-danger").removeClass("d-none").addClass("show"),$("#alert-msg").text(s)}function showSuccess(s){$(".alert").addClass("alert-success").removeClass("alert-danger").removeClass("d-none").addClass("show"),$("#alert-msg").text(s)}$("#alert-btn").click(function(s){$(".alert").addClass("d-none").removeClass("show")})</script><div class="row mb-3"><div class="col-md-12 themed-grid-col bg-light">Here you can upload a new firmware version, it will not check the version number so you can also downgrade the firmware here.</div></div><div class="row mb-3"><div class="col-md-8 themed-grid-col bg-light">Current version:</div><div class="col-md-4 themed-grid-col bg-light" id="app-ver">Loading...</div></div><div class="row mb-3"><div class="col-md-8 themed-grid-col bg-light">Platform:</div><div class="col-md-4 themed-grid-col bg-light" id="platform">Loading...</div></div><div class="row mb-3"><!--
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="description" content=""><title>Beer Gravity Monitor</title><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous"><script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script><script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-fQybjgWLrvvRgtW6bFlB7jaZrFsaBXjsOMm/tB9LTS58ONXgqbR9W8oWht/amnpF" crossorigin="anonymous"></script></head><body class="py-4"><!-- START MENU --><nav class="navbar navbar-expand-sm navbar-dark bg-primary"><a class="navbar-brand" href="/firmware.htm">Beer Gravity Monitor - Firmware upgrade</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button><div class="collapse navbar-collapse" id="navbar"><ul class="navbar-nav mr-auto"><li class="nav-item"><a class="nav-link" href="javascript:history.back()">Back to configuration</a></li></ul><div class="spinner-border text-light" id="spinner" role="status"></div></div></nav><!-- START MAIN INDEX --><div class="container"><hr class="my-4"><div class="alert alert-success alert-dismissible fade hide show d-none" role="alert" id="alert"><div id="alert-msg">...</div><button type="button" id="alert-btn" class="close" aria-label="Close"><span aria-hidden="true">×</span></button></div><script type="text/javascript">function showError(s){$(".alert").removeClass("alert-success").addClass("alert-danger").removeClass("d-none").addClass("show"),$("#alert-msg").text(s)}function showSuccess(s){$(".alert").addClass("alert-success").removeClass("alert-danger").removeClass("d-none").addClass("show"),$("#alert-msg").text(s)}$("#alert-btn").click(function(s){$(".alert").addClass("d-none").removeClass("show")})</script><div class="row mb-3"><div class="col-md-12 themed-grid-col bg-light">Here you can upload a new firmware version, it will not check the version number so you can also downgrade the firmware here.</div></div><div class="row mb-3"><div class="col-md-8 themed-grid-col bg-light">Current version:</div><div class="col-md-4 themed-grid-col bg-light" id="app-ver">Loading...</div></div><div class="row mb-3"><div class="col-md-8 themed-grid-col bg-light">Platform:</div><div class="col-md-4 themed-grid-col bg-light" id="platform">Loading...</div></div><div class="row mb-3"><!--
|
||||
<form action="/api/upload" method="post" enctype="multipart/form-data">
|
||||
<div class="col-md-8 custom-file">
|
||||
<input type="file" accept=".bin" class="custom-file-input" name="name" id="name">
|
||||
@ -6,7 +6,7 @@
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary" id="upload-btn" value="upload">Flash firmware</button>
|
||||
</form>
|
||||
--><form id="uploadForm" enctype="multipart/form-data"><div class="col-md-8 custom-file"><input type="file" accept=".bin" class="custom-file-input" name="name" id="name"> <label class="custom-file-label" for="name">Choose file</label></div><button type="submit" class="btn btn-primary" id="upload-btn" value="upload">Flash firmware</button></form></div><div class="progress"><div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div></div><hr class="my-4"></div><script type="text/javascript">window.onload = getStatus;
|
||||
--><form id="uploadForm" enctype="multipart/form-data"><div class="col-md-8 custom-file"><input type="file" accept=".bin" class="custom-file-input" name="name" id="name" onchange="checkName()"> <label class="custom-file-label" for="name">Choose file</label></div><button type="submit" class="btn btn-primary" id="upload-btn" value="upload">Flash firmware</button></form></div><div class="progress"><div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div></div><hr class="my-4"></div><script type="text/javascript">window.onload = getStatus;
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#uploadForm").on('submit', function(e) {
|
||||
@ -43,6 +43,10 @@
|
||||
});
|
||||
});
|
||||
|
||||
function checkName() {
|
||||
setButtonDisabled( $("#name").val()!="" ? false : true );
|
||||
}
|
||||
|
||||
function progressHandler(event) {
|
||||
var percent = (event.loaded / event.total) * 100;
|
||||
setProgress(Math.round(percent));
|
||||
@ -52,7 +56,14 @@
|
||||
$('.progress-bar').css('width', val+'%').attr('aria-valuenow', val).text(val + "%");
|
||||
}
|
||||
|
||||
function setButtonDisabled( b ) {
|
||||
$("#upload-btn").prop("disabled", b);
|
||||
}
|
||||
|
||||
function getStatus() {
|
||||
|
||||
setButtonDisabled( true );
|
||||
|
||||
var url = "/api/status";
|
||||
//var url = "/test/status.json";
|
||||
$('#spinner').show();
|
||||
|
@ -173,7 +173,7 @@
|
||||
console.log( cfg );
|
||||
|
||||
//$("#app-ver").text(cfg["app-ver"] + " (html 0.8.0)");
|
||||
$("#app-ver").text(cfg["app-ver"]);
|
||||
$("#app-ver").text(cfg["app-ver"] + " (" + cfg["app-build"] + ")");
|
||||
$("#mdns").text(cfg["mdns"]);
|
||||
$("#id").text(cfg["id"]);
|
||||
$("#platform").text(cfg["platform"]);
|
||||
|
File diff suppressed because one or more lines are too long
@ -51,12 +51,6 @@ Config::Config() {
|
||||
Log.verbose(F("CFG : Created config for %s (%s)." CR), _id.c_str(),
|
||||
_mDNS.c_str());
|
||||
#endif
|
||||
|
||||
#if defined(ESP8266)
|
||||
setVoltageFactor(1.59); // Conversion factor for battery on ESP8266
|
||||
#else // defined (ESP32)
|
||||
setVoltageFactor(1.25); // Conversion factor for battery on ESP32
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -96,7 +96,7 @@ class Config {
|
||||
String _mDNS = "";
|
||||
String _otaURL = "";
|
||||
char _tempFormat = 'C';
|
||||
float _voltageFactor = 0;
|
||||
float _voltageFactor = 1.59;
|
||||
float _tempSensorAdjC = 0;
|
||||
int _sleepInterval = 900;
|
||||
bool _gyroTemp = false;
|
||||
@ -322,12 +322,12 @@ class Config {
|
||||
_tempSensorAdjC = f;
|
||||
_saveNeeded = true;
|
||||
}
|
||||
void setTempSensorAdjC(String s) {
|
||||
_tempSensorAdjC = s.toFloat();
|
||||
void setTempSensorAdjC(String s, float adjustC = 0) {
|
||||
_tempSensorAdjC = s.toFloat() + adjustC;
|
||||
_saveNeeded = true;
|
||||
}
|
||||
void setTempSensorAdjF(String s) {
|
||||
_tempSensorAdjC = convertFtoC(s.toFloat());
|
||||
void setTempSensorAdjF(String s, float adjustF = 0) {
|
||||
_tempSensorAdjC = convertFtoC(s.toFloat() + adjustF);
|
||||
_saveNeeded = true;
|
||||
}
|
||||
|
||||
|
@ -64,6 +64,7 @@ SOFTWARE.
|
||||
#define PARAM_FILE_NAME "file-name"
|
||||
#define PARAM_FILE_SIZE "file-size"
|
||||
#define PARAM_APP_VER "app-ver"
|
||||
#define PARAM_APP_BUILD "app-build"
|
||||
#define PARAM_ANGLE "angle"
|
||||
#define PARAM_GRAVITY "gravity"
|
||||
#define PARAM_TEMP_C "temp-c"
|
||||
|
@ -61,8 +61,9 @@ void WebServerHandler::webHandleConfig() {
|
||||
|
||||
// Format the adjustment so we get rid of rounding errors
|
||||
if (myConfig.isTempF())
|
||||
// We want the delta value (32F = 0C).
|
||||
doc[PARAM_TEMP_ADJ] =
|
||||
reduceFloatPrecision(convertCtoF(myConfig.getTempSensorAdjC()), 1);
|
||||
reduceFloatPrecision(convertCtoF(myConfig.getTempSensorAdjC())-32, 1);
|
||||
else
|
||||
doc[PARAM_TEMP_ADJ] = reduceFloatPrecision(myConfig.getTempSensorAdjC(), 1);
|
||||
|
||||
@ -354,6 +355,7 @@ void WebServerHandler::webHandleStatus() {
|
||||
doc[PARAM_TOKEN2] = myConfig.getToken2();
|
||||
|
||||
doc[PARAM_APP_VER] = CFG_APPVER;
|
||||
doc[PARAM_APP_BUILD] = CFG_GITREV;
|
||||
doc[PARAM_MDNS] = myConfig.getMDNS();
|
||||
|
||||
FloatHistoryLog runLog(RUNTIME_FILENAME);
|
||||
@ -604,7 +606,8 @@ void WebServerHandler::webHandleConfigHardware() {
|
||||
if (myConfig.isTempC()) {
|
||||
myConfig.setTempSensorAdjC(_server->arg(PARAM_TEMP_ADJ));
|
||||
} else {
|
||||
myConfig.setTempSensorAdjF(_server->arg(PARAM_TEMP_ADJ));
|
||||
// Data is delta so we add 32 in order to conver to C.
|
||||
myConfig.setTempSensorAdjF(_server->arg(PARAM_TEMP_ADJ), 32);
|
||||
}
|
||||
}
|
||||
if (_server->hasArg(PARAM_BLE))
|
||||
|
16
src/wifi.cpp
16
src/wifi.cpp
@ -89,8 +89,11 @@ bool WifiConnection::hasConfig() {
|
||||
String ssid = WiFi.SSID();
|
||||
if (ssid.length()) {
|
||||
Log.notice(F("WIFI: Found credentials in EEPORM." CR));
|
||||
myConfig.setWifiSSID(WiFi.SSID());
|
||||
myConfig.setWifiPass(WiFi.psk());
|
||||
myConfig.setWifiSSID(ssid);
|
||||
|
||||
if (WiFi.psk().length())
|
||||
myConfig.setWifiPass(WiFi.psk());
|
||||
|
||||
myConfig.saveFile();
|
||||
return true;
|
||||
}
|
||||
@ -144,8 +147,13 @@ void WifiConnection::startPortal() {
|
||||
|
||||
if (myWifiManager->startConfigPortal(WIFI_DEFAULT_SSID, WIFI_DEFAULT_PWD)) {
|
||||
Log.notice(F("WIFI: Exited portal, connected to wifi. Rebooting..." CR));
|
||||
myConfig.setWifiSSID(myWifiManager->getSSID());
|
||||
myConfig.setWifiPass(myWifiManager->getPW());
|
||||
|
||||
if (myWifiManager->getSSID().length())
|
||||
myConfig.setWifiSSID(myWifiManager->getSSID());
|
||||
|
||||
if (myWifiManager->getPW().length())
|
||||
myConfig.setWifiPass(myWifiManager->getPW());
|
||||
|
||||
myConfig.saveFile();
|
||||
} else {
|
||||
Log.notice(
|
||||
|
@ -22,6 +22,7 @@ URL: (http://gravmon.local)
|
||||
:width: 800
|
||||
:alt: Index page
|
||||
|
||||
|
||||
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*.
|
||||
|
||||
The main page shows the device readings; gravity, angle, temperature and battery charge. If the checkbox is active then the device will never go into sleep mode. This is useful if
|
||||
@ -54,17 +55,17 @@ Device Setting
|
||||
|
||||
* **Device name:**
|
||||
|
||||
This is unique name for the device. It will be used in pushing data as well as mDNS name on the network (<name>.local)
|
||||
This is unique name for the device. It will be used in pushing data as well as mDNS name on the network (<name>.local)
|
||||
|
||||
* **Temperature format:**
|
||||
|
||||
Choose between Celsius and Farenheight when displaying temperature.
|
||||
Choose between Celsius and Farenheight when displaying temperature.
|
||||
|
||||
* **Interval:**
|
||||
|
||||
This defines how long the device should be sleeping between the readings when in `gravity monitoring` mode. You will also see
|
||||
the values in minutes/seconds to easier set the interval. 900s is a recommended interval. The sleep interval can
|
||||
be set between 10 - 3600 seconds (60 minutes).
|
||||
This defines how long the device should be sleeping between the readings when in `gravity monitoring` mode. You will also see
|
||||
the values in minutes/seconds to easier set the interval. 900s is a recommended interval. The sleep interval can
|
||||
be set between 10 - 3600 seconds (60 minutes).
|
||||
|
||||
.. note::
|
||||
|
||||
@ -75,7 +76,7 @@ Device Setting
|
||||
|
||||
* **Calibration values:**
|
||||
|
||||
These are calibration data for the gyro. Place the device flat on a table and press the button to save the default orientation values. Without this calibration we cannot calculate the correct angle/tilt.
|
||||
These are calibration data for the gyro. Place the device flat on a table and press the button to save the default orientation values. Without this calibration we cannot calculate the correct angle/tilt.
|
||||
|
||||
.. warning::
|
||||
|
||||
@ -95,58 +96,58 @@ Push Settings
|
||||
|
||||
* **HTTP 1 (POST):**
|
||||
|
||||
Endpoint to send data via http. Default format used Format used :ref:`data-formats-ispindle`. You can customize the format using :ref:`format-editor`.
|
||||
Endpoint to send data via http. Default format used Format used :ref:`data-formats-ispindle`. You can customize the format using :ref:`format-editor`.
|
||||
|
||||
If you add the prefix `https://` then the device will use SSL when sending data.
|
||||
If you add the prefix `https://` then the device will use SSL when sending data.
|
||||
|
||||
* **HTTP 2 (POST):**
|
||||
|
||||
Endpoint to send data via http. Default format used :ref:`data-formats-ispindle`. You can customize the format using :ref:`format-editor`.
|
||||
Endpoint to send data via http. Default format used :ref:`data-formats-ispindle`. You can customize the format using :ref:`format-editor`.
|
||||
|
||||
If you add the prefix `https://` then the device will use SSL when sending data.
|
||||
If you add the prefix `https://` then the device will use SSL when sending data.
|
||||
|
||||
* **Token:**
|
||||
|
||||
The token is included in the iSpindle JSON format and will be used for both HTTP targets. If you
|
||||
need to have 2 different tokens please use the :ref:`format-editor` to customize the data format.
|
||||
The token is included in the iSpindle JSON format and will be used for both HTTP targets. If you
|
||||
need to have 2 different tokens please use the :ref:`format-editor` to customize the data format.
|
||||
|
||||
* **HTTP 3 (GET):**
|
||||
|
||||
Endpoint to send data via http. This is using an HTTP GET request instead of a post. This means that the values are appended to the URL like; http://endpoint?param=value¶m2=value2. You can customize the format using :ref:`format-editor`.
|
||||
Endpoint to send data via http. This is using an HTTP GET request instead of a post. This means that the values are appended to the URL like; http://endpoint?param=value¶m2=value2. You can customize the format using :ref:`format-editor`.
|
||||
|
||||
If you add the prefix `https://` then the device will use SSL when sending data.
|
||||
If you add the prefix `https://` then the device will use SSL when sending data.
|
||||
|
||||
* **Token 2:**
|
||||
|
||||
The token is included in the default format for the HTTP GET url but can be used for any of the formats. For HTTP GET use can use this for an authorization token with for instance ubidots or blynk http api.
|
||||
The token is included in the default format for the HTTP GET url but can be used for any of the formats. For HTTP GET use can use this for an authorization token with for instance ubidots or blynk http api.
|
||||
|
||||
* **Brewfather URL:**
|
||||
|
||||
Endpoint to send data via http to brewfather. Format used :ref:`data-formats-brewfather`
|
||||
Endpoint to send data via http to brewfather. Format used :ref:`data-formats-brewfather`
|
||||
|
||||
SSL is not supported for this target.
|
||||
SSL is not supported for this target.
|
||||
|
||||
* **HTTP Headers**
|
||||
|
||||
.. image:: images/config-popup1.png
|
||||
:width: 300
|
||||
:alt: HTTP Headers
|
||||
.. image:: images/config-popup1.png
|
||||
:width: 300
|
||||
:alt: HTTP Headers
|
||||
|
||||
You can define 2 http headers per push target. This is available via a pop-up window but dont forget
|
||||
to press the save buttons on the post section to save the values. One common header is content type which is the
|
||||
default setting for http targets.
|
||||
You can define 2 http headers per push target. This is available via a pop-up window but dont forget
|
||||
to press the save buttons on the post section to save the values. One common header is content type which is the
|
||||
default setting for http targets.
|
||||
|
||||
The input must have the format **'<header>: <value>'** for it to work. The UI will accept any value so errors
|
||||
will not show until the device tries to push data.
|
||||
The input must have the format **'<header>: <value>'** for it to work. The UI will accept any value so errors
|
||||
will not show until the device tries to push data.
|
||||
|
||||
|
||||
::
|
||||
|
||||
Content-Type: application/json
|
||||
X-Auth-Token: <api-token>
|
||||
::
|
||||
|
||||
Content-Type: application/json
|
||||
X-Auth-Token: <api-token>
|
||||
|
||||
|
||||
Mozilla has a good guide on what headers are valid; `HTTP Headers <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers>`_
|
||||
Mozilla has a good guide on what headers are valid; `HTTP Headers <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers>`_
|
||||
|
||||
|
||||
Push Settings (2)
|
||||
@ -158,37 +159,37 @@ Push Settings (2)
|
||||
|
||||
* **Influx DB v2 URL:**
|
||||
|
||||
Endpoint to send data via http to InfluxDB. Format used :ref:`data-formats-influxdb2`. You can customize the format using :ref:`format-editor`.
|
||||
Endpoint to send data via http to InfluxDB. Format used :ref:`data-formats-influxdb2`. You can customize the format using :ref:`format-editor`.
|
||||
|
||||
SSL is not supported for this target. Raise a issue on github if this is wanted.
|
||||
SSL is not supported for this target. Raise a issue on github if this is wanted.
|
||||
|
||||
* **Influx DB v2 Organisation:**
|
||||
|
||||
Name of organisation in Influx.
|
||||
Name of organisation in Influx.
|
||||
|
||||
* **Influx DB v2 Bucket:**
|
||||
|
||||
Identifier for bucket.
|
||||
Identifier for bucket.
|
||||
|
||||
* **Influx DB v2 Token:**
|
||||
|
||||
Token with write access to bucket.
|
||||
Token with write access to bucket.
|
||||
|
||||
* **MQTT server:**
|
||||
|
||||
IP or name of server to send data to. Default format used :ref:`data-formats-mqtt`. You can customize the format using :ref:`format-editor`.
|
||||
IP or name of server to send data to. Default format used :ref:`data-formats-mqtt`. You can customize the format using :ref:`format-editor`.
|
||||
|
||||
* **MQTT Port:**
|
||||
|
||||
Which port should be used for communication, default is 1883 (standard port). For SSL use 8883 (any port over 8000 is treated as SSL).
|
||||
Which port should be used for communication, default is 1883 (standard port). For SSL use 8883 (any port over 8000 is treated as SSL).
|
||||
|
||||
* **MQTT user:**
|
||||
|
||||
Username or blank if anonymous is accepted
|
||||
Username or blank if anonymous is accepted
|
||||
|
||||
* **MQTT password:**
|
||||
|
||||
Password or blank if anonymous is accepted
|
||||
Password or blank if anonymous is accepted
|
||||
|
||||
|
||||
Gravity Settings
|
||||
@ -200,25 +201,26 @@ Gravity Settings
|
||||
|
||||
* **Gravity format:**
|
||||
|
||||
Gravity format can be eihter `SG` or `Plato`. The device will use SG Internally and convert to Plato when displaying or sending data.
|
||||
Gravity format can be eihter `SG` or `Plato`. The device will use SG Internally and convert to Plato when displaying or sending data.
|
||||
|
||||
* **Gravity formula:**
|
||||
|
||||
Gravity formula is compatible with standard iSpindle formulas so any existing calculation option can be used. You can also use
|
||||
the feature to create the formula by supplying the raw data. See :ref:`create-formula`
|
||||
Gravity formula is compatible with standard iSpindle formulas so any existing calculation option can be used. You can also use
|
||||
the feature to create the formula by supplying the raw data. See :ref:`create-formula`
|
||||
|
||||
The gravity formula accepts to paramaters, **tilt** for the angle or **temp** for temperature (temperature inserted into the formula
|
||||
will be in celsius). I would recommend to use the formula calculation feature instead since this is much easier.
|
||||
The gravity formula accepts to paramaters, **tilt** for the angle or **temp** for temperature (temperature inserted into the formula
|
||||
will be in celsius). I would recommend to use the formula calculation feature instead since this is much easier.
|
||||
|
||||
* **Temperature correct gravity:**
|
||||
|
||||
Will apply a temperature calibration formula to the gravity as a second step after gravity has been calculated. It's also possible to
|
||||
build this into the gravity formula.
|
||||
Will apply a temperature calibration formula to the gravity as a second step after gravity has been calculated. It's also possible to
|
||||
build this into the gravity formula.
|
||||
|
||||
.. warning::
|
||||
|
||||
This formula assumes that the calibration has been done at 20°C / 68°F.
|
||||
|
||||
Formula used in temperature correction.
|
||||
Formula used in temperature correction.
|
||||
|
||||
::
|
||||
|
||||
@ -235,34 +237,34 @@ Hardware Settings
|
||||
|
||||
* **Voltage factor:**
|
||||
|
||||
Factor used to calcualate the battery voltage. If you get a too low/high voltage you can adjust this value.
|
||||
Factor used to calcualate the battery voltage. If you get a too low/high voltage you can adjust this value.
|
||||
|
||||
* **Temperature correction:**
|
||||
|
||||
This value will be added to the temperature reading (negative value will reduce temperature reading). This is applied
|
||||
when the device starts. So changing this will not take affect until the device is restarted.
|
||||
This value will be added to the temperature reading (negative value will reduce temperature reading). This is applied
|
||||
when the device starts. So changing this will not take affect until the device is restarted.
|
||||
|
||||
* **Gyro Temperature:**
|
||||
|
||||
Enable this feature will use the temp sensor i the gyro instead of the DS18B20, the benefit is shorter run time and
|
||||
longer battery life (this is an experimental feature). The value used is the first temperature reading from when the
|
||||
device is activated, since the gyro should be cool this is reflecting the surronding temperature. After it has
|
||||
been running the value would be totally off.
|
||||
Enable this feature will use the temp sensor i the gyro instead of the DS18B20, the benefit is shorter run time and
|
||||
longer battery life (this is an experimental feature). The value used is the first temperature reading from when the
|
||||
device is activated, since the gyro should be cool this is reflecting the surronding temperature. After it has
|
||||
been running the value would be totally off.
|
||||
|
||||
* **Bluetooth: (Only ESP32)**
|
||||
|
||||
If the build is using an ESP32 then you can send data over BLE, simulating a Tilt device. Choose the color that you want the device to simulate.
|
||||
If the build is using an ESP32 then you can send data over BLE, simulating a Tilt device. Choose the color that you want the device to simulate.
|
||||
|
||||
* **OTA URL:**
|
||||
|
||||
Should point to a URL where the firmware.bin file + version.json file are located. For an ESP32 target the firmware should be named firmware32.bin.
|
||||
Should point to a URL where the firmware.bin file + version.json file are located. For an ESP32 target the firmware should be named firmware32.bin.
|
||||
|
||||
For the OTA to work, place the following files (version.json + firmware.bin) at the location that you pointed out in OTA URL. If the version number in the json file is newer than in the
|
||||
code the update will be done during startup.
|
||||
For the OTA to work, place the following files (version.json + firmware.bin) at the location that you pointed out in OTA URL. If the version number in the json file is newer than in the
|
||||
code the update will be done during startup.
|
||||
|
||||
If you have the previx `https://` then the device will use secure transfer without CA validation.
|
||||
If you have the previx `https://` then the device will use secure transfer without CA validation.
|
||||
|
||||
Example; OTA URL (don't forget trailing dash), the name of the file should be firmware.bin
|
||||
Example; OTA URL (don't forget trailing dash), the name of the file should be firmware.bin
|
||||
|
||||
.. code-block::
|
||||
|
||||
@ -270,3 +272,12 @@ Hardware Settings
|
||||
https://192.168.1.1/firmware/gravmon/
|
||||
|
||||
|
||||
* **Upload Firmware**
|
||||
|
||||
This option gives you the possibility to install an new version of the firmware (or any firmware that uses the standard flash layout).
|
||||
|
||||
.. image:: images/firmware.png
|
||||
:width: 600
|
||||
:alt: Update firmware
|
||||
|
||||
|
||||
|
@ -16,6 +16,10 @@ I would suggest that you try how it fits into the PET tube before soldering it t
|
||||
|
||||
You also need to desolder (remove) the RED ON LED from the ESP32 or the battery power will be reduced a lot.
|
||||
|
||||
Final thing is to add a resistor between A0 (Analog PIN) and ground of 470k. The reason is that the esp8266 has a build in resistor which
|
||||
the esp32 does not have. So in order to get a valid voltage (less than 3.2V) on the A0 pin this is needed. Once the modification is done you might
|
||||
need to adjust the voltage factor so the battery reading is correct.
|
||||
|
||||
.. image:: images/esp32.jpg
|
||||
:width: 500
|
||||
:alt: Mounting esp32
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 35 KiB |
BIN
src_docs/source/images/firmware.png
Normal file
BIN
src_docs/source/images/firmware.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
Binary file not shown.
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 75 KiB |
@ -3,7 +3,7 @@
|
||||
Installation
|
||||
------------
|
||||
|
||||
You have these 3 options for flashing this firmware:
|
||||
You have these 3 options for flashing this firmware.
|
||||
|
||||
* Brewflasher via USB serial
|
||||
* Esptool via USB serial
|
||||
@ -67,6 +67,32 @@ an option for updating firmware. The option is under the maintence meny.
|
||||
|
||||
Select the esp8266 version of the firmware called firmware.bin and press upload.
|
||||
|
||||
Updating firmware
|
||||
=================
|
||||
|
||||
You can use the above options for updating the firmware as well. But if you want to do updates without connecting the USB cable these
|
||||
are your options.
|
||||
|
||||
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/``
|
||||
|
||||
Manual update
|
||||
*************
|
||||
|
||||
When the device in is configuration mode you can manually update with a new firmware. Just open this URL in the web
|
||||
browser and select the firmware.bin file that corresponds to the version you want to flash.
|
||||
|
||||
``http://<device_name>/firmware.htm``
|
||||
|
||||
|
||||
|
||||
.. _serial_monitoring:
|
||||
|
||||
Serial Monitoring
|
||||
=================
|
||||
|
||||
|
@ -18,12 +18,15 @@ v0.9.0
|
||||
* Updated esp32 target with littlefs support
|
||||
* Updated esp32 target with BLE send support (it will simulate a tilt)
|
||||
* Mounted esp32 d1 mini mounted to a iSpindle PCB 4.0 (CherryPhilip) which worked fine.
|
||||
* Documented hardware changes on esp32
|
||||
* Default mDNS name is now shown on WIFI setup page.
|
||||
* Added option to manually update/downgrade firmware under hardware settings.
|
||||
* BUG: Corrected PIN for voltage read on ESP32
|
||||
* BUG: If using plato and not gravity formula was defined the value was set to null.
|
||||
* BUG: Temp format name was incorrect in iSpindle format causing receiver to incorrectly read temperature.
|
||||
* BUG: Temperature sensor adjusmemnt value was not handled properly when using Farenheight.
|
||||
* BUG: If the ID was to low the device id could end up with a leading space causing errors in data post. Added leading zero to ID.
|
||||
* BUG: Entering wifi setup and a timeout occured the wifi settings could be deleted.
|
||||
|
||||
v0.8.0
|
||||
------
|
||||
|
@ -11,6 +11,7 @@
|
||||
"sleep-mode": false,
|
||||
"rssi": -56,
|
||||
"app-ver": "0.0.0",
|
||||
"app-build": "gitrev",
|
||||
"mdns": "gravmon",
|
||||
"platform": "esp32",
|
||||
"runtime-average": 3.12
|
||||
|
Reference in New Issue
Block a user