New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine PMSX003 to support PMS5003T/PMS5003ST. #818

Merged
merged 5 commits into from Apr 27, 2018

Conversation

Projects
None yet
2 participants
@Yonsm
Contributor

Yonsm commented Apr 26, 2018

  1. Support PMS5003T/PMS5003ST;
  2. Rewrite data reading method;
  3. Remove PMS library dependency (move control command into espurna);
  4. Support smart sleeping mode to extend the sensor’s lifetime.

Tested successfully for PMS5003T and PMS5003ST sensor in NodeMCU. Imagine working on other PMSX003 devices as well.

Need help: I use MAGNITUDE_ANALOG for HCHO, since I don't known how to rebuild compressed web package. Could you please add HCHO MAGNITUDE support in custom.js, Thank you.

Yonsm added some commits Apr 26, 2018

Yonsm Yonsm
Refine PMSX003 to support PMS5003T/ST
1. Support PMS5003T/PMS5003ST;
2. Replace data reading method;
3. Remove PMS library dependency;
4. Support smart sleeping mode to extend the sensor’s lifetime.
Yonsm Yonsm
Add debug msg prefix
And found DEBUG_MSG could not be used in the sensors header file.
Yonsm Yonsm

@xoseperez xoseperez merged commit cf7f3dc into xoseperez:dev Apr 27, 2018

2 checks passed

Codacy/PR Quality Review Up to standards. A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@xoseperez

This comment has been minimized.

Owner

xoseperez commented Apr 27, 2018

I have added the HCHO magnitude (without units, is that right?).
One thing I think should be fixed is that the type of sensor (which I have moved to sensors.h) should be set dinamically, with a setType method. So all the defies at the top of the sensor file should be reworked too.
This will be necessary when the user could change the sensor settings on the fly from the web interface...

@Yonsm

This comment has been minimized.

Contributor

Yonsm commented Apr 27, 2018

Got it. Thank you.

The HCHO's unit is "mg/m³". And another suggestion for temperature unit is:

    PROGMEM const char magnitude_celsius[] =  "°C";   // Line 80
    PROGMEM const char magnitude_fahrenheit[] =  "°F";  // Line 80

I'll follow your advice to support setType dynamically by program call, but I don't known how to support changing sensor type dynamically from Web Front End.

@Yonsm

This comment has been minimized.

Contributor

Yonsm commented Apr 27, 2018

I've submitted 'Support set PMS sensor type dynamically' on Yonsm@f0ca139. and will PR later once I tested on my true device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment