[Bug] Princeton protocol (433.92 MHz): Captured signal fails to trigger smart socket on replay
Description
I am trying to capture and replay a signal from a 433.92 MHz remote control for a standard RF smart socket using the same device/firmware. While the signal is successfully captured and decoded as the Princeton protocol, retransmitting it does not trigger the smart socket at all (even after sending it multiple times).
Steps to Reproduce
- Capture the remote control signal on
433.92 MHz. - The device decodes it as
Protocol: Princeton, ID: 2A98A8. - Retransmit the captured signal using the same device.
- Observe that the smart socket does not react.
Serial / Console Output
Transmitting key, protocol: Princeton, ID: 2A98A8, Freq: 433.92 MHz
Transmitting key, protocol: Princeton, ID: 2A98A8, Freq: 433.92 MHz
Transmitting key, protocol: Princeton, ID: 2A98A8, Freq: 433.92 MHz
Transmitting key, protocol: Princeton, ID: 2A98A8, Freq: 433.92 MHz
Transmitting key, protocol: Princeton, ID: 2A98A8, Freq: 433.92 MHz
Additional Context & Observations
- Byte Order / Bit Inversion Issue: Another RF tool/library captures the exact same physical remote as
A8982A(reversed byte order compared to2A98A8). - Fixed Code Behavior: Usually, this specific smart socket does not respond to simple fixed-code retransmissions unless the exact pulse length (TE) and proper packet repetition count are preserved (or when sent via RAW mode).
- Could there be an issue with how the
Princetonencoder handles byte order (endianness), default pulse duration (TE), or signal inversion during transmission compared to reception?
Bug Confirmed: Princeton 24-bit Replay Issue
Thanks for the detailed report! You hit the nail on the head regarding 2A98A8 vs A8982A.
Root Cause Analysis
1. Byte Order (Endianness Mismatch)
2A 98 A8 reversed byte-by-byte is A8 98 2A.
Because the ESP32 is a little-endian architecture, the 24-bit key buffer is currently handled backwards when transmitted:
- Expected over the air:
[0xA8, 0x98, 0x2A] - Currently transmitted:
[0x2A, 0x98, 0xA8]
As a result, the receiver socket never matches the transmitted address.
2. Pulse Duration (TE)
The Princeton (PT2262 / EV1527) protocol relies on the physical remote's $R_{osc}$ resistor:
- Timings typically vary between 150 µs and 450 µs.
- The firmware currently transmits with a static default timing, which may fall outside the socket receiver's tolerance window.
3. Frame Repetitions
Most RF smart sockets require 5–10 consecutive valid frames with sync gaps to filter out ambient noise. Sending single bursts or too few repeats will fail to trigger the relay.
Planned Fixes
- [ ] Fix byte-order / endianness in the Princeton TX encoder (
A8982A). - [ ] Increase default frame repeat count to 8–10 bursts.
- [ ] Add dynamic/measured
TEstorage instead of a static constant.
The fix will be included in the next commit/release!