-
Notifications
You must be signed in to change notification settings - Fork 52
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
Uart pm25 retry #683
Open
tyeth
wants to merge
6
commits into
adafruit:main
Choose a base branch
from
tyeth:uart-pm25-retry
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Uart pm25 retry #683
+53
−43
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tyeth Is this ready for reivew? |
30565af
to
0ddb47f
Compare
04a377e
to
a93304f
Compare
@brentru this should be ready for review now |
a93304f
to
206e370
Compare
The delay worries me, I2C reads are not supposed to retry from the driver-side. I am going to ask Carter for a status update on the PR, maybe we can implement passive mode as specified. |
Yeah makes sense.
I agree with the separation of concerns.
The user side of me thinks always get my data, retry if noise or sensor
transient issues rather than wait for next polling period.
I know we do up to 3times for the i2c cpp update loop, but not UART cpp
update loop (it's isready check is time based so we don't retry failures in
UART).
Passive mode also sounds very sensible
…On Thu, 23 Jan 2025, 21:04 Brent Rubell, ***@***.***> wrote:
The delay worries me, I2C reads are not supposed to retry from the
driver-side. I am going to ask Carter for a status update on the PR, maybe
we can implement passive mode
<adafruit/Adafruit_PM25AQI#10 (comment)>
as specified.
—
Reply to this email directly, view it on GitHub
<#683 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTBZ4523KKKJGBJKXUSLDT2MFKNPAVCNFSM6AAAAABVT4XJYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJRGAYTGMRTG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's a related issue with the driver repo, but until that's resolved, and probably anyway, we can add some retry logic around the data read.
This has been running for hours, mostly with 0 retries, sometimes 1, and sometimes the mega-load (the wrapper / glue driver does maximum of 500millis of retry attempts with 100ms waits).
I'll clean this up, but wanted to stick the log with the code so raised the PR:
Uart Log Details
02:35:07:770 -> Sending MQTT PING: SUCCESS!
02:35:07:962 -> WiFi RSSI: -59
02:35:12:483 -> Sending MQTT PING: SUCCESS!
02:35:12:665 -> WiFi RSSI: -60
02:35:14:006 -> [UART, PM25] Reading data...
02:35:14:006 -> PM25: Serial data fetch done
02:35:14:006 -> PM25: Serial data checksum incorrect
02:35:14:006 -> UART IN TIMED CHECK, RES: 0
02:35:14:108 -> PM25: Serial data fetch done
02:35:14:108 -> PM25: Serial data checksum incorrect
02:35:14:108 -> UART IN TIMED CHECK, RES: 0
02:35:14:209 -> PM25: Serial peek failed
02:35:14:209 -> UART IN TIMED CHECK, RES: 0
02:35:14:319 -> PM25: Serial data fetch done
02:35:14:319 -> PM25: Serial data start incorrect (not pm1006)
02:35:14:319 -> UART IN TIMED CHECK, RES: 0
02:35:14:429 -> PM25: Serial data fetch done
02:35:14:429 -> PM25: Serial data checks complete, about to calculate AQIs
02:35:14:429 -> PM25: Calculated AQIs, returning TRUE for read()
02:35:14:429 -> UART IN TIMED CHECK, RES: 1
02:35:14:429 -> RESULT VAR: 1
02:35:14:429 -> [UART, PM25] Read data OK
02:35:14:429 ->
02:35:14:429 -> ---------------------------------------
02:35:14:430 -> Concentration Units (standard)
02:35:14:430 -> ---------------------------------------
02:35:14:430 -> PM 1.0: 329 PM 2.5: 753 PM 10: 921
02:35:14:430 -> Concentration Units (environmental)
02:35:14:430 -> ---------------------------------------
02:35:14:430 -> PM 1.0: 218 PM 2.5: 502 PM 10: 613
02:35:14:430 -> ---------------------------------------
02:35:14:430 -> [UART] Publishing event to IO..Published!
02:35:17:173 -> Sending MQTT PING: SUCCESS!
02:35:17:276 -> WiFi RSSI: -58
02:35:21:796 -> Sending MQTT PING: SUCCESS!
02:35:21:988 -> WiFi RSSI: -60
02:35:26:489 -> Sending MQTT PING: SUCCESS!
02:35:26:592 -> WiFi RSSI: -59
02:35:31:112 -> Sending MQTT PING: SUCCESS!
02:35:31:305 -> WiFi RSSI: -58
02:35:33:626 -> STATUS LED BLINK KAT
02:35:35:806 -> Sending MQTT PING: SUCCESS!
02:35:36:019 -> WiFi RSSI: -60
02:35:40:539 -> Sending MQTT PING: SUCCESS!
02:35:40:722 -> WiFi RSSI: -61
02:35:44:623 -> [UART, PM25] Reading data...
02:35:44:623 -> PM25: Serial data fetch done
02:35:44:623 -> PM25: Serial data checks complete, about to calculate AQIs
02:35:44:623 -> PM25: Calculated AQIs, returning TRUE for read()
02:35:44:623 -> UART IN TIMED CHECK, RES: 1
02:35:44:623 -> RESULT VAR: 1
02:35:44:623 -> [UART, PM25] Read data OK
02:35:44:623 ->
02:35:44:623 -> ---------------------------------------
02:35:44:623 -> Concentration Units (standard)
02:35:44:623 -> ---------------------------------------
02:35:44:623 -> PM 1.0: 329 PM 2.5: 753 PM 10: 921
02:35:44:623 -> Concentration Units (environmental)
02:35:44:623 -> ---------------------------------------
02:35:44:623 -> PM 1.0: 218 PM 2.5: 502 PM 10: 613
02:35:44:623 -> ---------------------------------------
02:35:44:624 -> [UART] Publishing event to IO..Published!
02:35:45:226 -> Sending MQTT PING: SUCCESS!
02:35:45:339 -> WiFi RSSI: -56
02:35:49:840 -> Sending MQTT PING: SUCCESS!
02:35:49:943 -> WiFi RSSI: -57
02:35:54:463 -> Sending MQTT PING: SUCCESS!
02:35:54:655 -> WiFi RSSI: -61
02:35:59:157 -> Sending MQTT PING: SUCCESS!
02:35:59:259 -> WiFi RSSI: -59
02:36:03:761 -> Sending MQTT PING: SUCCESS!
02:36:03:873 -> WiFi RSSI: -59
02:36:08:394 -> Sending MQTT PING: SUCCESS!
02:36:08:576 -> WiFi RSSI: -60
02:36:13:082 -> Sending MQTT PING: SUCCESS!
02:36:13:190 -> WiFi RSSI: -59
02:36:14:831 -> [UART, PM25] Reading data...
02:36:14:831 -> PM25: Serial data fetch done
02:36:14:831 -> PM25: Serial data checksum incorrect
02:36:14:831 -> UART IN TIMED CHECK, RES: 0
02:36:14:932 -> PM25: Serial data fetch done
02:36:14:932 -> PM25: Serial data checks complete, about to calculate AQIs
02:36:14:933 -> PM25: Calculated AQIs, returning TRUE for read()
02:36:14:933 -> UART IN TIMED CHECK, RES: 1
02:36:14:933 -> RESULT VAR: 1
02:36:14:933 -> [UART, PM25] Read data OK
02:36:14:933 ->
02:36:14:933 -> ---------------------------------------
02:36:14:933 -> Concentration Units (standard)
02:36:14:933 -> ---------------------------------------
02:36:14:933 -> PM 1.0: 314 PM 2.5: 723 PM 10: 852
02:36:14:933 -> Concentration Units (environmental)
02:36:14:933 -> ---------------------------------------
02:36:14:933 -> PM 1.0: 209 PM 2.5: 481 PM 10: 567
02:36:14:933 -> ---------------------------------------
02:36:14:933 -> [UART] Publishing event to IO..Published!
02:36:17:697 -> Sending MQTT PING: SUCCESS!
02:36:17:799 -> WiFi RSSI: -59