Skip to content

Commit 61e6b49

Browse files
authored
Merge pull request #3513 from merbanan/feat-pr2764
Cleanup of #2764, support of multiple car remotes
2 parents 0daa167 + 73f53b2 commit 61e6b49

18 files changed

Lines changed: 1957 additions & 0 deletions

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,23 @@ See [CONTRIBUTING.md](./docs/CONTRIBUTING.md).
386386
[298] TRW TPMS OOK OEM and Clone models
387387
[299] TRW TPMS FSK OEM and Clone models
388388
[300] Govee Water Leak Detector H5059
389+
[301] Astrostart 2000 Car Remote (-f 372.4M)
390+
[302] Compustar 1WG3R Car Remote
391+
[303] Chrysler Car Remote (-f 315.1M -s 920k)
392+
[304] Nidec Car Remote (-f 313.8M -s 1024k)
393+
[305] Audiovox PRO-OE3B Car Remote (-f 303.4M)
394+
[306] Microchip HCS361 KeeLoq Hopping Encoder based remotes (-f 315.1M) (Sync, 833 bit/s)
395+
[307] Microchip HCS361 KeeLoq Hopping Encoder based remotes (-f 315.1M) (Sync, 1667 bit/s)
396+
[308] Microchip HCS361 KeeLoq Hopping Encoder based remotes (-f 315.1M) (No Sync, 833 bit/s)
397+
[309] Microchip HCS361 KeeLoq Hopping Encoder based remotes (-f 315.1M) (No Sync, 1667 bit/s)
398+
[310] Microchip HCS361 KeeLoq Hopping Encoder based remotes (-f 315.1M) (PIWM, 2500 bit/s)
399+
[311] Microchip HCS361 KeeLoq Hopping Encoder based remotes (-f 315.1M) (PIWM, 5000 bit/s)
400+
[312] 6SC2 Car Remote (-f 315.1M)
401+
[313] GM ABO1502T Car Remote (-f 314.9M)
402+
[314] Siemens 5WY72XX Car Remote (-f 315.1M)
403+
[315] Alps FWB1U545 Car Remote
404+
[316] Continental KR5V2X Car Remote (-f 313.8M -s 1024k)
405+
[317] Code Alarm FRDPC2002 Car Remote
389406
390407
* Disabled by default, use -R n or a conf file to enable
391408

conf/nutek_car_remote.conf

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Nutek - Car Remote
2+
#
3+
# See https://github.com/merbanan/rtl_433_tests/tree/master/tests/nutek_car_remote/README.md
4+
#
5+
# Manufacturer:
6+
# - Nutek
7+
#
8+
# Supported Models:
9+
# - ATCD-1, APS99BT3BCF4, ATCH (FCC ID ELVATCD)
10+
# - AVX1BS4, AVX-1BS4 (FCC ID ELVATCC)
11+
# - A1BTX (FCC ID ELVATFE)
12+
# - 105BP (FCC ID ELVATJA)
13+
#
14+
# Data structure:
15+
#
16+
# Nutek Type 4 and Code Alarm Type 7 Transmitters
17+
#
18+
# Transmitter uses a rolling code that changes between each button press.
19+
# The same code is continuously repeated while button is held down.
20+
#
21+
# On some models, multiple buttons can be pressed to set multiple button flags.
22+
#
23+
# Data layout:
24+
#
25+
# x IIII CCCC B
26+
#
27+
# - x: 1 bit always 1
28+
# - I: 16 bit ID
29+
# - C: 16 bit rolling code, likely encrypted using symmetric encryption
30+
# - B: 4 bit flags indicating button(s) pressed
31+
#
32+
# Format string:
33+
#
34+
# PREAMBLE: b ID: hhhh CODE: hhhh BUTTON: bbbb
35+
36+
decoder {
37+
name=Nutek-CarRemote,
38+
modulation=OOK_PWM,
39+
short=500,
40+
long=945,
41+
reset=20000,
42+
gap=4050,
43+
sync=2000,
44+
bits=37,
45+
get=@1:{16}:id,
46+
get=@17:{16}:code,
47+
get=@33:{4}:button,
48+
}

conf/rtl_433.example.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,23 @@ convert si
539539
protocol 298 # TRW TPMS OOK OEM and Clone models
540540
protocol 299 # TRW TPMS FSK OEM and Clone models
541541
protocol 300 # Govee Water Leak Detector H5059
542+
protocol 301 # Astrostart 2000 Car Remote (-f 372.4M)
543+
protocol 302 # Compustar 1WG3R Car Remote
544+
protocol 303 # Chrysler Car Remote (-f 315.1M -s 920k)
545+
protocol 304 # Nidec Car Remote (-f 313.8M -s 1024k)
546+
protocol 305 # Audiovox PRO-OE3B Car Remote (-f 303.4M)
547+
protocol 306 # Microchip HCS361 KeeLoq Hopping Encoder based remotes (-f 315.1M) (Sync, 833 bit/s)
548+
protocol 307 # Microchip HCS361 KeeLoq Hopping Encoder based remotes (-f 315.1M) (Sync, 1667 bit/s)
549+
protocol 308 # Microchip HCS361 KeeLoq Hopping Encoder based remotes (-f 315.1M) (No Sync, 833 bit/s)
550+
protocol 309 # Microchip HCS361 KeeLoq Hopping Encoder based remotes (-f 315.1M) (No Sync, 1667 bit/s)
551+
protocol 310 # Microchip HCS361 KeeLoq Hopping Encoder based remotes (-f 315.1M) (PIWM, 2500 bit/s)
552+
protocol 311 # Microchip HCS361 KeeLoq Hopping Encoder based remotes (-f 315.1M) (PIWM, 5000 bit/s)
553+
protocol 312 # 6SC2 Car Remote (-f 315.1M)
554+
protocol 313 # GM ABO1502T Car Remote (-f 314.9M)
555+
protocol 314 # Siemens 5WY72XX Car Remote (-f 315.1M)
556+
protocol 315 # Alps FWB1U545 Car Remote
557+
protocol 316 # Continental KR5V2X Car Remote (-f 313.8M -s 1024k)
558+
protocol 317 # Code Alarm FRDPC2002 Car Remote
542559

543560
## Flex devices (command line option "-X")
544561

include/rtl_433_devices.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,23 @@
308308
DECL(tpms_trw_ook) \
309309
DECL(tpms_trw_fsk) \
310310
DECL(govee_h5059) \
311+
DECL(astrostart_2000) \
312+
DECL(compustar_1wg3r) \
313+
DECL(chrysler_car_remote) \
314+
DECL(nidec_car_remote) \
315+
DECL(audiovox_pro_oe3b) \
316+
DECL(hcs361_txwak_0_bsel_0) \
317+
DECL(hcs361_txwak_0_bsel_1) \
318+
DECL(hcs361_txwak_1_bsel_0) \
319+
DECL(hcs361_txwak_1_bsel_1) \
320+
DECL(hcs361_vpwm_1_bsel_0) \
321+
DECL(hcs361_vpwm_1_bsel_1) \
322+
DECL(six_sc_two_car_remote) \
323+
DECL(gm_car_remote) \
324+
DECL(siemens_5wy72xx_car_remote) \
325+
DECL(alps_fwb1u545_car_remote) \
326+
DECL(continental_car_remote) \
327+
DECL(code_alarm_frdpc2000_car_remote) \
311328

312329
/* Add new decoders here. */
313330

src/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ add_library(r_433 STATIC
4343
sdr.c
4444
term_ctl.c
4545
write_sigrok.c
46+
devices/6sc2.c
4647
devices/abmt.c
4748
devices/acurite.c
4849
devices/acurite_01185m.c
4950
devices/akhan_100F14.c
5051
devices/alecto.c
52+
devices/alps_fwb1u545.c
5153
devices/ambient_weather.c
5254
devices/ambientweather_tx8300.c
5355
devices/ambientweather_wh31e.c
@@ -57,7 +59,9 @@ add_library(r_433 STATIC
5759
devices/arad_ms_meter.c
5860
devices/archos_tbh.c
5961
devices/arexx_ml.c
62+
devices/astrostart_2000.c
6063
devices/atech_ws308.c
64+
devices/audiovox_pro_oe3b.c
6165
devices/auriol_4ld5661.c
6266
devices/auriol_aft77b2.c
6367
devices/auriol_afw2a1.c
@@ -86,9 +90,13 @@ add_library(r_433 STATIC
8690
devices/ced7000.c
8791
devices/celsia_czc1.c
8892
devices/chamberlain_cwpirc.c
93+
devices/chrysler_car_remote.c
8994
devices/chuango.c
9095
devices/cmr113.c
96+
devices/code_alarm_car_remote.c
9197
devices/companion_wtr001.c
98+
devices/compustar_1wg3r.c
99+
devices/continental_car_remote.c
92100
devices/cotech_36_7959.c
93101
devices/current_cost.c
94102
devices/danfoss.c
@@ -142,13 +150,15 @@ add_library(r_433 STATIC
142150
devices/generic_remote.c
143151
devices/generic_temperature_sensor.c
144152
devices/geo_minim.c
153+
devices/gm_car_remote.c
145154
devices/govee.c
146155
devices/govee_h5059.c
147156
devices/gridstream.c
148157
devices/gt_tmbbq05.c
149158
devices/gt_wt_02.c
150159
devices/gt_wt_03.c
151160
devices/hcs200.c
161+
devices/hcs361.c
152162
devices/hideki.c
153163
devices/holman_ws5029.c
154164
devices/homelead_hg9901.c
@@ -198,6 +208,7 @@ add_library(r_433 STATIC
198208
devices/nexa.c
199209
devices/nexus.c
200210
devices/nice_flor_s.c
211+
devices/nidec_car_remote.c
201212
devices/norgo.c
202213
devices/oil_smart.c
203214
devices/oil_standard.c
@@ -236,6 +247,7 @@ add_library(r_433 STATIC
236247
devices/secplus_v1.c
237248
devices/secplus_v2.c
238249
devices/sharp_spc775.c
250+
devices/siemens_5wy72xx.c
239251
devices/silvercrest.c
240252
devices/simplisafe.c
241253
devices/simplisafe_gen3.c

src/devices/6sc2.c

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
/** @file
2+
6SC2 - Car Remote.
3+
4+
Copyright (C) 2024 Ethan Halsall
5+
6+
This program is free software; you can redistribute it and/or modify
7+
it under the terms of the GNU General Public License as published by
8+
the Free Software Foundation; either version 2 of the License, or
9+
(at your option) any later version.
10+
*/
11+
/** @fn int six_sc_two_car_remote_decode(r_device *decoder, bitbuffer_t *bitbuffer)
12+
6SC2 - Car Remote (315 MHz)
13+
14+
Manufacturer:
15+
- Unknown
16+
17+
Supported Models:
18+
- 6SC2 CMGU
19+
- 6SC2 CDFA
20+
21+
Data structure:
22+
23+
The transmitter uses a rolling code message with an unencrypted sequence number.
24+
25+
Button operation:
26+
This transmitter has up to 4 buttons which can be pressed once to transmit a single message
27+
28+
Data layout:
29+
30+
Bytes are reflected
31+
32+
PPPP EEEEEEEE bbbb uuuu SSSS CC
33+
34+
- P: 16 bit preamble
35+
- E: 32 bit encrypted
36+
- b: 4 bit button
37+
- u: 4 bit unknown
38+
- S: 16 bit sequence
39+
- C: 8 bit checksum
40+
41+
Format string:
42+
43+
PREAMBLE: hhhh ENCRYPTED: hh hh hh hh BUTTON: bbbb UNKNOWN: bbbb SEQUENCE: hhhh CHECKSUM: hh
44+
45+
*/
46+
47+
#include "decoder.h"
48+
49+
static int six_sc_two_car_remote_decode(r_device *decoder, bitbuffer_t *bitbuffer)
50+
{
51+
int row = bitbuffer_find_repeated_row(bitbuffer, 1, 48);
52+
53+
if (bitbuffer->bits_per_row[row] > 88) {
54+
return DECODE_ABORT_LENGTH;
55+
}
56+
57+
uint8_t *bytes = bitbuffer->bb[row];
58+
59+
if (bytes[0] != 0x55 || bytes[1] != 0x54) {
60+
return DECODE_FAIL_SANITY;
61+
}
62+
63+
if (xor_bytes(bytes + 2, 9)) {
64+
return DECODE_FAIL_MIC;
65+
}
66+
67+
// The transmission is LSB first, big endian.
68+
uint32_t encrypted = (uint32_t)reverse8(bytes[5]) << 24 | (uint32_t)reverse8(bytes[4]) << 16 | (uint32_t)reverse8(bytes[3]) << 8 | reverse8(bytes[2]);
69+
int button = reverse8(bytes[6]) & 0xf;
70+
int sequence = (reverse8(bytes[8]) << 8) | reverse8(bytes[7]);
71+
72+
char encrypted_str[9];
73+
snprintf(encrypted_str, sizeof(encrypted_str), "%08X", encrypted);
74+
75+
char const *button_str;
76+
77+
/* clang-format off */
78+
switch (button) {
79+
case 0x1: button_str = "Unlock"; break;
80+
case 0x2: button_str = "Lock"; break;
81+
case 0x3: button_str = "Trunk"; break;
82+
case 0x4: button_str = "Panic"; break;
83+
default: button_str = "?"; break;
84+
}
85+
/* clang-format on */
86+
87+
/* clang-format off */
88+
data_t *data = data_make(
89+
"model", "model", DATA_STRING, "6SC2-CarRemote",
90+
"encrypted", "", DATA_STRING, encrypted_str,
91+
"button_code", "Button Code", DATA_INT, button,
92+
"button_str", "Button", DATA_STRING, button_str,
93+
"sequence", "Sequence", DATA_INT, sequence,
94+
"mic", "Integrity", DATA_STRING, "CHECKSUM",
95+
NULL);
96+
/* clang-format on */
97+
98+
decoder_output_data(decoder, data);
99+
return 1;
100+
}
101+
102+
static char const *const output_fields[] = {
103+
"model",
104+
"encrypted",
105+
"button_code",
106+
"button_str",
107+
"sequence",
108+
"mic",
109+
NULL,
110+
};
111+
112+
r_device const six_sc_two_car_remote = {
113+
.name = "6SC2 Car Remote (-f 315.1M)",
114+
.modulation = OOK_PULSE_MANCHESTER_ZEROBIT,
115+
.short_width = 250,
116+
.reset_limit = 10000,
117+
.decode_fn = &six_sc_two_car_remote_decode,
118+
.fields = output_fields,
119+
};

0 commit comments

Comments
 (0)