-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add support for TRW TPMS OEM and Clone models #3279
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
base: master
Are you sure you want to change the base?
Conversation
src/devices/tpms_trw.c
Outdated
| "alert", "Alert", DATA_COND, flags == 0x6 || flags == 0x9, DATA_STRING, "Pressure increase/decrease !", | ||
| "seq_num", "Seq Num", DATA_INT, seq_num, | ||
| "pressure_PSI", "Pressure", DATA_FORMAT, "%.0f PSI", DATA_DOUBLE, pressure_psi, | ||
| "temperature_C", "Temperature", DATA_FORMAT, "%.1f C", DATA_DOUBLE, (double)temperature_C, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For temperature I think you can use just int.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We trying to offer normalized keys and values. The temperature keys should always be DATA_DOUBLE, but the format here can be "%.0f C"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But for pressure we can use: "%.1f PSI"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, I just reverse the values ... corrected in next commit
src/devices/tpms_trw.c
Outdated
| "motion_status", "Motion", DATA_STRING, motion_flags == 0x0e ? "Parked" : "Moving", | ||
| //"inflate", "Inflate", DATA_INT, infl_detected, | ||
| "oem_model", "OEM Model", DATA_COND, oem_model == 0x4, DATA_STRING, "OEM", | ||
| "oem_model", "OEM Model", DATA_COND, oem_model == 0x0, DATA_STRING, "Chinese OEM", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably better to use the word Clone rather than Chinese OEM.
src/devices/tpms_trw.c
Outdated
| .modulation = OOK_PULSE_MANCHESTER_ZEROBIT, | ||
| .short_width = 52, | ||
| .long_width = 52, | ||
| .reset_limit = 200, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested successfully for a 150us reset.
src/devices/tpms_trw.c
Outdated
| .modulation = FSK_PULSE_MANCHESTER_ZEROBIT, | ||
| .short_width = 52, | ||
| .long_width = 52, | ||
| .reset_limit = 200, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
src/devices/tpms_trw.c
Outdated
| }; | ||
|
|
||
| r_device const tpms_trw_ook = { | ||
| .name = "TRW TPMS OOK OEM and Chinese models", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| .name = "TRW TPMS OOK OEM and Chinese models", | |
| .name = "TRW TPMS OOK OEM and Clone", |
src/devices/tpms_trw.c
Outdated
| }; | ||
|
|
||
| r_device const tpms_trw_fsk = { | ||
| .name = "TRW TPMS FSK OEM and Chinese models", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| .name = "TRW TPMS FSK OEM and Chinese models", | |
| .name = "TRW TPMS FSK OEM and Clone", |
src/devices/tpms_trw.c
Outdated
| "mode", | ||
| "id", | ||
| //"battery_ok", | ||
| "pressure_kPa", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "pressure_kPa", | |
| "pressure_PSI", |
|
@ProfBoc75 Thank you for the PR! I think it would be a good idea to combine the commits related to adding support into one and separate the commit unrelated to it. Does csv output always display all data as |
|
Sometimes Does the last message have the correct checksum? |
OEM or Clone is not accurate, only based on the last 2 trailing bits ... we can remove it, as no added value ? I corrected mostly all your findings here. I will commit the updates very soon. |
if float, values are with 3 decimals after dot. |
I'm talking about sensor IDs. It would be better to have these values as |
I'll do some more tests and let you know. |
8d2ffe8 to
a796732
Compare
2e725ca to
5e76779
Compare
Related to issue #3256
Add support for the TRW TPMS protocol used into Chrysler car from 2014 until 2022.