Skip to content
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

Need option to disable sending command to sensor (active_mode option) #5

Open
tms320 opened this issue Dec 17, 2019 · 5 comments
Open

Comments

@tms320
Copy link

tms320 commented Dec 17, 2019

Hello!
I use the same UART channel to read data from sensor (via RX pin of controller) and send debug messages (via TX pin). So there is no connection between controller's TX pin and sensor's RX pin.
In my case PMS5003 sensor works fine without sending any command to it.
Your library sends "passive mode" command in 'init' and 'trigRead' methods:
uart->write(cfg, msgLen); // set passive mode
so I see this data as unreadable text in my debug monitor.
Is it possible to add some option (in constructor, for example) to disable sending any data to UART?
Thanks )

@tms320
Copy link
Author

tms320 commented Dec 22, 2019

Closed. I decided to use SoftwareSerial.

@tms320 tms320 closed this as completed Dec 22, 2019
@avaldebe avaldebe changed the title Need option to disable sending command to sensor Need option to disable sending command to sensor (active_mode option) Dec 23, 2019
@avaldebe
Copy link
Owner

Sorry for the delayed answer, looks like you found a way around the issue.

Your library sends "passive mode" command in 'init' and 'trigRead' methods:
uart->write(cfg, msgLen); // set passive mode
so I see this data as unreadable text in my debug monitor.
Is it possible to add some option (in constructor, for example) to disable sending any data to UART?

Alas, this messages are needed for reading the sensor data on demand (passive mode operation).
Otherwise the sensor will send a new set of measurements every ~800 ms (active mode operation).

I wrote this library for passive mode operation. When I wrote the library there were already other libraries available that dealt with active model operations, so I did not addressed the active mode usage.
The PMS3003 does not support passive mode operation, so I built the library to work around this limitation. Therefore, implementing an active_mode option should be relatively easy.

Thanks for giving my library a try. I'll reopen the issue,
in case someone else wants an active_mode option (PRs are most welcomed)

@avaldebe avaldebe reopened this Dec 23, 2019
@tms320
Copy link
Author

tms320 commented Dec 23, 2019

In PMS5003 datasheet that I have there is no information about passive/active mode and any commands to sensor. Thanks for your explanations )

@avaldebe
Copy link
Owner

There are several versions of the datasheet. This one was translated from the original Chinese one, is the best reference I have found

http://www.aqmd.gov/docs/default-source/aq-spec/resources-page/plantower-pms5003-manual_v2-3.pdf?sfvrsn=2

@tms320
Copy link
Author

tms320 commented Dec 27, 2019

Thanks a lot )

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

No branches or pull requests

2 participants