Page 3 of 10

Re: ESP8266 Air quality sensor

Posted: Tuesday 07 November 2017 19:25
by jvdz
This is a setting for the MHZ19b and supported both according the manual.

Jos

Re: ESP8266 Air quality sensor

Posted: Tuesday 07 November 2017 19:49
by LouiS22
jvdz wrote: Tuesday 07 November 2017 18:45 Pretty sure it worked that way before I changed my ESPEASY version, which is to be expected. ;)
Hm ;)

Re: ESP8266 Air quality sensor

Posted: Tuesday 07 November 2017 20:58
by Igrek
jvdz wrote: Tuesday 07 November 2017 18:07 Just enable the Rules in ESPEasy and add this rule:
...
Jos
Hi, Jos!
I have problem with dummy air quality, but with Custom sensor this work fine!
Big thanks!
Igor.

Re: ESP8266 Air quality sensor

Posted: Tuesday 07 November 2017 21:04
by jvdz
Not sure I fully understand you post here.
You mean the standard ESPEASY setting using the HTTP & IDX settings like i show in the screenshot don't work for an Dummy Air Quality sensor but working for a custom sensor? Guess you are using the standard Mega ESPEASY?
The standard one needs the Rules approach. My version has a different device defined that fixes the used URL to update the Air Quality sensor.

Jos

Re: ESP8266 Air quality sensor

Posted: Wednesday 08 November 2017 7:10
by Igrek
I understood.
The air quality sensor requires the data in parameter "&nvalue =". The standard ESPEASY plugin transmits "&svalue=". I also copied a line from another rule with "&svalue=". This works with a dummy custom type but does not work with an dummy air quality sensor.
Thanks for the tips!

Re: ESP8266 Air quality sensor

Posted: Wednesday 08 November 2017 9:28
by LouiS22
Igrek wrote: Wednesday 08 November 2017 7:10 I understood.
The air quality sensor requires the data in parameter "&nvalue =". The standard ESPEASY plugin transmits "&svalue=". I also copied a line from another rule with "&svalue=". This works with a dummy custom type but does not work with an dummy air quality sensor.
Thanks for the tips!
So, if you download the latest mega dev version (i believe v12), you can use my rule for sure.

Re: ESP8266 Air quality sensor

Posted: Wednesday 08 November 2017 20:34
by Igrek
LouiS22 wrote: Wednesday 08 November 2017 9:28 So, if you download the latest mega dev version (i believe v12), you can use my rule for sure.
For my "MH-Z19B" sensor this possible with last assembly ESPEasy from GIt source (not v12 ) and yours rules!

Re: ESP8266 Air quality sensor

Posted: Sunday 17 December 2017 12:17
by nixalsschrott
jvdz wrote: Friday 03 November 2017 17:27 ESPEasy - Latest Mega version will work but won't update via HTTP JSON with the standard settings. My version does work with JSON. So the below only works with my GIT version at this moment.
Dear Jos,

finally I have got all components on hand.
Already prepared the components and tried to flash your firmware version after compiling with ATOM.
Unfortunately I get an error message while trying to flash.

warning espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed ....

Kind regards

Re: ESP8266 Air quality sensor

Posted: Sunday 17 December 2017 12:38
by jvdz
Correct... I use the firmware.bin from directory: ESPEasy\.pioenvs\normal_4096 to flash my WEMOS D1 Mini.
Are you doing the initial flash via USB cable? if so, how are you doing this?
What are the exact error messages you get in the console?

Jos

Re: ESP8266 Air quality sensor

Posted: Sunday 17 December 2017 13:12
by nixalsschrott
Yes. And now, after disconnecting all sensors before flashing, it worked like a charm. So if using ATOM only connect the "clean" WEMOS D1 Mini without any additional sensors ... then it will work ... OK ... I will go on with your tutorial ...

Re: ESP8266 Air quality sensor

Posted: Sunday 17 December 2017 13:46
by nixalsschrott
jvdz wrote: Friday 03 November 2017 17:27 Define the Device is the Devices tab: ...
In the devices tab I cannot configure whats shon on your screenshot. there are some environmental sensortypes, but no one for gas ...
zhb19b.PNG
zhb19b.PNG (28.05 KiB) Viewed 3089 times
Perhabs wrong image ... do I need to compile with testing modules ... ;-)
=> You need to compile "TESTING"
// I was using wrong files to compile the bin .... //
https://www.letscontrolit.com/wiki/inde ... lugin_list

Kind regards

Re: ESP8266 Air quality sensor

Posted: Sunday 17 December 2017 14:01
by jvdz
... you are sure you have the appropriate sourcecode in your directory: espeasy\ESPEasy\src ?
It should contain file _P049_MHZ19.ino and if so check the content whether line 12 doesn't look like this:

Code: Select all

#ifdef PLUGIN_BUILD_TESTING
Jos

Re: ESP8266 Air quality sensor

Posted: Sunday 17 December 2017 14:35
by nixalsschrott
Huhu ...
OK, now flashed the correct "Testing" Compilation ...
I also can select the correct sensor now.
But after setting up the values, I get no input ...

===> also refers to wrong files
Log shows:
ErrorLog.PNG
ErrorLog.PNG (24.03 KiB) Viewed 3082 times
Kind regards

Re: ESP8266 Air quality sensor

Posted: Sunday 17 December 2017 15:55
by jvdz
I think you aren't using my version, but the standard ESPEasy Mega version!
That one requires the indicated Rule.

so: Either use the version I have published on Github and use the Normal 4096 build with the standard settings
-or-
use the standard Mega version, flash the TEST 4096 build and add the Rule to the Rules option in ESPEasy.

Jos

Re: ESP8266 Air quality sensor

Posted: Sunday 17 December 2017 17:03
by nixalsschrott
OK. Sorry. I followed your link but on the website I switched to "releases" and then indeed downloaded the "original" firmware.
I know did flash your version .... fianlly .. but still getting the error "ConnectFailures 0 FreeMem 21704"
Also under devices there are no values shown ...

By the way .. I often read that the MH-Z19b should be connected to 5Volt .. manual shows 3.3V and 5V is possible. Actually I have connected to 3.3V.

Re: ESP8266 Air quality sensor

Posted: Sunday 17 December 2017 18:53
by jvdz
Looking at the log there indeed seems to be an issue with getting the information from the mhz19.
I have no experience with that as it simply worked for me as I have detailed in my post.

Had a quick look in the manual for the MH-Z19b regarding your comment about 5v and it states:
Technical Parameters and Structure:
Working voltage 4.5 ~ 5.5 V DC
Average current < 60mA (@5V)
Peak current peak 150mA (@5V)
So I would think it indeed should have 5v in stead of 3.3v and also checked my setup which is indeed connected to 5v.
... this of course is valid for the b version only!

Jos

Re: ESP8266 Air quality sensor

Posted: Sunday 17 December 2017 19:07
by nixalsschrott
OK. Tried with 5V but do not get any results either.
And you are still sure with the pin connection, since I have read also different pins to use with MH-Z19B.

"Assembling
Connect the following:
MH-Z19 Tx → Wemos pin D8
MH-Z19 Rx → Wemos pin D7
MH-Z19 gnd → Wemos gnd pin
MH-Z19 vcc → Wemos 3.3V pin // 5.0V pin
"
And also GPIOs are GPIO14 and GPIO12 ...?
===> After changing GPIO Device Settings to 1st GPIO:15 (D8) and 2nd GPIO:13 (D7) it is working ... I get values for PPM and Temp!

Can`t figure out the problem. Anything else I have to adjust within the WEMOS D1?

Kind regards and thank`s for any help ...

Re: ESP8266 Air quality sensor

Posted: Sunday 17 December 2017 19:44
by nixalsschrott
jvdz wrote: Sunday 29 October 2017 14:39 This Wemos also has 2 LUX sensors, a DHT22 Sensor for Temp&Humidity and a BMP180 Barometer (Presure).
Dear Jos,

I still have two sensors here - one BMP-180 (GY-68 ) and one DHT22 (AM2303).
Which Pins to I connect to and which virtual switches di I have to create?

Kind regards matty

Re: ESP8266 Air quality sensor

Posted: Sunday 17 December 2017 21:38
by joostnl
Thanks for al your hard work! Can you supply a photo from your hardware set up? What kind of power supply and case are you using?

Re: ESP8266 Air quality sensor

Posted: Sunday 17 December 2017 22:07
by jvdz
@nixalsschrott,
Is the MHZ19 working now for you as you post seems inclusive for me or is the Bold part added later and I should stop reading there? :D

The Bmp180 & DHT22 are connected as described in this webpage: https://diyprojects.io/esp-easydht22bmp ... -barometer

Code: Select all

Component Pin    Arduino Pin    Wemos D1 mini
DHT22     VDC     5V              5V
          GND     GND             GND
          Data    GPIO-14         D5
BMP180    VDC     5V              5V
          GND     GND             GND
          SDA     GPIO-4          D2
          SCK     GPIO-5          D1
Jos