Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

General docs/usage #3

Closed
avaldebe opened this issue Apr 17, 2019 · 5 comments
Closed

General docs/usage #3

avaldebe opened this issue Apr 17, 2019 · 5 comments

Comments

@avaldebe
Copy link
Owner

If you do not understand how to use the library, found an explanation confusing or you found a typo. Leave a message and will try to answer as soon as reasonable.

Thanks for helping to improve the library!

@SFeli
Copy link

SFeli commented Jul 26, 2020

Hi - thx for the greate library - have moved over to your library because auf time.h - incompatibilities of the alternative.
HW: PMS7003 / Lolin D32 (ESP32)
SW: VSCode with PIO

Note 1) ESP-Serial issue

The following code works and is flexible for alternative pins

HarwareSerial pmsSerial(2); 
SerialPM pms(PMSx003, pmsSerial); 
[...]
setup(){
    [...]
    pmsSerial.begin(9600, SERIAL_8N1, 16, 17)
}

Note 2) Sleep

In #2 you mention an workaround by editing the library with

void SerialPM::sleep() {
trigRead(slp,msgLen); // sleep
}

void SerialPM::wake() {
trigRead(wak,msgLen); // sleep
}

but trigRead() has as fare as I can see no parameters. Perhaps you have to add:

void SerialPM::wake() {
  uart->write(wak, msgLen); // wakeup
  uart->flush();
  delay(max_wait_ms * 2);
  while (uart->available())
  {
    uart->read(); // empty the RX buffer
  }
}

Perhaps you can include this function in the standard library or add this option in issue 2.

Thanks for your work and congratulation for the efficient lines :-)

@avaldebe
Copy link
Owner Author

Hi @SFeli

Thanks fort taking an interest on my library.

Note 1) ESP-Serial issue

The following code works and is flexible for alternative pins

HarwareSerial pmsSerial(2); 
SerialPM pms(PMSx003, pmsSerial); 
[...]
setup(){
    [...]
    pmsSerial.begin(9600, SERIAL_8N1, 16, 17)
}

I think that this use case was addressed on #7. This library uses Serial1 on the ESP32 to connect a PM sensor on user defined pins. Probably the explanation is not clear enough.

@avaldebe
Copy link
Owner Author

Note 2) Sleep

In #2 you mention an workaround by editing the library with

void SerialPM::sleep() {
trigRead(slp,msgLen); // sleep
}

void SerialPM::wake() {
trigRead(wak,msgLen); // sleep
}

but trigRead() has as fare as I can see no parameters.

This code snippet is not mine, It was part of an attempt by a library user to implement sleep.
I never reviewed the whole code, but I guess that it included changes to trigRead().

Do you need/want sleep/wake modes?
IMO, the best way to put the sensor to sleep is using the sensor SET pin.

@avaldebe avaldebe pinned this issue Nov 19, 2020
@avaldebe avaldebe unpinned this issue Nov 19, 2020
@MobeenAshraf
Copy link

MobeenAshraf commented Aug 21, 2021

Can we have some more documentation around how to setup and steps to use this code?
As a beginner, I think it uses platformio but coming from ArduinoIDE setup, Can we add more steps on what needs to be done to install this code on Controller?
Also, for beginner and minimal setup can we add minimal circuit diagram links aswell?

@avaldebe
Copy link
Owner Author

Hi @MobeenAshraf

Can we have some more documentation around how to setup and steps to use this code?

In addition to the examples?

As a beginner, I think it uses platformio but coming from ArduinoIDE setup, Can we add more steps on what needs to be done to install this code on Controller?

I have not used the Arduino IDE on years, back on the days before the Library Manager, so I do not know how to add libraries to the IDE. In any case, I think there are plenty of tutorials that teach how to do it, e.g.:

I think I could add some links to the library README. Please let me know if you have a better idea.

Also, for beginner and minimal setup can we add minimal circuit diagram links aswell?

I included links to the datasheets I could find for every supported sensors, but I guess this is not enough for a beginner.
I'll need to think about this, as I do not want to write a full tutorial for this sensor (there are quite a few already).
However, I would be glad to include documentation submitted via PR (hint hint).

Repository owner locked and limited conversation to collaborators May 16, 2022
@avaldebe avaldebe converted this issue into discussion #28 May 16, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

3 participants