EnviroDIY / ModularSensors

An Arduino library to give environmental sensors a common interface of functions for use with Arduino-framework dataloggers, such as the EnviroDIY Mayfly.
https://envirodiy.github.io/ModularSensors/
Other
81 stars 48 forks source link

Change Adafruit_ADS1X15 dependency to Adafruit's v2 #456

Closed aufdenkampe closed 1 month ago

aufdenkampe commented 12 months ago

This is a key library for TI's popular Analog to Digital Converter (ADC) used in the Mayfly and many other boards.

Back in 2019 (or earlier), @SRGDamia1 decided to use the soligen2010 fork of Adafruit's library because it fixed some key bugs, and Adafruit hadn't developed it since 2017 or so and wasn't accepting a pull requests to fix it (see https://github.com/EnviroDIY/ModularSensors/issues/235#issuecomment-470208394):

However, starting around 2020 Adafruit has renewed active development and issued a series of v2.x releases (with breaking changes).

Adafruit's v2.4.2 is now 61 commits ahead of soligen2010, and is being actively pushed to PlatformIO's Library Registry:

The major issue is that code developed for https://github.com/adafruit/Adafruit_ADS1X15 will often not work with ModularSensors because of the new and useful functions added to Adafruit's v2 version.

@SRGDamia1, what would it take to switch back? Did any of the 22 commits made to soligen2010 add new features that we depend on?

aufdenkampe commented 12 months ago

@SRGDamia1, here are some of the new capabilities of Adafruit's v2.4.2 that would be handy (and are now being used by others):

Here are the breaking changes introduced with v2.0.1:

SRGDamia1 commented 12 months ago

It's been a while. I know there was a reason I picked the fork, but I don't remember it now.

aufdenkampe commented 12 months ago

With commit e2a9410 I just updated the entire repo to compile using Adafruit's version, so I think it should all work.

The comments that I could find (in https://github.com/EnviroDIY/ModularSensors/issues/235#issuecomment-470208394) was that there was a bug in Adafruit's version, which they didn't address for years. But that was 2016ish, and they really picked up development again starting in 2020. It's been quite active since, so I'm going to presume that bug was fixed.

Some of the features added by soligen2010, such as continuous mode (a0b81d5c4e0da0367d293e8610c825e5aee7f9c7) seem to have been added by Adafruit.

After a bit of research and work, I'm now strongly leaning toward making the switch, but it might make sense if you or someone at Stroud could test my branch a couple of your analog sensors.

aufdenkampe commented 11 months ago

@SRGDamia1 & @s-hicks2, could you test that my AlphasenseCO2 branch works with other sensors that use the ADS1X15 ADC?

Thanks!

aufdenkampe commented 8 months ago

@SRGDamia1 & @s-hicks2, can either of you test that my AlphasenseCO2 branch works with other sensors that use the ADS1X15 ADC?

I really think this is an important and valuable update and that we should move forward with this Pull Request to the develop branch.

aufdenkampe commented 1 month ago

@SRGDamia1, this issue can probably be closed given that you merged this PR:

Have you tried the modified ADS1X15 dependency for any other sensors?

aufdenkampe commented 1 month ago

Completed with Release v0.36.0!