Hello,
I hope I’m in the right section to ask some questions about the “GravityMon” firmware.
I’m currently experimenting with it on an ESP32 C3 Mini version 2.1.0 assembled on a standard iSpindle PCB (“The Jeffrey”) only for testing, as I understand this board requires some further tweaks to work correctly (decoupling capacitor, an additional resistor for the voltage divider, etc) and I’m planning to build a custom PCB.
Anyway, I flashed the C3 Mini straight from VSCode (since the BrewFlasher app, both WEB and DESKTOP) only caused issues with this board, mostly failed attempts with board stuck on reset loop. Upon realizing that this led me to use the bleeding edge alpha version of GravityMon, I tried downgrading to the latest stable (v. 1.3.0) using the “firmware update” functionality.
The firmware load is successful, and the device boots up, but I am seeing some inconsistencies and I’m not sure if it’s my fault for not understanding the documentation (which is amazingly written, so I’m pretty sure I’m the n00b in that case) or if I have an issue with the components.
After completing the initial configuration (wifi connection details, gyro calibration, formula input) I’m facing the “status” page where everything seems to be working fine: angle, temperature and battery values are being reported and the gravity value is being calculated.
Although it seems the device never enters “monitoring” mode: I left it untouched for a while (>4h) and I noticed it never disconnected from the WiFi and the configuration page was still accessible.
I checked the logs (from the web interface) and I noticed this:
CALC: Validation failed on angle 32.62, deviation too large 3.6075 SG, formula order 2
CALC: Validation failed on angle 24.41, deviation too large 3.7407 SG, formula order 2
CALC: Validation failed on angle 32.62, deviation too large 3.6075 SG, formula order 2
CALC: Validation failed on angle 24.41, deviation too large 3.7407 SG, formula order 2
CALC: Validation failed on angle 32.62, deviation too large 3.6075 SG, formula order 2
CALC: Validation failed on angle 24.41, deviation too large 3.7407 SG, formula order 2
CALC: Validation failed on angle 32.62, deviation too large 3.6075 SG, formula order 2
CALC: Validation failed on angle 24.41, deviation too large 3.7407 SG, formula order 2
CALC: Validation failed on angle 32.62, deviation too large 3.6013 SG, formula order 2
CALC: Validation failed on angle 24.41, deviation too large 3.7342 SG, formula order 2
CALC: Validation failed on angle 32.62, deviation too large 3.5772 SG, formula order 2
CALC: Validation failed on angle 24.41, deviation too large 3.6786 SG, formula order 2
CALC: Validation failed on angle 32.62, deviation too large 3.4838 SG, formula order 2
CALC: Validation failed on angle 24.41, deviation too large 3.5811 SG, formula order 2
CALC: Validation failed on angle 32.62, deviation too large 3.1134 SG, formula order 2
CALC: Validation failed on angle 24.41, deviation too large 3.3608 SG, formula order 2
CALC: Validation failed on angle 32.62, deviation too large 3.1103 SG, formula order 2
CALC: Validation failed on angle 24.41, deviation too large 3.3541 SG, formula order 2
GYRO: No valid calibration values, please calibrate the device.
CFG : Configuration file does not exist
The “CFG: Configuration file does not exist” error seems a bit strange: I did everything as described, and the values shown on the main page suggest that the device is working correctly. I went and repeated the whole configuration (even after a factory reset) thinking that maybe I made some mistakes during initial data input, but the error persisted.
The “GYRO” error really throws me into a bit of confusion: calibration of the gyroscopic module completes successfully, and the device reports that a proper configuration has been saved. (and I’m sure the module works: I’ve tested it separately on a D1 MINI with the dedicated sketch from the library).
So, I went on and inspected the serial output while doing another calibration:
252 I: SDBG: Serial logging started at 115200.
260 I: Main: Started setup for 1f3198.
260 I: Build options: 1.3.0 (..b68835) LOGLEVEL 4
261 I: HELP: Chip=ESP32C3, Rev=4, Feat=0x0012
263 I: CFG : Filesystem mounted.
272 I: WIFI: Current reset counter 0.
284 I: HELP: Last reset cause 'unknown reset reason' (21)
299 I: CFG : Size of configuration file=1195 bytes.
318 I: CFG : Configuration file /gravitymon.json loaded.
335 I: CFG : Size of configuration file=304 bytes.
341 I: CFG : Configuration file /hardware.json loaded.
1236 I: Main: Battery 4.29 V, Gyro=89.05, Run-mode=1.
1273 I: WIFI: Connecting to wifi (0) using stored settings iNeo.
....
1779 I: WIFI: Connected to wifi iNeo ip=192.168.0.46.
1779 I: WIFI: Using mDNS name gravitymon1f3198.
1815 I: TSEN: Found 1 temperature sensor(s). Using 9 bit
1816 I: Main: Activating web server.
[ 1816][E][WiFiGeneric.cpp:1438] hostByName(): DNS Failed for
[ 1817][W][HTTPClient.cpp:1469] returnError(): error(-1): connection refused
1818 E: WIFI: OTA error checking version.json, response=-1
1816 I: Main: Activating web server.
[ 1816][E][WiFiGeneric.cpp:1438] hostByName(): DNS Failed for
[ 1817][W][HTTPClient.cpp:1469] returnError(): error(-1): connection refused
1818 E: WIFI: OTA error checking version.json, response=-1
1819 I: WEB : Configuring web server.
1840 I: WEB : File=error.log, 1691 bytes
1846 I: WEB : File=error2.log, 4038 bytes
1852 I: WEB : File=gravitymon.json, 1195 bytes
1858 I: WEB : File=hardware.json, 304 bytes
1863 I: WEB : File=reset.dat, 1 bytes
1863 I: WEB : Setting up handlers for web server.
[ 1883][E][vfs_api.cpp:104] open(): /littlefs/runtime.log does not exist, no permits for creation
1885 I: WEB : Web server started.
1886 I: Main: Setup completed.
5143 I: WEB : webServer callback for /api/formula(get).
37833 I: WEB : webServer callback for /api/config(get).
[ 37962][E][vfs_api.cpp:104] open(): /littlefs/runtime.log does not exist, no permits for creation
38989 I: WEB : webServer callback for /api/config/advanced(get).
47989 I: WEB : webServer callback for /api/calibrate.
>......>......-1464.00000, 63.00000, 1416.00000, 162.00000, 75.00000, -8.00000
Indeed the gyro calibration is producing the expected results. But then I noticed this line: [vfs_api.cpp:104] open(): /littlefs/runtime.log does not exist, no permits for creation
Apparently, it’s just a log file that can’t be found and I’m not sure if this impacts the intended behaviour of the device; is this error to be considered “normal” and thus ignored?
Regarding the polynomial formula: I’m using the one I calculated for the same device (except while using a D1 Mini on board) using the standard “sugar wash” method, and I’m pretty confident in the results. I used the same formula while configuring the C3 Mini and yet it seems to be failing to calculate a 2nd (and further) degree formula from the data provided.
I also tried to populate the table for the Formula Creation inside the web interface, but the results were the same; reading documentation I tried to increase the “Formula Max Deviation” value in an attempt to force the issue (I know that results are inaccurate this way, I didn’t mean to use in production) but the error persisted.
While looking at the “Formula Calculation” table, another doubt entered my mind: am I reading those values correctly? The use of “comma” instead of “dot” throws me a bit off, so it’s probably just my “metric brain” being confused and this has nothing to do with it…but, for example, reading a value in “Specific Gravity” for pure water I would read it as “one thousand” (written 1000 or 1.000) and not like “one point zero zero” or “one comma zero zero” (written 1,000). So I was wondering…compiling the table with a value of “1,0700” corresponds to “1070” (one thousand and seventy) or not? If so it may explain why I’m having trouble getting a valid formula.
(although It won’t explain why the error persists even if I’m using the 3rd Degree polynomial calculated before with the iSpindle Calculator)
Attached there are also a few screenshots from the web interface, hoping they might prove useful in finding my mistakes.
Thank you for your time reading this, and If I posted in the wrong section please beg my pardon: if you’ll let me know I’ll immediately remove the post and move it to the appropriate section/discussion.