-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[FR] PMSA003i support for P053 Dust - PMSx003 / PMSx003ST plugin #5141
Comments
Usually, the changed I2C address indicates there's a change in the protocol. Probably they have changed to data format to be in units of 16 bits instead of 8 bits (seen that with other, newer sensors too). I'll have a look at how much effort it will be to integrate with the current plugin, or if we need to start a new plugin for this sensor. |
Biggest 'issue' is that P053 is a plugin that's using RS232-like serial communication with the PMSx003 sensors, and the PMSA003i only supports I2C communication. I've reserved P175 for a new plugin for this sensor. |
@Tyrant1919 You haven't mentioned with what type of ESP you want to use this sensor? I'm aiming for ESP32 flavor only, as for ESP8266 we're running out of room in the binaries in most builds. |
@Tyrant1919 I've created a PR to add support for this sensor. Downloads available from this GH Actions run. Can you please test? NB: Only available in ESP32 Edit: Fixed Actions run link. |
ESP32-C6 was what I'm testing. I have a 'plain' ESP32 as well. Will give it a shot tomorrow and let you know. |
Shows up in i2c scan. Also notes P175 compatible. Added device. Getting a plethora of "PMSx003 : Checksum error" in the logs on all 4 of the possible output values available. Guessing 2nd option probably shouldn't work. |
Hm, made a few slipups in reading the data & checksum, fixed that. New build available from this GH Actions run. |
Ehh you can already access all collected data from the first task. |
"Events for non-output values:" !!!! Nice, ok seeing everything in the logs now with one device. Best way to get extra values into a dummy device is through rules I'm thinking. |
Everything with the sensor is working exactly as I'm expecting it to. There are a few checksum errors in the logs, maybe very roughly every 30 seconds. Do have to breakout the rules since the non-output values aren't included in the "Single event with all values" option. 4222278: PMSx003: Oversampling using 2 samples On PMSA003i#cnt0.3 do |
@Tyrant1919 I've made some optimizations in the code (mostly de-duplication, but had to do some small restructuring), available from this GH Actions run. Can you also test that build, to check if I didn't break anything? 🤔 |
Nothing broke. I don't see checksum errors in the logs anymore. That's a win. I have a BME280 and an oled on the i2c as well. The oled display was garbled with the dust sensor connected. Forced the oled to slow and it fixed the garbled screen. I wasn't checking out the oled at all during this. I loaded the previous firmware to check and the issue was still there, I'm guessing some i2c don't like to mix with slow devices? |
How is the I2C wired? Not all I2C devices can pull as hard as needed when you have made your pull-up strength too strong. Also the I2C total bus length should not be too long. |
Great 😃
When not having the PMS connected, the display should work fine at 400 kHz (Slow not checked), though some displays seem to need a better reset, but most of the OLeds don't have that available. A reboot or power-cycle sometimes fixes that, so it may be that's you're looking at a bad boot/reset sequence for the display, if the garbled display returns. Another possibility is that the combined I2C pull-up resistors are too much for the display, at that speed. You can check that by connecting only the display, or the display combined with the PMS. If it works in those situations, you can consider to use an I2C multiplexer (configuration on the Hardware tab), to connect each I2C device via it's own channel on the multiplexer, then they will all need to have their own (by default installed) pull-up resistors, as well as some pull-ups on the ESP - multiplexer connection. |
Had it setup like this. Bottom power rails I have as my i2c bus. Makes sense might that it might need a multiplexer. I'll throw this in and see what happens. I purchased the sensor from adafruit. It works on their breakout board as well as a generic breakout I got from elsewhere. Still working as expected. |
Is your feature request related to a problem? Please describe.
I have a PMSA003i that is not listed as a supported model for the Dust - PMSx003 / PMSx003ST plugin. It does show up as an i2c device on 0x12, however I'm unable to select 0x12 as an i2c address for the sensor.
Describe the solution you'd like
Would like to add full support for it and add it to list of supported devices for plugin. I believe it's largely the same as the other PMSx003 family, but I'm not 100% sure. Attempted to figure out how to add additional options for i2c addresses but it's beyond my skill level. I'd be able to send a unit to someone if they want to spend time (they can keep it). I'm also probably able to compile and test a firmware image if someone is able to add this new device and i2c address in a new branch. Think 0x12 is the only address it has.
Describe alternatives you've considered
I currently have the PMSA003i plugged into an arduino and feeding data over serial to the Esp using taskvalueset. Works like a charm, just clunky. Can't think of a way to translate the 0x12 address to 0x48 for instance as one of the selectable addresses.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: