misc/watchy-experimentation#3: Report steps and battery to InfluxDB



Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Created: 14-Jun-23 19:22



Description

Ultimately, I want the watch to periodically query from InfluxDB, but as a simple(r) test, I first want to include the ESP InfluxDB library and use it to write the watch's battery level and step-count stats to InfluxDB.

Once I've got that working I'll then look at querying



Issue Links

Toggle State Changes

Activity


assigned to @btasker

To make the Influx library available, in Arduino's IDE I've gone to Sketch -> IncludeLibrary -> Manage Libraries and then searched for and installed ESP8266 InfluxDB (supports ESP32 too)

Library details are at https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino

verified

mentioned in commit sysconfigs/watchy-code@f5849d0e389342ee62e4a655ce7788cbf21baf47

Commit: sysconfigs/watchy-code@f5849d0e389342ee62e4a655ce7788cbf21baf47 
Author: B Tasker                            
                            
Date: 2023-06-14T21:59:41.000+01:00 

Message

Adding InfluxDB stats writes (disabled) misc/watchy-experimentation#3

This adds a (now disabled) call to write stats to InfluxDB.

However, the write is currently failing without ever touching the network.

Need to either read through the library code to see what might be causing it or switch approach and build a HTTP request manually.

+36 -0 (36 lines changed)
verified

mentioned in commit sysconfigs/watchy-code@ef667ec21395810c14a0216b6cb01500b1827f2c

Commit: sysconfigs/watchy-code@ef667ec21395810c14a0216b6cb01500b1827f2c 
Author: B Tasker                            
                            
Date: 2023-06-14T22:26:19.000+01:00 

Message

Enable writing of stats into InfluxDB misc/watchy-experimentation#3

Now, call me old-fashioned, but I'm of the mind that it helps if you TURN WIFI ON before attempting to write into the local network.

Points are confirmed to have arrived at their destination

+23 -19 (42 lines changed)

The watch is now writing points into InfluxDB roughly every minute

Screenshot_20230614_222910

verified

mentioned in commit sysconfigs/watchy-code@f87eef7156567a1e71143fb891b4fde8aeb7f222

Commit: sysconfigs/watchy-code@f87eef7156567a1e71143fb891b4fde8aeb7f222 
Author: B Tasker                            
                            
Date: 2023-06-14T23:07:23.000+01:00 

Message

Update database name and remove debug output misc/watchy-experimentation#3

Probably best not to scrawl "oops" across the watchface any time that a write can't be completed.

This also updates the database being written into from testing_db to the DB that I actually want the stats in.

+3 -6 (9 lines changed)

We're up and running, I'm going to mark this as done.

Will raise a seperate ticket for querying data from InfluxDB

mentioned in issue #4

mentioned in issue #5

marked this issue as related to #5