Code Monkey home page Code Monkey logo

air_quality's People

Contributors

disquisitioner avatar ericklein avatar

Watchers

 avatar  avatar

air_quality's Issues

Text wrapping for screen display

screenAlert can accept messages with lengths longer than available space. will need a better wrapping function than provided by .print.

Screen not updating for many hours at a time

Some devices are not updating their screens and data sources for hours or days at a time, but I do not understand why. The devices have sufficient battery charge. If they can not connect to the Internet, they are supposed to update the screen only and display an error message about the lack of connectivity. This is not happening.

Battery monitoring for non-LC709203

Most of the Adafruit ESP32 Feather boards have a technique for monitoring at least battery voltage. Can I create a LUT to determine battery percentage or use the LUT the LC709203 library uses? I think @disquisitioner has explored this idea?

Inside / Outside Comparison Trend on display

Using the right side of the display. Same concept as the local trend displayed on the left side of the display. The only difference is the comparison of local inside data (from the device) to local outside data from Open Weather.

For both of the trend data features. It will be interesting to figure out what is the right amount of change in data to trigger a trend change. Perhaps we could experiment with 2% as a starting point across the board. Future research on what is meaningful delta could lead to an update of this reference point for different data. For example, 2% change in temperature roughly equates to 1.5*F, which isn't a huge change in a nominal interior of a home. However the same 2% change in CO2 or O2 might have much greater health consequences.

split secrets.h into real secrets and config.h

Outside developers can not see the structure of the MQTT feeds as currently are in secrets.h and therefore not published in github. Split non secrets into a config.h file that is published

fork continuous loop and one time run code

there are optimizations for code ordering and error handling that are needed/possible for one time run that have an undetermined effect on the continuous loop implementation. It might not be possible to keep both implementations in the same code base with #define selection at compilation.

Suggestion is to create separate branches for both and optimize both branches

Data should be floating point internally, and converted to integers as appropriate for display and export

Currently sensor readings are converted to integers as part of acquiring values from the sensors (both attached sensors and through getWeather(). That's probably fine for what's shown on the display, but causes loss of precision given most of our sensors are more accurate than that, the data is now also being shared with other services (e.g., MQTT and Dweet), and we've also talked about adding database support to store values for subsequent analysis, alert triggers, IFTTT, etc.

I propose we store data internally as floating point wherever relevant and convert it to integer or fixed point wherever necessary -- in the code that displays values on the eInk display, before they get sent to other services, etc.

This would require changing the envData typedef/struct to use floats rather than uint16_t, at least for temperature and humidity values. (Our current CO2 sensor returns readings as an integer, so CO2 values could stay uint16_t.) There would be minimal change in readSensor() and getWeather() as in most cases conversion from the floating point sensor values to integers happens implicitly via the compiler through assignment. (The exception here is temperature, which gets converted from C to F and then cast as an integer.) Some change would also be needed to infoScreen() to properly format floats as integers (or fixed precision) for display.

I like the idea that we'd retain whatever values sensors provide as our internal data model and let any code using that data for display, sharing, export, storage, alerts, etc. do the right math at the point of use, whatever that may turn out to be (and which they know best anyhow).

co2 not publishing to MQTT

version : influx_v1_v2 that will be promoted to master.
reproduced on two separate installs.

this could be an issue given I've been editing the sensor code in this branch and perhaps I introduced the problem, or it is inherent in this branch. Let's evaluate once we've integrated into master

aq_network.httpGETRequest() error handling insufficient

Most http.get error codes will not return a payload, but aq_network.httpGETRequest() pretends to send something back. aq_network.httpGETRequest() was based on some anemic sample code without error handling, which we need to review or add.

Battery monitor not detected is a FATAL error

If the LC709203 is not detected, the client code will not run. This should not be FATAL because if the battery runs down but we can't detect it, the backend will not receive sensor values over an extended window causing a different backend error which will alert owner to the underlying issue.

Add a routine to clear nv storage

Need a routine to clear nv storage in the case of the value pool being incorrect and there is a need for accurate data to be uploaded. If given enough time, the averages will clean themselves of errant values, but if time to report accurate values is critical, we could add a routine to remove all values and let the code restart building the averages.

Add support for dweet.io

Add support for dweet.io, which provides a free cloud service for devices to publish messages and information, This would make it easy to see the most recent sensor readings, information about the device itself (e.g., WiFi RSSI and IP address) and even error/status messages. Uploads happen via an HTTP POST and JSON, which is easy to add given we already have HTTP connectivity support in the app.

OLED screen is not dimmed

OLED screen is on all the time, which could cause OLED burn in, and in dark environments, is very bright. Could be addressed by time based or gesture based dimming function.

Local trend on display

Display trend information on display in 12hrs, 24hrs, and 72hrs modes. For the purpose of prototyping, we could use these symbols to represent the data:
"/" trend up - data is trending up compared to the previous time segment
"" trend down - data is trending down compared to the previous time segment
"-" trend even - data is even compared to the previous time segment.

12 segment is all we need at this time. In 12hrs mode, each segment represents average sample data for one hour. In 24hrs mode, each segment represents average sample data for two hours. In 72hrs mode, each segment represents average sample data for six hours.

If we stay with the current three lines format on the display. Using the left side of the display. The top line would be 12hrs mode, the mid line would be 24hrs mode, the bottom line would be 72hr mode.

Delta triggers from [https://github.com//issues/7]
Temp changes by 1 degree F
Humidity changes by 1%
CO2 level changes by 25

Optmize zuluTimeString()

I've failed at compressing zuluDateTimeString() twice, what is the issue relative to string buildout?

Temp, humidity delta is reporting <1 changes as 1 in infoScreen

sensor value = 66.32
averaged value (from total sample set) is 66.52

This is an edge case where subtracting the rounded (+.5) (int) of these values yields -1 even though the temperature did not change 1 degree.

Solution is likely to (int) the base values and look for >1 movement.

SCD40 temperature calibration

SCD40 is samping ~ 4F higher than external sensor sitting next to it. Need to check with calibrated sensor to determine which sensor is inaccurate, and if SCD40, look for calibration API

Unified message manager

Add a unified message manager that handles debug, alert, and fatal messages across serial monitor, LED, screen, and (mqtt) logging.

DWEET support for when CO2 sensor is not available

When CO2 sensor is not available, AQ uses the convention of setting sensorData.internalCO2 to 10000. DWEET will attempt to push CO2 values even when there is no sensor reading it, so it will push 10000 upstream. Is that the intended behavior?

internalTemp is never set to 10000 although code has checks for it

Routines looking for a missing temp/humidity sensor look for sensorData.internalTemp == 10000, though there is no place in the code that sets this. The code moved to deepSleep() when a sensor is not available (see if the problem goes away on its own) so these ==10000 dependencies need to be addressed.

Send changed data only

Only log data (MQTT, SD, etc.) when:

Temp changes by 1 degree F
Humidity changes by 1%
CO2 level changes by 25

post_dweet() Ethernet support

post_dweet() has WiFi connection check but not for Ethernet. It might be better to say we need a generic handler to check Internet status?

NTP relies on while loop

Review the NTP setup code for use of while until loop. NTP should fail through rather than infinitely waiting

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.