GithubHelp home page GithubHelp logo

Support for ESP32C3 about sps30 HOT 5 OPEN

paulvha avatar paulvha commented on July 18, 2024
Support for ESP32C3

from sps30.

Comments (5)

paulvha avatar paulvha commented on July 18, 2024 1

Thanks for the finding. I have corrected and just uploaded the new version 1.4.16. let me know

from sps30.

hpsaturn avatar hpsaturn commented on July 18, 2024

Thanks!

from sps30.

hpsaturn avatar hpsaturn commented on July 18, 2024

Hi again,

I bought new SPS30 sensors for tests, when these arrived I did some extra tests with my old UART setup using only ESP32 boards, and I found that this validation (#if Serial2) doesn't works for them. Validate with Serial2 only works for ESP32C3, and for this reason we close this issue. But the right way to validate the Serial2 interface in the both architectures is using:

#if SOC_UART_NUM > 2 for the ESP32, because it resolve 3. For the ESP32-C3 resolve 2.

In my library I have a similar block:

case SERIALPORT2:
        #if SOC_UART_NUM > 2
            DEBUG("-->[SLIB] UART COMM port \t: Serial2");
            if (pms_type == SENSORS::SSPS30)
                Serial2.begin(speed_baud);
            else
                Serial2.begin(speed_baud, SERIAL_8N1, pms_rx, pms_tx, false);
            _serial = &Serial2;
            break;
        #else
            DEBUG("-->[SLIB] Force UART port \t: Serial1");
            Serial1.begin(speed_baud, SERIAL_8N1, pms_rx, pms_tx);
            _serial = &Serial1;
        #endif

from sps30.

paulvha avatar paulvha commented on July 18, 2024

Don't understand the issue. I use (#ifdef Serial2 ) not (if Serial2). If there is no Serial2 defined, I can not use it.

In the sketch the right Serial port to use should be provided. As indicated in the Readme, I kept the "old" structure in for backward compatibility. For future implementation with serial, I would rather see that example12 setup for serial communication is used.
Much easier :-)

from sps30.

hpsaturn avatar hpsaturn commented on July 18, 2024

Sorry, I did a mistake, I want to say ifdef. In my previous version I was using your similar workaround (ifdef Serial2):

screenshot20230215_003636

but it working with C3, but with ESP32 and Espressif 4.4.0 for example, this validation doesn't works.

from sps30.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.