Converting AirGradient project to Esp Easy

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
duindain
New user
Posts: 8
Joined: 30 Nov 2021, 01:22

Converting AirGradient project to Esp Easy

#1 Post by duindain » 30 Nov 2021, 02:14

Hi everyone,

I've recently created one of the sensor packages from the AirGradient project https://www.airgradient.com/diy/ using their custom PCB

This consists of a This has been working well enough with a few software tweaks in the Grafana dashboard using Jeff Geerling's combined PiHole and Internet and Air monitoring (Changing back to Celsius for the temp monitor and -6c to make it account for proximity of the PM sensor ambient temp creep) the PM sensor currently only reports PM 2.5

That solution gets polled by a php middleware every 10 seconds and that gets pushed to Grafana both running in docker on a Pi

Unfortunately I had a power outage on my block and it bricked the device a few days ago
I've been trying to recover it since and managed to determine that it is working but the OLED seems to be dead and I couldn't get it running again without it so far

Since then I've discovered this library and it seems to be a better solution removing some of the overhead of the additional docker middleware and gives more visibility of the sensors and wemos (Though i haven't yet plugged it into the dashboard it seems like it will work)

Unfortunately it seems the AirGradient PCB and solution is completely custom and doesn't support the IC2 protocol from my limited understanding
Image

Has anyone had any luck converting over with this PCB?
Image

I've managed to get the CO2 sensor and the PM sensor ESP_Easy_mega_20211105_normal_ESP8266_4M1M using SoftwareSerial Tx-D4, Rx-D3 for CO2 and Tx-D5, Rx-D6 for PM

Swapping to ESP_Easy_mega_20211105_test_A_ESP8266_4M1M for the temp sensor breaks the PM sensor unfortunately and the temp sensor doesn't work as it only supports IC2 and I need the SoftwareSerial option to specify its connected to D1 and D2

I've currently turned off IC2 as I don't think its connected to anything other than the temp sensor atm and that doesn't work when its turned on either
If I turn it on to D1 and D2 and scan it says No I2C devices found

So in summary I can get the co2 and pm sensors working in normal firmware and cannot get the temp/humidity sensor working at all as it doesn't allow SoftwareSerial and swapping to the test_A firmware breaks compatibility with the PM sensor

Keen for any help if possible, is there a way for me to bring in the temp sensor option into the normal firmware or a way to enable SoftwareSerial for it, or a work around

Cheers

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Converting AirGradient project to Esp Easy

#2 Post by TD-er » 30 Nov 2021, 09:06

You can assign almost any pin to use for I2C on the Hardware tab.

I wonder what may break the PM sensor.
I recently improved that plugin, for the PMSx003 sensors from Plantower, so if you have a bit more information I can look into it.
D5 (GPIO-14) and D6 (GPIO-12) for the PMSx003 sensor is just fine as those are one of the least difficult pins to use.


So first, try to configure the correct pin assignments for the I2C bus and then try to get the other sensors to work again.

duindain
New user
Posts: 8
Joined: 30 Nov 2021, 01:22

Re: Converting AirGradient project to Esp Easy

#3 Post by duindain » 01 Dec 2021, 21:27

Thanks for your help@TD-er I've got the PM sensor working now in test_A firmware it looks like the OLED was interfering with it somehow
After removing that from the Wemos the PM sensor started returning values

I thought there is no choice on IC2 pins that the Wemos uses D1 and D2, I am also constrained by the PCB not that i have a clear understanding of it :)
I've turned those ports back to IC2 and there's nothing detected still and the SHT30 doesn't return any temperature data

Im getting these log messages
108526: I2C : I2C bus error, SCL clock line held low
108528: I2C : I2C bus error, start clearing process
111029: I2C : I2C bus error, SCL clock line held low
111031: I2C : I2C bus error, start clearing process
113531: I2C : I2C bus error, SCL clock line held low
113533: I2C : I2C bus error, start clearing process
116033: I2C : I2C bus error, SCL clock line held low
116035: I2C : I2C bus error, start clearing process
118536: I2C : I2C bus error, SCL clock line held low
118537: I2C : I2C bus error, start clearing process
121039: I2C : I2C bus error, SCL clock line held low
121040: I2C : I2C bus error, start clearing process
Last edited by duindain on 01 Dec 2021, 22:23, edited 1 time in total.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Converting AirGradient project to Esp Easy

#4 Post by TD-er » 01 Dec 2021, 21:30

Are you sure the SDA and SCL pins are not swapped?
Does it show up in the I2C scanner? (tools page)

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Converting AirGradient project to Esp Easy

#5 Post by Ath » 01 Dec 2021, 21:40

It surprises me that the I2C devices are being powered at 5V, as that is quite unlikely, unless the device has an extra regulator to provide 3.3V, it is very well possible that powering the OLED at 5V has killed it.
/Ton (PayPal.me)

duindain
New user
Posts: 8
Joined: 30 Nov 2021, 01:22

Re: Converting AirGradient project to Esp Easy

#6 Post by duindain » 01 Dec 2021, 22:40

I've set the pins according to https://steve.fi/hardware/d1-pins/
SDA => D2.
SCL => D1
Image

It does power the PCB from the wemos micro usb, the components are getting 5v
I just tested the SHT30 and that has 5v

There is a 3v section on the pcb which is powered and recording 3v
The oled test section on the pcb shows 5v

Would that be wrong though? its directly pinned into the Wemos so that part doesn't come from the PCB

The I2C scanner shows "No I2C devices found"

duindain
New user
Posts: 8
Joined: 30 Nov 2021, 01:22

Re: Converting AirGradient project to Esp Easy

#7 Post by duindain » 03 Dec 2021, 23:20

I've just tested the SCA and SDA pins on the PCB from the wemos to the optional I2C Oled pins and the 4 expansion pins on the PCB and through to the SHT30 and they are all connected correctly

The OLED is getting 3.3v but i think the power surge broke it, maybe it broke the SHT as well
The SHT gets 5v but its rated for 3.3 or 5v so should be fine other than if it was power surged

I'll buy a new OLED and SHT and a few more wemos's i think since they are all very cheap and see what works when i replace bits

The OLED doco says there should be LINE 1-8 to configure output text on the Device page, I can't see that on the config for it is that only available in the other firmwares?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Converting AirGradient project to Esp Easy

#8 Post by TD-er » 03 Dec 2021, 23:25

There are 2 OLED plugins; OLED and Framed OLED.
They differ in the possibilities and the Framed OLED one allows for more different display models

duindain
New user
Posts: 8
Joined: 30 Nov 2021, 01:22

Re: Converting AirGradient project to Esp Easy

#9 Post by duindain » 05 Dec 2021, 01:48

I've had both configured and neither show line 1-8 for me to add test output but perhaps its that they aren't detecting the screen over I2C and so the full options aren't available

Cheers

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Converting AirGradient project to Esp Easy

#10 Post by Ath » 05 Dec 2021, 10:10

What build of ESPEasy do you have installed? (Filename please, that provides sufficient info)

I just checked the Display OLED SSD1306 plugin, and it presented lines 1..8 to enter text/variables to be displayed. The FramedOLED plugin leaves from 12 presented lines in configuration max. 4 to be displayed, and uses paging to show the remaining lines.
Device configuration is not dependant on the display actually being connected. (Only very few sensor plugins have that)
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests