MallocArray / airgradient_esphome

ESPHome definition for an AirGradient DIY device to send data to HomeAssistant and AirGradient servers
GNU General Public License v3.0
244 stars 42 forks source link

AirGradient ONE v9 PMS5003 sensor no values. #53

Closed GeneralZero closed 6 months ago

GeneralZero commented 6 months ago

Device: AirGradient ONE v9 Sensor: PMS 5003

All sensors other than the PMS5003 sensor work with the airgradient-one.yaml file. I have reinstalled the current firmware and checked that I am getting information from that sensor.

From the android source code It looks like https://github.com/airgradienthq/arduino/blob/3efba24e24e956f12047b6d4832f20feb47cc495/src/Main/BoardDef.cpp#L165 uses UART0 to connect to that Sensor.

What settings should be changed to test this?

MallocArray commented 6 months ago

Assuming you only changed the items in the substitutions sections, it should be fully setup for the PMS5003 sensor.

In the Package for the board, you can see the pins being used

uart:
  # https://esphome.io/components/uart.html#uart
  - rx_pin: GPIO0  # Pin 12
    tx_pin: GPIO1  # Pin 13
    baud_rate: 9600
    id: senseair_s8_uart

  - rx_pin: GPIO20  # Pin 30 or RX
    tx_pin: GPIO21  # Pin 31 or TX
    baud_rate: 9600
    id: pms5003_uart

I have seen a few instances were after flashing, it is necessary to pull the power from the board entirely, as a software reboot hasn't been enough to get things going, but then it work as expected after that.

You might give that a try.

Using ESPHome 2024.4.2?

saschaludwig commented 6 months ago

I have seen a few instances were after flashing, it is necessary to pull the power from the board entirely, as a software reboot hasn't been enough to get things going, but then it work as expected after that.

I had exactly this issue today. Just flashed my AG O1PST and I only got PM2.5 values from the PMS5003T. After a power cycle, all values could be read. Thank you! :)

GeneralZero commented 6 months ago

Weird I didn't change anything in the configuration regenerated the install file and re-flashed it and now works.

-a----          5/7/2024   4:42 PM        1305120 ag-one-factory (1).bin
-a----         5/11/2024   4:41 PM        1332368 ag-one-factory (2).bin