Merge branch 'master' of into patch2

This commit is contained in:
Magnus
2022-12-05 13:51:42 +01:00
38 changed files with 452 additions and 275 deletions

View File

@ -84,7 +84,7 @@ GET: /api/status
Retrieve the current device status via an HTTP GET command. Payload is in JSON format.
* ``temp-format`` can be either ``C`` or ``F``
* ``platform`` can be either ``esp8266``, ``esp32c3``, ``esp32s2`` or ``esp32``
* ``platform`` can be either ``esp8266``, ``esp32c3``, ``esp32s2``, ``esp32`` or ``esp32lite`` (floaty hardware)
* ``temp-c`` will be set to -273 C if there is no temp sensor
* ``angle`` will be set to 0 if no valid angle is found and -1 if there is no gyro

View File

@ -32,6 +32,7 @@ In the platformio config there are 3 targets defined
* gravity32-release: Version for ESP32 mini.
* gravity32-c3-release: Version for ESP32 C3 mini.
* gravity32-s2-release: Version for ESP32 S2 mini.
* gravity32-lite-release: Version for ESP32 lite (Floaty hardware).
.. warning::
The debug target can be unstable and crash the device under certain circumstanses. Excessive logging to the serial port can cause corruption and crashes.
@ -114,4 +115,7 @@ This is a list of C++ defines that is used to enable/disable functions in the co
- Defines the version of the compiled software
* - USE_SERIAL_PINS
- Will send the serial console to the TX/RX pins on an ESP32 target so that debugging can be done when on battery
* - REDUCE_WIFI_POWER
- Will reduce wifi power to support the ESP32C3 v1.0 which has a bad antenna
* - FLOATY
- Build for the ESP32lite FLOATY hardware option (no DS18B20 and no battery monitor)

View File

@ -10,7 +10,7 @@ One of the following conditions will place the device in ``configuration mode``:
- Gyro has not been calibrated
- Sleep mode has been disabled in the web interface
- Placed in horizontal mode 85-90 degrees
- Charger connected >4.15V (or the value that is configured)
- Charger connected >4.15V (or the value that is configured). This does not work on the Floaty variant due to lack of hardware support.
Status

View File

@ -136,6 +136,11 @@ The main features
fermentation vessel. This sequence takes 900 ms seconds to execute and besides wifi connection this is what consumes the most
battery. With more testing this might be changes to either speed up or provide more stable readings.
* **Crash detection and Error Logging**
There is a build in logging function so that errors that occurs can be detected and logged to a file. On the ESP8266 crashes will also
be logged so that these problems can be detected and fixed. Crash logging is not available on the ESP32 variants.
* **Performance measurements**
I've also create a small library to measure execution code in some areas of the code that i know is time consuming. This
@ -152,20 +157,45 @@ The main features
See the :ref:`compiling-the-software` for more information.
* **Power measurements**
I've also create a project to measure the power consumption of the device, but more on this later.
Battery life
------------
The long term battery test has now been completed. Using a 2200 mA battery and sending data every 5 minutes to a local server on my network. The battery lasted 47 days which is excellent battery life.
For the 1.2 version I have been running some long term battery tests on a few of the boards and also comparing wifi vs Bluetooth. I was using a standard 2200 mA battery
that was fully charged at the start of the tests. All devices started with factory settings with only a change in push destination and sleep interval.
In another test I had a device running with an sleep interval of only 30s with ok wifi connection. The device lasted 12 days which i think is excellent considering the short sleep interval.
For the wifi tests, I was pushing data every 30 seconds to a local influxdb2 server to reduce errors connected to slow response on the server side. The devices
was placed 2 meters from the wifi AP to ensure a good and stable wifi connection (so ideal conditions).
From what I have discovered it's the WIFI connection or latency to internet hosted that has the most impact on the battery life. The typical runtime in the tests above was around 2 seconds.
For the Bluetooth tests I was pusing data every 10 seconds to a linux server.
To make this comparable I measured how many times the device was able to wake up and push data before the battery was dead. I theory the power consumption when in
deep sleep is to low it can almost be ignored for the calculations. So the impact on battery is mainly caused by how long the device is awake. In the most optimal case
this can be as low as 1.5-2.0 seconds but in reality its probably around 3-4 seconds. Wifi consumes a lot of power so Bluetooth is a better option for long battery life.
.. list-table:: Battery power
:widths: 30 20 20 20
:header-rows: 1
* - Device
- Transmissions
- 30s
- 300s / 15min
* - ESP 8266 (wifi)
- 26,000
- 9 days
- 90 days
* - ESP32 c3 (wifi)
- 12,000
- 4 days
- 43 days
* - ESP32 d1 (ble)
- 56,000
- 20 days
- 196 days
As you can see from the table above there is quite some differences between the boards and connection methods.
Performance
-----------

View File

@ -25,6 +25,7 @@ Schema for esp8266 build
:width: 700
:alt: Schema esp8266
iSpindle based on esp32
=======================
@ -90,7 +91,7 @@ Schema for esp32 build
:alt: Schema esp32
Adding a reed (magnetic) reset switch
=====================================
+++++++++++++++++++++++++++++++++++++
A reed switch is a switch that reacts to magnetic fields. The ones I have tested are normally open and close in proximity to
a magnet.
@ -107,3 +108,37 @@ The reed switch is the glass tube visible under the esp8266.
.. image:: images/reed_build.jpg
:width: 400
:alt: Reed build
Floaty Hydrometer DIY based on esp32 lite
=========================================
Here we have another projects that has build a device similar to the iSpindel but based on an ESP32 instead.
The setup is much simpler and attaches the GYRO to an ESP32 with a build in charger chip. GravityMon works on
this hardware platform as well but there are a few limitations:
* Temperature is read from the GYRO and cannot be changed. This works fine when measuring gravity but when in configuration mode the temperature will increase since it shows the chip temperature.
* No possibility to measure battery level (can be added with additional hardware).
Hardware extensions
===================
GravityMon has implemented a few additions to the standard iSpindel hardware. It's possible to channel the serial console to the TX/RX pins on the chip (these position also applies to all the
ESP32 chips for iSpindel). You need a USB to TTL converter for this to work. This enables you to read the serial console even when on battery (newer chips dont have a diode to remove).
.. note::
You need to compile the software using the -DUSE_SERIAL_PINS option to enable this feature.
Its also possible to force the device into configuration mode by connecting D7/D8 on the board during the startup sequence. This will enable the feature "gravity mode enabled during float".
.. image:: images/8266_pins.jpg
:width: 500
:alt: iSpindel pins
For the floaty device pins 16/17 are used as TX/RX pins and the 13/15 pins are used to force the device into configuration mode. Pin 35 can also be connected to the battery voltage via an voltage divider to be able to read the battery voltage.
.. image:: images/32lite_pins.jpg
:width: 500
:alt: Floaty pins

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

View File

@ -7,7 +7,7 @@ Welcome to GravityMon
#####################
.. note::
This documentation reflects **v1.2 - beta 1**. Last updated 2022-11-04
This documentation reflects **v1.2 - beta 2**. Last updated 2022-11-19
What is GravityMon?
--------------------
@ -25,7 +25,7 @@ implements a lot of the features that has been requested in the original iSpindl
various reasons.
The firmware also supports a iSpindle built using an ESP32 which is pin compatible with esp8266, currently there are 3 options that are
supported ESP32-D1 mini, ESP32-C3 mini and ESP32-S2 mini. See :ref:`hardware`. The more modern hardware will allow better support for SSL and
supported ESP32-D1 mini, ESP32-C3 mini, ESP32-S2 mini, ESP32 lite (floaty). See :ref:`hardware`. The more modern hardware will allow better support for SSL and
other memory intensive functions.
I started GravityMon because I like to create software and wanted to do some microcontroller programming. I had done a few

View File

@ -53,6 +53,9 @@ In the /bin directory you will find 4 different firmware builds;
This is the release build for an ESP32s2-mini variant. When flashing an ESP32 you also need the *partition32s2.bin* file that outlines the flash memory structure. Due to
the size of the firmware we are using a custom partition setup.
* **firmware32lite.bin**
This is the release build for an ESP32lite which is used by the floaty build (clone).
Esptool (esp8266)
=================

View File

@ -3,6 +3,20 @@
Releases
########
v1.2.0 - beta2
==============
Features
++++++++
* Added function to calcualate voltage factor based on measured value.
* Updated battery estimation for the various esp32 boards.
* Added support for the ESP32 lite board which is used in the Floaty Hydrometer variant.
Documentation
+++++++++++++
* Added section about the Floaty hardware.
v1.2.0 - beta1
==============