Merged changes from dev

This commit is contained in:
Magnus Persson 2022-01-06 16:29:48 +01:00
parent 20d5f50c19
commit 4f0b6d11e7
18 changed files with 221 additions and 29 deletions

View File

@ -4,13 +4,16 @@ Backlog of changes
Documentation Documentation
------------- -------------
- Add library references to missing libraries from the latest release v0.5.
- Copy images to build folder for documentation
- Create page with list of releases - Create page with list of releases
- Updates over OTA (from PC) - Updates over OTA (from PC)
- Write compile instructions
- Write contribution instructions
- publish docs
Code Code
------------- -------------
- Support for MQTT - Support for MQTT
- Support for plato - Support for plato
- Use pre-commit for validating check-in
- Automatic builds via github actions

View File

@ -1,32 +1,21 @@
Compiling the software Compiling the software
----------------------- -----------------------
This section is under construction.
VSCODE + PlatformIO VSCODE + PlatformIO
============================= =============================
TODO
Targets Targets
============================= =============================
TODO
Source structure Source structure
============================= =============================
TODO
Options Options
============================= =============================
TODO
# 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.
By default the html files are embedded but there are options to upload them to the file system to reduce the size of the image if the size becomes to large for OTA.
You can set the SSID and PWD as presets through platformio.ini by adding the settings to the following definitions:
```
-D USER_SSID=\""\"" // =\""myssid\""
-D USER_SSID_PWD=\""\"" // =\""mypwd\""
```
There are more options in teh platform.ini file that enable/disable additional functions for logging level, pushing performance data to InfluxDB and more. If i get the time I will add some documentation around these.

View File

@ -14,6 +14,10 @@ Main index
URL: (http://gravmon.local) URL: (http://gravmon.local)
.. image:: images/index.png
: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*. 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 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
@ -30,7 +34,7 @@ Device
URL: (http://gravmon.local/device) URL: (http://gravmon.local/device)
.. image:: images/device.png .. image:: images/device.png
:width: 400 :width: 800
:alt: Device Settings :alt: Device Settings
@ -56,7 +60,7 @@ Device Setting
************** **************
.. image:: images/config1.png .. image:: images/config1.png
:width: 400 :width: 800
:alt: Device Settings :alt: Device Settings
* **Device name:** * **Device name:**
@ -87,7 +91,7 @@ Push Settings
************* *************
.. image:: images/config2.png .. image:: images/config2.png
:width: 400 :width: 800
:alt: Push Settings :alt: Push Settings
* **HTTP URL 1:** * **HTTP URL 1:**
@ -123,7 +127,7 @@ Gravity Settings
**************** ****************
.. image:: images/config3.png .. image:: images/config3.png
:width: 400 :width: 800
:alt: Gravity Settings :alt: Gravity Settings
* **Gravity formula:** * **Gravity formula:**
@ -145,7 +149,7 @@ Hardware Settings
***************** *****************
.. image:: images/config4.png .. image:: images/config4.png
:width: 400 :width: 800
:alt: Hardware Settings :alt: Hardware Settings
* **Voltage factor:** * **Voltage factor:**
@ -170,7 +174,6 @@ Hardware Settings
http://192.168.1.1/firmware/gravmon/ http://192.168.1.1/firmware/gravmon/
Contents version.json Contents version.json
:: ::
@ -180,11 +183,205 @@ Hardware Settings
Create formula Create formula
============================= =============================
todo
.. image:: images/formula1.png
:width: 800
:alt: Formula data
Here you can enter up to 5 values (angles + gravity) that is then used to create the formula. Angles equal to zero will be regarded as empty even if there is a gravity reading.
.. image:: images/formula2.png
:width: 800
:alt: Formula graph
Once the formula is created a graph over the entered values and a simulation of the formula will give you a nice overview on how the formula will work.
REST API REST API
============================= =============================
todo
GET: /api/config
****************
Retrive the current configuation of the device via an HTTP GET command. Payload is in JSON format.
::
{
"mdns": "gravmon",
"id": "ee1bfc",
"ota-url": "http://192.168.1.50:80/firmware/gravmon/",
"temp-format": "C",
"brewfather-push": "http://log.brewfather.net/stream?id=Qwerty",
"http-push": "http://192.168.1.50:9090/api/v1/Qwerty/telemetry",
"http-push2": "http://192.168.1.50/ispindel",
"influxdb2-push": "http://192.168.1.50:8086",
"influxdb2-org": "Qwerty",
"influxdb2-bucket": "Qwerty",
"influxdb2-auth": "Qwerty",
"sleep-interval": 30,
"voltage-factor": 1.59,
"gravity-formula": "0.0*tilt^3+0.0*tilt^2+0.0017978*tilt+0.9436",
"gravity-format": "G",
"temp-adjustment-value": 0,
"gravity-temp-adjustment": false,
"gyro-calibration-data": {
"ax": -330,
"ay": -2249,
"az": 1170,
"gx": 99,
"gy": -6,
"gz": 4
},
"angle": 90.93,
"gravity": 1.105,
"battery": 0.04
}
GET: /api/device
****************
Retrive the current device settings via an HTTP GET command. Payload is in JSON format.
::
{
"app-name": "GravityMon ",
"app-ver": "0.0.0",
"id": "ee1bfc",
"mdns": "gravmon"
}
GET: /api/status
****************
Retrive the current device status via an HTTP GET command. Payload is in JSON format.
::
{
"id": "ee1bfc",
"angle": 89.86,
"gravity": 1.1052,
"gravity-tempcorr": 1.1031,
"temp-c": 0,
"temp-f": 32,
"battery": 0,
"temp-format": "C",
"sleep-mode": false,
"rssi": -56
}
GET: /api/config/formula
************************
Retrive the data used for formula calculation data via an HTTP GET command. Payload is in JSON format.
::
{
"id": "ee1bfc", // Unique id of the device (API Key)
"a1": 22.4, // Angles 1-5
"a2": 54.4,
"a3": 58,
"a4": 0,
"a5": 0,
"g1": 1.000, // Gravity 1-5
"g2": 1.053,
"g3": 1.062,
"g4": 1,
"g5": 1
"gravity-formula": "0.0*tilt^3+0.0*tilt^2+0.0017978*tilt+0.9436",
}
POST: /api/config/device
************************
Used to update device settings via an HTTP POST command. Payload is in JSON format.
::
{
"id": "ee1bfc", // Unique id of the device (API Key)
"mdns": "gravmon", // Network name / Device name
"temp-format": "C", // Can be either C or F
"sleep-interval": 30 // Time in seconds.
}
POST: /api/config/push
**********************
Used to update push settings via an HTTP POST command. Payload is in JSON format.
::
{
"id": "ee1bfc", // Unique id of the device (API Key)
"http-push": "http://192.168.1.50/ispindel",
"http-push2": "",
"brewfather-push": "",
"influxdb2-push": "http://192.168.1.50:8086",
"influxdb2-org": "Qwerty",
"influxdb2-bucket": "Qwerty",
"influxdb2-auth": "Qwerty"
}
POST: /api/config/gravity
*************************
Used to update gravity settings via an HTTP POST command. Payload is in JSON format.
::
{
"id": "ee1bfc", // Unique id of the device (API Key)
"gravity-formula": "0.0*tilt^3+0.0*tilt^2+0.0017978*tilt+0.9436",
"gravity-temp-adjustment": "off" // Can be on or off
}
POST: /api/config/gravity
*************************
Used to update hardware settings via an HTTP POST command. Payload is in JSON format.
::
{
"id": "ee1bfc", // Unique id of the device (API Key)
"voltage-factor": 1.59,
"temp-adjustment": 0,
"ota-url": "http://192.168.1.50/firmware/gravmon/"
}
POST: /api/config/formula
*************************
Used to update formula calculation data via an HTTP POST command. Payload is in JSON format.
::
{
"id": "ee1bfc", // Unique id of the device (API Key)
"a1": 22.4, // Angles 1-5
"a2": 54.4,
"a3": 58,
"a4": 0,
"a5": 0,
"g1": 1.000, // Gravity 1-5
"g2": 1.053,
"g3": 1.062,
"g4": 1,
"g5": 1
}
Data Formats Data Formats
============================= =============================

View File

@ -1,5 +1,5 @@
Contributing Contributing
----------------------- ------------
This section is under construction. This section is under construction.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -16,7 +16,7 @@ projects based on esp8266 and also started to brew beer so this combination was
The hardware design comes from the fantastic iSpindle project so that is not covered in this documentation. The hardware design comes from the fantastic iSpindle project so that is not covered in this documentation.
My approach to this software is a little different from the approach that the orignial ispindle firmware has. My approach to this software is a little different from that the original ispindle firmware.
.. note:: .. note::
@ -55,6 +55,9 @@ This software uses the following libraries and without these this would have bee
* https://github.com/bblanchon/ArduinoJson * https://github.com/bblanchon/ArduinoJson
* https://github.com/PaulStoffregen/OneWire * https://github.com/PaulStoffregen/OneWire
* https://github.com/milesburton/Arduino-Temperature-Control-Library * https://github.com/milesburton/Arduino-Temperature-Control-Library
* https://github.com/Rotario/arduinoCurveFitting
* https://graphjs.com/
* https://getbootstrap.com/
.. toctree:: .. toctree::

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB