Skip to content

Steelmate tpms improvements#3271

Merged
zuckschwerdt merged 9 commits intomerbanan:fix-steelmate_TPMSfrom
buxtronix:fix-steelmate_TPMS
May 8, 2025
Merged

Steelmate tpms improvements#3271
zuckschwerdt merged 9 commits intomerbanan:fix-steelmate_TPMSfrom
buxtronix:fix-steelmate_TPMS

Conversation

@buxtronix
Copy link
Copy Markdown
Contributor

Improvements to this protocol per discussions in #3200. I'm adding this to the existing pending branch.

I did some fairly thorough analysis on the bench involving a bike pump, power supply, fridge, 3d printer heated bed and a transmitter. The following changes are made:

  • Temperature is degrees C + 50, it's much more accurate than degrees F. I left the unit as F though for backwards compatibility. My display hasn't got temperature, I just heated it and read the values. @e100 also figured this out.
  • Based on analysis from @e100 and my own PSU tests, i updated the voltage formula to something that is very close to the real value. Incremented voltages on a PSU by 0.1v and read the transmitted value, and compared with two graph lines. This new formula almost exactly matches the line.
  • When the voltage byte is 0xFF or 0xFE, the display shows alerts. Added these.
  • Both short and long packets are sent. Same data, different preamble size. Now accounts for both including demodulation artifacts.
  • Better preamble detection.
  • Tweaked signal timings for more reliable detection.

I also have ensured rtl_433_tests are updated/passing and will send a PR for this.

Comment thread src/devices/steelmate.c Outdated
unsigned bitpos = bitbuffer_search(bitbuffer, row, 0, preamble_pattern, 24);
if (bitpos >= row_len - 64)
continue; // DECODE_ABORT_EARLY
b = &b[bitpos / 8];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should either bitbuffer_extract_bytes() or make sure bitpos % 8 == 0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use better bit wrangling.

Comment thread src/devices/steelmate.c Outdated
//Temperature is stored in Fahrenheit. Note that the datasheet claims operational to -40'C, but can only express values from -17.8'C
uint8_t tempFahrenheit = ~reverse8(b[6]);
//Temperature is sent as degrees Celcius + 50.
uint8_t v1 = ~reverse8(b[6]);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can simply be ints.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@zuckschwerdt
Copy link
Copy Markdown
Collaborator

Thanks! Yes, let's keep output units for now, but after this is merged please prepare a PR with the pressure_PSI to pressure_kPa and temperature_F to temperature_C change.

Comment thread src/devices/steelmate.c
unsigned bitpos = bitbuffer_search(bitbuffer, row, 0, preamble_pattern, 24);
if (bitpos > row_len - 72)
continue; // DECODE_ABORT_EARLY
bitbuffer_extract_bytes(bitbuffer, row, bitpos, b, 72);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the uint8_t *b = bitbuffer->bb[row]; above and add directly before extract:
uint8_t b[9];

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread src/devices/steelmate.c Outdated
//Temperature is stored in Fahrenheit. Note that the datasheet claims operational to -40'C, but can only express values from -17.8'C
uint8_t tempFahrenheit = ~reverse8(b[6]);
//Temperature is sent as degrees Celcius + 50.
int tempCelcius = b[6] - 50;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be all snake_case, i.e. temp_c

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread src/devices/steelmate.c Outdated
continue; // DECODE_FAIL_MIC
//Battery voltage is stored as 100*(3.9v-<volt>).
uint8_t b1 = b[7];
int battery_mV = (int)3900 - ((double)b1 * 10.0f);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preferably all lower case battery_mv

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread src/devices/steelmate.c Outdated
continue; // DECODE_FAIL_MIC
//Battery voltage is stored as 100*(3.9v-<volt>).
uint8_t b1 = b[7];
int battery_mv = (int)3900 - ((double)b1 * 10.0f);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good for merge, though I'd like to mention that this is perhaps not doing what is intended:
(int)3900 is already int but will be promoted to double because of the right side.
10.0f will be promted to double because of the casted b1.
I guess it would suffice to calc: int battery_mv = 3900 - b1 * 10;, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, i got carried away a little and simplified it now. Tests still pass.

@zuckschwerdt zuckschwerdt merged commit 57ffc2b into merbanan:fix-steelmate_TPMS May 8, 2025
9 checks passed
@buxtronix buxtronix deleted the fix-steelmate_TPMS branch May 8, 2025 13:09
ProfBoc75 added a commit that referenced this pull request Jul 3, 2025
* Fix Steelmate pressure formula

* Improve Steelmate TPMS readouts (#3271)

* Change Steelmate TPMS to native units BREAKING CHANGE (#3274)

---------

Co-authored-by: buxtronix <bbuxton@gmail.com>
vidarino pushed a commit to vidarino/rtl_433 that referenced this pull request Feb 20, 2026
* Fix Steelmate pressure formula

* Improve Steelmate TPMS readouts (merbanan#3271)

* Change Steelmate TPMS to native units BREAKING CHANGE (merbanan#3274)

---------

Co-authored-by: buxtronix <bbuxton@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants