Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

PMSx003 does not work #470

Closed
hajdbo opened this issue Feb 4, 2019 · 0 comments · Fixed by #471
Closed

PMSx003 does not work #470

hajdbo opened this issue Feb 4, 2019 · 0 comments · Fixed by #471

Comments

@hajdbo
Copy link
Contributor

hajdbo commented Feb 4, 2019

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

Hass.io

ESP (ESP32/ESP8266/Board/Sonoff):

ESP8266 with PMS7003

Affected component:

PMSx003

Description of problem:
PMSx003 module does not work, as the payload_size computing is wrong:

// start (16bit) + length (16bit) + DATA (16bit) + checksum (16bit)
  uint8_t total_size = 4 + payload_length * 2 + 2;

payload_length is actually number of bytes, including checksum.

Problem-relevant YAML-configuration entries:

esphomeyaml:
  name: mqttbme280pms7003
  platform: ESP8266
  board: nodemcuv2
  on_boot:
    then:
        - output.turn_on: gpio_d2

wifi:
    ssid: 'XXXXX'
    password: 'XXXXXX'

logger:

api:
  port: 6053

uart:
  rx_pin: D1
  baud_rate: 9600

# D2 is set pin on particle sensor
output:
  - platform: gpio
    pin: D2
    id: gpio_d2

sensor:
  - platform: pmsx003
    type: PMSX003
    pm_1_0:
      name: "Particulate Matter <1.0µm Concentration"
    pm_2_5:
      name: "Particulate Matter <2.5µm Concentration"
    pm_10_0:
      name: "Particulate Matter <10.0µm Concentration"

Traceback (if applicable):


Additional information:
I'll submit a PR to compute the correct payload length

hajdbo added a commit to hajdbo/ESPHome-Core that referenced this issue Feb 4, 2019
OttoWinter pushed a commit that referenced this issue Feb 5, 2019
@esphome esphome locked and limited conversation to collaborators Jun 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant