Skip to content

Sparkfun_SCD30 library does not work on ESP8266 #1

Description

@paulvha

This library does not work on an ESP8266 due to the way I2C Clockstretching is implemented in the ESP8266 library, in combination with the driver setup.
Based on the on this library, I have created an extended version that does work on an ESP8266-Thing + some extended features. It can be found on https://github.com/paulvha/scd30

Activity

  1. nseidle commented on Aug 12, 2018

    @nseidle
    Member

    Neat! I'd love to have ESPxx support. Please create a pull request and I'll get it pulled in.

  2. paulvha commented on Aug 13, 2018

    @paulvha
    ContributorAuthor

    I am not setup as a collaborator, I can not create a branch and pull request. I will drop you a PM showing the change to make.

  3. paulvha commented on Aug 13, 2018

    @paulvha
    ContributorAuthor

    I could not find your email. Attaching in a file the few changes needed. There are more changes that could be made (e.g. get serial number, better check on Temperature offset, running with ESP8266 as an access point or webserver).
    SCD30_esp866-THING.txt

  4. nseidle commented on Aug 13, 2018

    @nseidle
    Member

    You can create a PR from a fork at any time.

    #if defined(ARDUINO_ESP8266_THING) || defined(ARDUINO_ESP8266_GENERIC) || defined(ARDUINO_ESP8266_ESP01) || defined(ARDUINO_ESP8266_ESP13) || defined(ARDUINO_ESP8266_ESP12) || defined(ARDUINO_ESP8266_NODEMCU) || defined(ARDUINO_ESP8266_THING_DEV) || defined (ARDUINO_ESP8266_ESP210) || defined(ARDUINO_MOD_WIFI_ESP8266) || defined(ARDUINO_ESP8266_PHOENIX_V1) || defined(ARDUINO_ESP8266_PHOENIX_V2) || defined(ARDUINO_ESP8266_ARDUINO)
        _i2cPort->setClockStretchLimit(200000);
    #endif
    

    Can you use the ARDUINO_ARCH_ESP32 and ARDUINO_ARCH_ESP8266 tags instead?

    This is really helpful. Once you have a PR I'll test on a few platforms.

  5. paulvha commented on Aug 13, 2018

    @paulvha
    ContributorAuthor

    completed the PR... look forward to your results.

  6. added a commit that references this issue on Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions