Giter Site home page Giter Site logo

melkati / co2-gadget Goto Github PK

View Code? Open in Web Editor NEW
60.0 60.0 13.0 23.35 MB

An advanced CO2 Monitor/Meter firmware for ESP32 with Android and iOS App for real time visualization and charting of air data, data logger, a variety of communication options (BLE, WIFI, MQTT, ESP-Now) and many supported sensors.

Home Page: https://emariete.com/medidor-co2-gadget/

License: GNU General Public License v3.0

C++ 92.00% HTML 2.84% JavaScript 3.92% CSS 0.68% PowerShell 0.56%
air air-quality co2 esp32 meter monitor mqtt quality scd30 scd40 scd41 scd4x senseair sensirion

co2-gadget's People

Contributors

acmatl avatar coscolin avatar hpsaturn avatar melkati avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

co2-gadget's Issues

Add support for ESP32-C3

Is your feature request related to a problem? Please describe.
Please add support for esp32-c3 cpu.

Describe the solution you'd like
To be able to compile for the esp32-c3

Describe alternatives you've considered
I have tried to modify the code, but the code, and libs that are used, assume that all esp32 cpus have serial2, which the esp32-c3 doesn't.
Even though I am able to compile the code, I can't get it running. Don't know what is wrong.

Add WS2812B LEDS (NeoPixels) to show CO2 level

Based on Adafruit Library to save on memory (FastLED needs more memory).

To start with it will support 10 LEDs (pixels), all with the same color. Color will be same as display with same definitions for Green, Yellow and Red. In the future I can add independent options if there is a need.

  • Create define for GPIO to connect LEDs
  • Add functionality to code
  • Add menu selector for RGB, GBR, NEO_RGBW, etc
  • Add power-saving (auto OFF) with battery
  • Test functionality
  • Take configuration menu screenshot
  • Create documentation on how to use

SSH support

When installed it is not always easy to reach the panel or USB interface to change the configuration.
Is it possible to implement SSH to be able to configure over the WiFi connection?

Add displaying notifications

Adds sowing notifications (information, warnings and errors) to the user on the device display (if any).

Starting development...

Allow for 2 orientations

Please create a new #define that sets 3 things depending on being commented or in effect:
1-Screen orientation (1 or 3)
2-pin number for Forward/Enter button
3-pin number for Back button

Thats it. I do this in all my projects. Standard accommodation for those wanting to have power on the other side from that coded. Keeps the top button doing the same function in either orientation.

Thanks. I hope I will be able to successfully run this, soon with my MHZ sensor.

Mike Morrow

Add LoRa/LoRaWAN

Add LoRa protocol to connect sensors over long distances and send data if no wifi network is available.

Addressable LED not applying the saved configuration at startup

From Bart's comment on blog

I can clearly see the setting changing the led from red to green and vice versa but saving the settings and reboot puts the led back to red when it should be green. After checking the settings again after the reboot they are correctly saved. (I have the rgb version). If I toggle them again, it gets the correct color again.

Using: Version: 0.5.049-feature-neopixel Flavour: ESP32 OLED

WIFI password length limit

HI,
I have build a CO2 sensor using the CO2 Gadget from mariete. It works fine in its standalone configuration. Now I would like to activate the wifi. unfortunately, it seems that the length of the password is limited to 28 characters whereas my wifi password uses 37 cars. Do you confirm this limit ? If yes is it possible to increase this length ?

Regards

How to configure MQTT to HomeAssistant Mosquitto

Seems not to connect
Initializing MQTT to broker IP: 192.168.100.36
-->[MQTT] Attempting MQTT connection... not possible to connect to 192.168.100.36 Connection status: 5. (22 of 12 retries)
-->[MQTT] Max retries to connect to MQTT broker reached, disabling MQTT...

Turn on display when CO2 values rises limits

During battery operation, if user has selected display automatic turn off after X seconds it could be neccesary turn on display if measures rise to high values.

I think it could be turn on when measures increase or decrease 50 or 100 ppm from last value displayed, and turn it off again after X seconds.

When measures are at upper high risk limit, it could be neccesary to show values at least once time every 10 minutes, although don't change values.

Security must be more than battery optimization.

Add option to select if outputs should work in «relay mode» or «LED mode»

From conversation in blog

As the outputs double as relay and regular RGB LED there is an related effect:

The orange output is not turned off when red goes on (to keep ventilation or air cleaning equipment working when CO2 rises).
This means when a RGB LED is connected when the LED lights red, yellow will be still on so there is not a "only red" light.

To fix it when working with LED I’ll include a new option in menu to select if these outputs should work in «relay mode» (keeping orange on when red goes on) or «LED mode» (turning orange off when red goes on).

Strange behavior of battery indicator

I have an 18650 connected to the battery connector of the TTGO T-Display and configured the battery to be full at 4.1 volt and empty at 3.0 volt in the menu on the device.

  • When I have USB connected, it shows 4.9-5V in blue and a full battery indicator (4 bars).
  • Then I disconnect USB and battery indicator still shows 5V in grey, but battery indicator only shows 1 bar
  • Next voltage updates to real value of battery output of 3.9V, with only 1 bar
  • Eventually it drops to 3.8V and shows 1 or 2 bars intermittently and sometimes also empty battery
  • when at 3.7V it shows a red battery empty icon with no bars

In other words, the indicator seems to have it's own life, separate from the voltage readout :)

Suggestion:

  • show 4 bars above 75%
  • show 3 bars from 50%-74%
  • show 2 bars from 25%-49%
  • show 1 bar from 5%-24%
  • show 0 bars below 5%

Add web settings page

Add possibility to modify settings via web page.

  • Basic refactoring of preferences to permit web config
  • Preferences HTML form creation
  • Load current settings on load
  • Put new settings on current run time
  • Add error checking and sanity checks
  • Add option to save changes into NVR
  • Add Normal/Expert and advanced view
  • Add option to reboot from settings page

Time scheduler for relay outputs

I want to make a Co2 meter using sensirion scd30 + lilygo ttgo t-display for a greenhouse.
I want the device to control an electromagnetic gas valve that opens at 1000ppm and closes at 1500ppm.
If there is a solution I would like to thank you very much.

CO2 Gadget unresponsive if trouble connecting to MQTT broker

As conversation started at the Telegram group (https://t.me/emariete_chat/31250):

Under some circumstances (not always), if MQTT functionality is enabled and there are issues connecting to the MQTT broker the action of trying to connect to the broker unsuccessfully blocks execution for some seconds, making CO2 Gadget unresponsive (menu not working as CO2 Gadget is working heavily to reconnect to the MQTT broker).

Store encrypted passwords

First at all, hide passwords in menu.

If you want to change any password you must to type it again completely.

Maybe is possible to store passwords with MD5 encrypt / decrypt code?

Add support for ESP-NOW (inexpensive and easy LoRa alternative)

ESP-NOW is already working in my "Ultra Low Power Consumption CO2 Meter" and in the "ESP-NOW to MQTT Gateway" (both still unpublished) so must adapt and include source code.

  • Add functionality to code and include options in preferences to save to NVR
  • Add configuration to menu
  • Add ESP-NOW icon to display to show status
  • Test functionality
  • Take configuration menu screenshot
  • Create documentation on how to use

Changes

Hello. Please output the СO2 signals to separate pins for green, orange and red.

Support for I2C OLED Displays

Include full support for the most common I2C OLED Displays

  • Code refactor to accommodate OLED displays
  • Implement basic skeleton and include needed libraries and fonts
  • Design and convert new splash creen
  • Implement first display: SH1106 1.3" 128x64
  • Show basic data (real time CO2 measurements) on screen
  • Make menu work with OLED display
  • Adapt setDisplayBrightness() to OLED
  • Test by external users
  • Adapt menu to active display (p.eg: layout, font sizes, Brightness with TFT or Contrast with OLED)
  • Show more measurements in real time (temperature, humidity)
  • Add battery icon
  • Add icons for WiFi, MQTT, Bluetooth, ESP-NOW
  • Include flavor in Continuous Integration
  • Take screenshots
  • Create documentation on how to use

Trying to add a BME280 to my CO2 gadget with MH-Z19B

First of all thank for your work on this. I love the project!

I'm not sure if this should be a feature request or if this should already work. I've built the CO2 gadget and really love it. I'm using it with a MH-Z19B sensor together with an 18650 in a case I found somewhere and it works fantastic.

I would like to add a BME280 sensor for temp/humidity/air pressure measurement, but haven't been able to get it working yet. From the documentation it wasn't clear to me if this should be possible with the precompiled firmware, so I just tried.

I've connected it to the i2c bus at pins 21/22 and to the 3.3v output of the T-Display, but it doesn't seem to get detected when checking the console output. (also tried swapping 21 and 22 as I wasn't sure which one was SDA and SCL)

Can you enlighten me on how to proceed?

Menu Option change C to F for us non-metric people

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
Menu option to change Temperature from C to F for all of us that didn't convert to Metric!

Describe alternatives you've considered
I made in the CO2_Gadget_Sensors.h file still apply? If not, how do I made the changes (changing C for F) {C * 1.8+32}😀
but it didn't get uploaded.

Additional context
Thanks for all your hard work and time you have spent working on this project.

Memory use with all options enabled

There are some memory issues (that's why this issue is also labeled as bug) when all options are enabled (WiFi, MQTT, BLE). We have reached the limits of memory.

Bluetooth library is tacking too much memory.

One possibility is to swap actual bluetooth library with NimBLE (a similar less memory angry library).

Right now, it forces to have to choose functionalities.

Memory use with WiFi, MQTT and Bluetooth:

RAM:   [==        ]  21.6% (used 70616 bytes from 327680 bytes)
Flash: [========= ]  94.4% (used 1856360 bytes from 1966080 bytes)

Memory use with WiFi, MQTT (without Bluetooth):

RAM:   [==        ]  16.1% (used 52632 bytes from 327680 bytes)
Flash: [======    ]  61.9% (used 1217832 bytes from 1966080 bytes)

Calibration - Require stable measures before calibrate

Two options::

  • Before calibration, check log measures and apply calibration only if last 5 minutes measures are less than 30ppm between the lowest and highest values.
  • After click calibration, wait 5 minutes to check measures are stable.

It could be a mix of two options.

Cannot configure "longer" mqtt topic than previously configured

Describe the bug
When I want to configure a longer mqtt topic name than previously configured, I cannot add the additional characters. So if my topic was co2 I cannot change it to co2-sensor for example.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Configuration/MQTT Config'
  2. Scroll down to 'Topic'
  3. Change 'Topic' to 'co2'
  4. Save configuration
  5. Go back to 'Configuration/MQTT Config'
  6. Scroll down to 'Topic'
  7. Change 'Topic' to 'co2-sensor'
  8. It is not possible to add the - character.

Expected behavior
It should be possible to add characters after the last character of the previous setting.

Additional context
Looking at the code, the problem might be related with truncating the tempstring before copying it to the used value here: https://github.com/melkati/CO2-Gadget/blob/master/CO2_Gadget_Menu.h#L383

Note that this pattern is used for most settings.

Add and test CO2 sensors others than SCD30 and SCD4x

TODO

  • Include in menu the selection for CO2 sensors others than SCD30 and SCD4x
  • Save sensor selection to preferences (NVR)
  • Include the necessary logic lo support sensor selection (including serial connected sensors)
  • Test SCD30 Sensor
  • Test SCD41 Sensor
  • Test MHZ19 Sensor
  • Test CM1106 Sensor
  • Test SENSEAIRS8 Sensor
  • Document sensor selection on blog page

Add OTA functionality

Add Over The Air functionality so it's possible to update firmware from CO2 Gadget internal web page without physical access need.

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.