diff --git a/docs/source/backlog.rst b/docs/source/backlog.rst index f9116f3..c5ff5b2 100644 --- a/docs/source/backlog.rst +++ b/docs/source/backlog.rst @@ -4,13 +4,16 @@ Backlog of changes 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 - Updates over OTA (from PC) +- Write compile instructions +- Write contribution instructions +- publish docs Code ------------- - Support for MQTT - Support for plato +- Use pre-commit for validating check-in +- Automatic builds via github actions diff --git a/docs/source/compiling.rst b/docs/source/compiling.rst index b57b217..774b8f9 100644 --- a/docs/source/compiling.rst +++ b/docs/source/compiling.rst @@ -1,32 +1,21 @@ Compiling the software ----------------------- +This section is under construction. + + VSCODE + PlatformIO ============================= -TODO + Targets ============================= -TODO + Source structure ============================= -TODO + 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. \ No newline at end of file diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index 647636a..0fb403c 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -14,6 +14,10 @@ Main index 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*. 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) .. image:: images/device.png - :width: 400 + :width: 800 :alt: Device Settings @@ -56,7 +60,7 @@ Device Setting ************** .. image:: images/config1.png - :width: 400 + :width: 800 :alt: Device Settings * **Device name:** @@ -87,7 +91,7 @@ Push Settings ************* .. image:: images/config2.png - :width: 400 + :width: 800 :alt: Push Settings * **HTTP URL 1:** @@ -123,7 +127,7 @@ Gravity Settings **************** .. image:: images/config3.png - :width: 400 + :width: 800 :alt: Gravity Settings * **Gravity formula:** @@ -145,7 +149,7 @@ Hardware Settings ***************** .. image:: images/config4.png - :width: 400 + :width: 800 :alt: Hardware Settings * **Voltage factor:** @@ -168,7 +172,6 @@ Hardware Settings :: http://192.168.1.1/firmware/gravmon/ - Contents version.json @@ -180,11 +183,205 @@ Hardware Settings 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 ============================= -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 ============================= diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst index 798027b..7472165 100644 --- a/docs/source/contributing.rst +++ b/docs/source/contributing.rst @@ -1,5 +1,5 @@ Contributing ------------------------ +------------ This section is under construction. diff --git a/docs/source/images/config1.png b/docs/source/images/config1.png index f10c5a2..af5ab28 100644 Binary files a/docs/source/images/config1.png and b/docs/source/images/config1.png differ diff --git a/docs/source/images/config2.png b/docs/source/images/config2.png index 720bffe..f1fbde6 100644 Binary files a/docs/source/images/config2.png and b/docs/source/images/config2.png differ diff --git a/docs/source/images/config3.png b/docs/source/images/config3.png index 4905580..568e17c 100644 Binary files a/docs/source/images/config3.png and b/docs/source/images/config3.png differ diff --git a/docs/source/images/config4.png b/docs/source/images/config4.png index 12a15ea..d7c9c60 100644 Binary files a/docs/source/images/config4.png and b/docs/source/images/config4.png differ diff --git a/docs/source/images/device.png b/docs/source/images/device.png index 154cc56..6d445a0 100644 Binary files a/docs/source/images/device.png and b/docs/source/images/device.png differ diff --git a/docs/source/images/formula1.png b/docs/source/images/formula1.png new file mode 100644 index 0000000..dede459 Binary files /dev/null and b/docs/source/images/formula1.png differ diff --git a/docs/source/images/formula2.png b/docs/source/images/formula2.png new file mode 100644 index 0000000..6ed084d Binary files /dev/null and b/docs/source/images/formula2.png differ diff --git a/img/index.png b/docs/source/images/index.png similarity index 100% rename from img/index.png rename to docs/source/images/index.png diff --git a/docs/source/index.rst b/docs/source/index.rst index 94281e2..659070e 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -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. -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:: @@ -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/PaulStoffregen/OneWire * https://github.com/milesburton/Arduino-Temperature-Control-Library +* https://github.com/Rotario/arduinoCurveFitting +* https://graphjs.com/ +* https://getbootstrap.com/ .. toctree:: diff --git a/img/config1.png b/img/config1.png deleted file mode 100644 index af5ab28..0000000 Binary files a/img/config1.png and /dev/null differ diff --git a/img/config2.png b/img/config2.png deleted file mode 100644 index f1fbde6..0000000 Binary files a/img/config2.png and /dev/null differ diff --git a/img/config3.png b/img/config3.png deleted file mode 100644 index 568e17c..0000000 Binary files a/img/config3.png and /dev/null differ diff --git a/img/config4.png b/img/config4.png deleted file mode 100644 index d7c9c60..0000000 Binary files a/img/config4.png and /dev/null differ diff --git a/img/device.png b/img/device.png deleted file mode 100644 index 6d445a0..0000000 Binary files a/img/device.png and /dev/null differ