alfkoehn / CO2_monitor

An open-source CO2 monitor helping to ensure a healthy environment in a class room and slowing down the spread of the corona SARS-CoV-2 virus.
https://github.com/alfkoehn/CO2_monitor
43 stars 8 forks source link

Scheiby mqtt #4

Closed scheiby closed 3 years ago

scheiby commented 3 years ago

Hi,

I plan to build an own CO2 ampel, but would like to add MQTT push to own MQTT server capability.

Code is Arduino: Check passed in vscode IDE, but not runned on ESP itself (SCD30 sensor is missing at the moment).

Code changes in detail:

greetings from Cottbus,

Daniel

alfkoehn commented 3 years ago

Hi,

thanks for your pull requests, I'm always very excited to see my code/project being used by fellow makers :)

Since I'm not familiar with MQTT yet, I carefully looked through your code and it all seems to make sense. Before accepting your pull request, I wanted to make sure to understand the following:

  1. esp.getvcc is used to get the supply voltage of the esp, because you plan to power it with batteries, correct ?
  2. I would like to see a test with a SCD30 before accepting it, did you already had time to do this (and get your hands on an SCD30) ?

Cheers from Stuttgart, Alf

scheiby commented 3 years ago

Hi Alf,

  1. yes, correctly esp.getvcc() returns the current voltage value of the ESP chip.
  2. no, SCD30 hasn't arrived at the moment.

Code indentation I tried to follow your style. But maybe not completely consistent ... and yes there can be long discussions about this ;-)

Greetings,

Daniel

alfkoehn commented 3 years ago

Just had another look at the code and my only concern at the moment is if AsyncWebServer somehow interferes with WiFiClient if both are used, do you have any experience with that?

alfkoehn commented 3 years ago

After my first coffee, I am wondering if #include <ESP8266HTTPClient.h> is really needed (in my understanding, this is not the case, but maybe I just need a second coffee) ?

scheiby commented 3 years ago

good question.

I will build da SCD30-free setup (using some tempsensor for values) and check AsyncWebserver + MQTT compatibity. Planned for weekend, hopefully I will find time ;-)

Daniel

alfkoehn commented 3 years ago

Perfect, thanks :)

I'll provide some more detailed feedback with some comments/suggestions from my side on your pull requests tonight or tomorrow.

Cheers, Alf