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

PMSx003 calculation #9

Closed
jara1 opened this issue Jan 6, 2019 · 2 comments · Fixed by esphome/esphome-core#471
Closed

PMSx003 calculation #9

jara1 opened this issue Jan 6, 2019 · 2 comments · Fixed by esphome/esphome-core#471

Comments

@jara1
Copy link

jara1 commented Jan 6, 2019

Operating environment/Installation (Hass.io/Docker/pip/etc.):

pip
ESP (ESP32/ESP8266/Board/Sonoff):

ESP32
Affected component:

PMSx003

Description of problem:
Hi, I would like to report bug in calculation of PMSx003 total size.
pmsx003.cpp, line 81, should be: uint8_t total_size = 4 + payload_length;

Tested with PMS5003 and works correctly.

Problem-relevant YAML-configuration entries:

PASTE YAML FILE HERE

Traceback (if applicable):


Additional information:

@OttoWinter
Copy link
Member

OttoWinter commented Jan 8, 2019

Are you sure that is the actual issue here? There's been a fix recently (in dev, not in 1.9.3) that fixed some of the packet sizes - and for the person reporting the issue that fixed it.

Also line 81 should be correct judging from the datasheet.

Can you try with the latest development version (or beta)?

@jara1
Copy link
Author

jara1 commented Jan 8, 2019

Hi, I've used version 1.9.3. According to datasheet for PMS5003, frame length (payload length) is 2x13+2 = 28bytes. This matches line 62 in pmsx003.cpp, which is correct. There are another 2bytes for start characters and another 2 bytes for frame length indication = 4bytes. So the total size of the message is 28 + 4 = 32bytes.

clipboard01

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

Successfully merging a pull request may close this issue.

2 participants