wickeddevice / aqev2fw Goto Github PK
View Code? Open in Web Editor NEWThe baseline code for Air Quality Egg version 2 WildFire firmware
The baseline code for Air Quality Egg version 2 WildFire firmware
Flash utilization is running pretty high, this is in the code but not officially supported, see if it's worthwhile to remove it to make room for other features.
e.g. "use lcd" which is true by default.
the firmware 2.0.4 displays "LOGGING DATA TO USB-SERIAL" but I'll prefer to see the measurements on the display.
The Model C Particulate unit already has code integrated to support a GPS module connected to Serial1. Now that we've made more flash space available by removing SmartConfig support, we can integrate this GPS support code into Model A and Model B baselines as well.
Humidity should always be reported in the range of 0 to 100% inclusive. Values outside this range should be truncated to the extents.
We've got some new data from Spec Sensors that suggests a slight change to the slope calculation (related to the TIA gain for our electronics). Modify start up code to recalculate and store slope as necessary.
restore defaults sets temperature offset to 3.5 and humidity offset to 0.0, but should, if possible restore them from backed up settings for the individual unit.
If the mode does not require Wi-Fi shut down the CC3000 to reduce power consumption.
i get the following error when compiling:
AQEV2FW.ino:5:19: fatal error: SdFat.h: No such file or directory
compilation terminated.
Fout bij compileren.
Some inquiry suggests there may be a linear response effect due to atmospheric pressure. That is to say At 0.9 atmospheres, the sensors response would be 90% of what it would be at 1 atmosphere. Add a configurable parameter that allows one to compensate for that effect (e.g. implement an 'altitude' command, that sets an atmospheric_pressure_coefficient value in EEPROM, and then uses it to adjust reported concentration at runtime).
Make it so that the actual files don't contain header rows, but rather that download command emits a header row instead.
Currently Eggs point at opensensors.io for the default MQTT server. OpenSensors wants us to start pointing at mqtt.opensensors.io instead. This may lead to more reliable MQTT connections.
Software currently assumes we are using the MCP3421A0 ADC, but there are 7 other variants (MCP3421A1 ... MCP3421A7) that differ only on their hard-coded I2C address. Manufacturing flexibility would be gained by making these all substitutes in the design. The library has provisions for handling this as well, by using the autoprobe function on slot selection.
Op-mode Normal + Valid SSID + Differing Flash/EEPROM Config + Invalid Flash Config ... should not result in a "Config Integrity Check Failed" message and automatic drop into Config mode. Rather, it should result in another attempt to connect.
Reported humidity (to the LCD and CSV output) needs to take into account the humidity offset settings.
air quality egg will not connect to the network. it fails most of the time while resoliving the mqtt server
tested with 2.0.4 firmware from GitHub (experienced it with my ntp-version as well, but can reproduce without my changes). tried both with dhcp and with static ip, no difference.
i'll sent logfiles to support.
maybe it's related to: http://forums.adafruit.com/viewtopic.php?f=22&p=265865 (Re: Possible DNS errors with CC3000)
"We've seen CC3000s hold onto the DNS server address longer than they should before. It seems to be some kind of glitch in the firmware. You can usually fix the problem by setting all the addresses statically, then telling the CC3000 to reboot and get a DHCP connection again."
Default topic prefix is /orgs/wd/aqe/, which is hard-coded presently. Create a new command 'mqttprefix' to allow users to change this prefix if they wish.
Currently the configuration backup / restore / recovery mechanisms work by copying large chunks of memory into RAM to compare and manipulate. To reduce memory demands (and the possibility of stack overflow), refactor these aspects of the software to operate on Internal EEPROM and External Flash in a progressive / iterative manner.
If there is an internet connection the air quality egg can get the time (for the CSV logging) from an NTP-server (nl.pool.ntp.org in my case). It might not be accurate on the (micro)second, but I think accuracy on minute is good enough.
I did a proof of concept implementation based on
https://github.com/adafruit/Adafruit_CC3000_Library/blob/master/examples/InternetTime/InternetTime.ino and with the current master. It gets the time from NTP in GMT/Zulu time.
I also found this NTP client on http://playground.arduino.cc/Code/NTPclient but that was not suitable for CC3000.
Please bare with me, because this is my first contribution to github/arduino programming.
Make it so that, in addition to being able to download a single file by name, you can also download all the files between two dates (inclusive) in a single command. This can be done by defining a two argument version of the download command that takes two YYMMDDHH strings for the start and end dates.
I think "opmode zero" is fairly redundant in light of "opmode offline." Consider removing "opmode zero" in order to free up some RAM and Flash for other purposes.
Currently offline filename is YYYYMMDD.CSV. Change it to YYMMDDHH.CSV to store less data per file and to reduce impacts of data loss.
I want to use the AQE in offline mode and use a USB-cable to get the reading to my raspberry pi using a python script that uses PySerial.
I don't need the readings written to the AQE sdcard.
Is it possible to change printCsvDataLine function so that in case
((mode == SUBMODE_OFFLINE) && !init_sdcard_ok)
it prints
setLCD_P(PSTR(" LOGGING DATA "
" TO SERIAL-USB "));
BTW I'm new to Arduino programming. Is there any guide / documentatino in how to program an AQE v2 available?
I think there's a sign error in the temperature compensation formula (still analyzing datasheets to be sure).
Specifically, "1.0f +" possibly needs to be changed to "1.0f -" on this line, and probably also on this line.
Also consider whether a higher fidelity correction is merited. Current model is a simple two-piece linear estimation).
Currently sample depth and rate are statically configured (5 seconds between samples, 32 samples moving average for no2 and co, 16 samples moving average for temperature and humidity). The reporting rate is also currently coincident with the sampling rate.
Within memory constraints, allow for the run-time configuration of these parameters.
If you do 'list files' then do 'download filename', then do 'list files' again, the file 'filename' is no longer listed in the results. Probably a file handle not being closed properly. Probably not the cause, but the 'root' filehandle is not being closed at all in the list files command.
Note: You don't even have to do 'list files' first. Also even though they aren't listed, you can still do download filename successfully. And multiple calls to list files always return the same results.
Change the "no2_cal" and "co_cal" commands to "no2_sen" and "co_sen" respectively. This is intended to reduce confusion and normalize terminology. The value in question is in fact the calibrated sensitivity provided by the manufacturer.
There should be a config command to disable ota. Implement a special case "updatesrv disable" that clears the EEPROM_UPDATE_SERVER_NAME string. Make places that read that value check for the blank string and react appropriately.
We noticed some apparent numerical artifacts (discontinuities in moving averages) in the time series graphs recently and have narrowed the issue down to safe_dstrtof causing numbers to be turned into strings incorrectly when they have leading zeros in the fractional part (i.e. 3.025) would become the string ("3.25"). So errors introduced by this bug are always less than 1 unit.
When an RTC is first powered on it's OSF bit is set and that makes init_rtc_ok not succeed because rtc.isrunning returns false. Unfortunately the RTCLib doesn't provide a method to clear that flag, so we just need to patch it into the sketch. A good place to clear it is when the datetime command gets processed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.