From 801d6ae71c52c226f3875481f1ff256ce6db64ad Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Mon, 11 Aug 2025 15:44:28 +0300 Subject: [PATCH 1/8] upd subghz remote --- applications/main/subghz_remote | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/main/subghz_remote b/applications/main/subghz_remote index b63137679..1180b5a76 160000 --- a/applications/main/subghz_remote +++ b/applications/main/subghz_remote @@ -1 +1 @@ -Subproject commit b63137679870602ac5ba02cba4eb0f4b0efce6fa +Subproject commit 1180b5a76698338da4dfeed66a2ff57a70de3efa From e8ce86917a9c00686c909455370eb8eed65dea97 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Mon, 11 Aug 2025 15:45:18 +0300 Subject: [PATCH 2/8] upd changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1acadf0aa..0074163c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * LFRFID: Add additional procotols supported by EM4305 chipset (by @jamisonderek) * Apps: **Check out more Apps updates and fixes by following** [this link](https://github.com/xMasterX/all-the-plugins/commits/dev) ## Other changes +* Add possibility to use custom buttons when using the SubGHz remote app (by @MrLego8-9) * Input Settings: Add Vibro Trigger option (by @956MB & @WillyJL) * BT Remote: Add Rename Option (by @aaronjamt & @WillyJL) * Simplify Bad USB BLE profile (by @aaronjamt & @WillyJL) From 46e7912d94fce550a723fd4cd2990157e8f69444 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Mon, 11 Aug 2025 21:16:16 +0300 Subject: [PATCH 3/8] Fix branch&manifest --- applications/main/subghz_remote | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/main/subghz_remote b/applications/main/subghz_remote index 1180b5a76..ee887fb77 160000 --- a/applications/main/subghz_remote +++ b/applications/main/subghz_remote @@ -1 +1 @@ -Subproject commit 1180b5a76698338da4dfeed66a2ff57a70de3efa +Subproject commit ee887fb77484fb8a06a5f346e9f41d81ab5ec9e3 From 40e56bc862d09f85f2aacde4116d01bb096f77b4 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Mon, 11 Aug 2025 21:29:58 +0300 Subject: [PATCH 4/8] subghz add zkteco support, fbt format --- .../main/subghz/helpers/subghz_custom_event.h | 1 + .../main/subghz/helpers/subghz_gen_info.c | 10 +++++++++ .../subghz/scenes/subghz_scene_set_counter.c | 3 ++- .../main/subghz/scenes/subghz_scene_set_key.c | 1 - .../subghz/scenes/subghz_scene_set_seed.c | 1 - .../subghz/scenes/subghz_scene_set_serial.c | 21 ++++++++++++------- .../subghz/scenes/subghz_scene_set_type.c | 1 + applications/main/subghz_remote | 2 +- 8 files changed, 29 insertions(+), 11 deletions(-) diff --git a/applications/main/subghz/helpers/subghz_custom_event.h b/applications/main/subghz/helpers/subghz_custom_event.h index dffc6d193..d212de4ef 100644 --- a/applications/main/subghz/helpers/subghz_custom_event.h +++ b/applications/main/subghz/helpers/subghz_custom_event.h @@ -120,6 +120,7 @@ typedef enum { SetTypeCAMESpace, SetTypePricenton315, SetTypePricenton433, + SetTypeZKTeco430, SetTypeBETT_433, SetTypeGangQi_433, SetTypeHollarm_433, diff --git a/applications/main/subghz/helpers/subghz_gen_info.c b/applications/main/subghz/helpers/subghz_gen_info.c index f6abec0c6..90853cec5 100644 --- a/applications/main/subghz/helpers/subghz_gen_info.c +++ b/applications/main/subghz/helpers/subghz_gen_info.c @@ -38,6 +38,16 @@ void subghz_scene_set_type_fill_generation_infos(GenInfo* infos_dest, SetType ty .data.bits = 24, .data.te = 400}; break; + case SetTypeZKTeco430: + gen_info = (GenInfo){ + .type = GenData, + .mod = "AM650", + .freq = 430500000, + .data.name = SUBGHZ_PROTOCOL_PRINCETON_NAME, + .data.key = (key & 0x00FFFF00) | 0x30, // btn 0x30(UP), 0x03(STOP), 0x0C(DOWN) + .data.bits = 24, + .data.te = 357}; + break; case SetTypeNiceFlo12bit: gen_info = (GenInfo){ .type = GenData, diff --git a/applications/main/subghz/scenes/subghz_scene_set_counter.c b/applications/main/subghz/scenes/subghz_scene_set_counter.c index f66152a7c..9afa3408c 100644 --- a/applications/main/subghz/scenes/subghz_scene_set_counter.c +++ b/applications/main/subghz/scenes/subghz_scene_set_counter.c @@ -107,7 +107,8 @@ bool subghz_scene_set_counter_on_event(void* context, SceneManagerEvent event) { subghz->gen_info->keeloq_bft.cnt = __bswap16(subghz->gen_info->keeloq_bft.cnt); break; case GenAlutechAt4n: - subghz->gen_info->alutech_at_4n.cnt = __bswap16(subghz->gen_info->alutech_at_4n.cnt); + subghz->gen_info->alutech_at_4n.cnt = + __bswap16(subghz->gen_info->alutech_at_4n.cnt); break; case GenSomfyTelis: subghz->gen_info->somfy_telis.cnt = __bswap16(subghz->gen_info->somfy_telis.cnt); diff --git a/applications/main/subghz/scenes/subghz_scene_set_key.c b/applications/main/subghz/scenes/subghz_scene_set_key.c index b617b1a0f..690c62182 100644 --- a/applications/main/subghz/scenes/subghz_scene_set_key.c +++ b/applications/main/subghz/scenes/subghz_scene_set_key.c @@ -44,7 +44,6 @@ bool subghz_scene_set_key_on_event(void* context, SceneManagerEvent event) { if(event.type == SceneManagerEventTypeCustom) { if(event.event == SubGhzCustomEventByteInputDone) { - if(subghz->gen_info->type == GenData) { subghz->gen_info->data.key = __bswap64(subghz->gen_info->data.key); diff --git a/applications/main/subghz/scenes/subghz_scene_set_seed.c b/applications/main/subghz/scenes/subghz_scene_set_seed.c index 3e4a33536..c858b2a17 100644 --- a/applications/main/subghz/scenes/subghz_scene_set_seed.c +++ b/applications/main/subghz/scenes/subghz_scene_set_seed.c @@ -60,7 +60,6 @@ bool subghz_scene_set_seed_on_event(void* context, SceneManagerEvent event) { bool generated_protocol = false; if(event.type == SceneManagerEventTypeCustom) { if(event.event == SubGhzCustomEventByteInputDone) { - switch(subghz->gen_info->type) { case GenFaacSLH: subghz->gen_info->faac_slh.seed = __bswap32(subghz->gen_info->faac_slh.seed); diff --git a/applications/main/subghz/scenes/subghz_scene_set_serial.c b/applications/main/subghz/scenes/subghz_scene_set_serial.c index bedb0d1cc..5c3b76733 100644 --- a/applications/main/subghz/scenes/subghz_scene_set_serial.c +++ b/applications/main/subghz/scenes/subghz_scene_set_serial.c @@ -95,25 +95,32 @@ bool subghz_scene_set_serial_on_event(void* context, SceneManagerEvent event) { subghz->gen_info->keeloq.serial = __bswap32(subghz->gen_info->keeloq.serial); break; case GenCameAtomo: - subghz->gen_info->came_atomo.serial = __bswap32(subghz->gen_info->came_atomo.serial); + subghz->gen_info->came_atomo.serial = + __bswap32(subghz->gen_info->came_atomo.serial); break; case GenKeeloqBFT: - subghz->gen_info->keeloq_bft.serial = __bswap32(subghz->gen_info->keeloq_bft.serial); + subghz->gen_info->keeloq_bft.serial = + __bswap32(subghz->gen_info->keeloq_bft.serial); break; case GenAlutechAt4n: - subghz->gen_info->alutech_at_4n.serial = __bswap32(subghz->gen_info->alutech_at_4n.serial); + subghz->gen_info->alutech_at_4n.serial = + __bswap32(subghz->gen_info->alutech_at_4n.serial); break; case GenSomfyTelis: - subghz->gen_info->somfy_telis.serial = __bswap32(subghz->gen_info->somfy_telis.serial); + subghz->gen_info->somfy_telis.serial = + __bswap32(subghz->gen_info->somfy_telis.serial); break; case GenNiceFlorS: - subghz->gen_info->nice_flor_s.serial = __bswap32(subghz->gen_info->nice_flor_s.serial); + subghz->gen_info->nice_flor_s.serial = + __bswap32(subghz->gen_info->nice_flor_s.serial); break; case GenSecPlus2: - subghz->gen_info->sec_plus_2.serial = __bswap32(subghz->gen_info->sec_plus_2.serial); + subghz->gen_info->sec_plus_2.serial = + __bswap32(subghz->gen_info->sec_plus_2.serial); break; case GenPhoenixV2: - subghz->gen_info->phoenix_v2.serial = __bswap32(subghz->gen_info->phoenix_v2.serial); + subghz->gen_info->phoenix_v2.serial = + __bswap32(subghz->gen_info->phoenix_v2.serial); break; // Not needed for these types case GenData: diff --git a/applications/main/subghz/scenes/subghz_scene_set_type.c b/applications/main/subghz/scenes/subghz_scene_set_type.c index f493954bc..93419a974 100644 --- a/applications/main/subghz/scenes/subghz_scene_set_type.c +++ b/applications/main/subghz/scenes/subghz_scene_set_type.c @@ -68,6 +68,7 @@ static const char* submenu_names[SetTypeMAX] = { [SetTypeCAMESpace] = "KL: CAME Space 433MHz", [SetTypePricenton315] = "Princeton 315MHz", [SetTypePricenton433] = "Princeton 433MHz", + [SetTypeZKTeco430] = "ZKTeco 430MHz", [SetTypeGangQi_433] = "GangQi 433MHz", [SetTypeHollarm_433] = "Hollarm 433MHz", [SetTypeReversRB2_433] = "Revers RB2 433MHz", diff --git a/applications/main/subghz_remote b/applications/main/subghz_remote index ee887fb77..25ff072cc 160000 --- a/applications/main/subghz_remote +++ b/applications/main/subghz_remote @@ -1 +1 @@ -Subproject commit ee887fb77484fb8a06a5f346e9f41d81ab5ec9e3 +Subproject commit 25ff072cc7f90a4af3a8b43bb418bb74dcf9da41 From c610caea9b006074e718264063697d621cb88d6f Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Mon, 11 Aug 2025 21:31:09 +0300 Subject: [PATCH 5/8] upd changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0074163c5..25b037c9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## Main changes - Current API: 86.0 +* SubGHz: Add ZKTeco 430.5 MHz add manually support * SubGHz: Add variant of 'Add Manually' menu with manual editing for each value (PR #909 #911 #914 | by @MrLego8-9) * OFW PR 4251: CLI: Fix long delay with quick connect/disconnect (by @WillyJL) * LFRFID: Add additional procotols supported by EM4305 chipset (by @jamisonderek) From eb9b84e0c0ec4d01c03bc90a41162d3f7d3d7528 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Fri, 15 Aug 2025 00:28:49 +0300 Subject: [PATCH 6/8] Linear 10bit EZCode remotes support --- lib/subghz/protocols/linear.c | 38 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/subghz/protocols/linear.c b/lib/subghz/protocols/linear.c index f9d7aaca8..7d9f12d42 100644 --- a/lib/subghz/protocols/linear.c +++ b/lib/subghz/protocols/linear.c @@ -18,7 +18,7 @@ static const SubGhzBlockConst subghz_protocol_linear_const = { .te_short = 500, .te_long = 1500, - .te_delta = 150, + .te_delta = 350, .min_count_bit_for_found = 10, }; @@ -116,32 +116,32 @@ static bool subghz_protocol_encoder_linear_get_upload(SubGhzProtocolEncoderLinea if(bit_read(instance->generic.data, i - 1)) { //send bit 1 instance->encoder.upload[index++] = - level_duration_make(true, (uint32_t)subghz_protocol_linear_const.te_short * 3); + level_duration_make(true, (uint32_t)subghz_protocol_linear_const.te_short); instance->encoder.upload[index++] = - level_duration_make(false, (uint32_t)subghz_protocol_linear_const.te_short); + level_duration_make(false, (uint32_t)subghz_protocol_linear_const.te_long); } else { //send bit 0 instance->encoder.upload[index++] = - level_duration_make(true, (uint32_t)subghz_protocol_linear_const.te_short); + level_duration_make(true, (uint32_t)subghz_protocol_linear_const.te_long); instance->encoder.upload[index++] = - level_duration_make(false, (uint32_t)subghz_protocol_linear_const.te_short * 3); + level_duration_make(false, (uint32_t)subghz_protocol_linear_const.te_short); } } //Send end bit if(bit_read(instance->generic.data, 0)) { //send bit 1 instance->encoder.upload[index++] = - level_duration_make(true, (uint32_t)subghz_protocol_linear_const.te_short * 3); - //Send PT_GUARD + level_duration_make(true, (uint32_t)subghz_protocol_linear_const.te_short); + //Send gap instance->encoder.upload[index++] = - level_duration_make(false, (uint32_t)subghz_protocol_linear_const.te_short * 42); + level_duration_make(false, (uint32_t)subghz_protocol_linear_const.te_short * 44); } else { //send bit 0 instance->encoder.upload[index++] = - level_duration_make(true, (uint32_t)subghz_protocol_linear_const.te_short); - //Send PT_GUARD + level_duration_make(true, (uint32_t)subghz_protocol_linear_const.te_long); + //Send gap instance->encoder.upload[index++] = - level_duration_make(false, (uint32_t)subghz_protocol_linear_const.te_short * 44); + level_duration_make(false, (uint32_t)subghz_protocol_linear_const.te_short * 42); } return true; @@ -223,7 +223,7 @@ void subghz_protocol_decoder_linear_feed(void* context, bool level, uint32_t dur switch(instance->decoder.parser_step) { case LinearDecoderStepReset: if((!level) && (DURATION_DIFF(duration, subghz_protocol_linear_const.te_short * 42) < - subghz_protocol_linear_const.te_delta * 20)) { + subghz_protocol_linear_const.te_delta * 15)) { //Found header Linear instance->decoder.decode_data = 0; instance->decoder.decode_count_bit = 0; @@ -244,16 +244,16 @@ void subghz_protocol_decoder_linear_feed(void* context, bool level, uint32_t dur instance->decoder.parser_step = LinearDecoderStepReset; //checking that the duration matches the guardtime if(DURATION_DIFF(duration, subghz_protocol_linear_const.te_short * 42) > - subghz_protocol_linear_const.te_delta * 20) { + subghz_protocol_linear_const.te_delta * 15) { break; } if(DURATION_DIFF(instance->decoder.te_last, subghz_protocol_linear_const.te_short) < subghz_protocol_linear_const.te_delta) { - subghz_protocol_blocks_add_bit(&instance->decoder, 0); + subghz_protocol_blocks_add_bit(&instance->decoder, 1); } else if( DURATION_DIFF(instance->decoder.te_last, subghz_protocol_linear_const.te_long) < subghz_protocol_linear_const.te_delta) { - subghz_protocol_blocks_add_bit(&instance->decoder, 1); + subghz_protocol_blocks_add_bit(&instance->decoder, 0); } if(instance->decoder.decode_count_bit == subghz_protocol_linear_const.min_count_bit_for_found) { @@ -273,14 +273,14 @@ void subghz_protocol_decoder_linear_feed(void* context, bool level, uint32_t dur subghz_protocol_linear_const.te_delta) && (DURATION_DIFF(duration, subghz_protocol_linear_const.te_long) < subghz_protocol_linear_const.te_delta)) { - subghz_protocol_blocks_add_bit(&instance->decoder, 0); + subghz_protocol_blocks_add_bit(&instance->decoder, 1); instance->decoder.parser_step = LinearDecoderStepSaveDuration; } else if( (DURATION_DIFF(instance->decoder.te_last, subghz_protocol_linear_const.te_long) < subghz_protocol_linear_const.te_delta) && (DURATION_DIFF(duration, subghz_protocol_linear_const.te_short) < subghz_protocol_linear_const.te_delta)) { - subghz_protocol_blocks_add_bit(&instance->decoder, 1); + subghz_protocol_blocks_add_bit(&instance->decoder, 0); instance->decoder.parser_step = LinearDecoderStepSaveDuration; } else { instance->decoder.parser_step = LinearDecoderStepReset; @@ -331,8 +331,8 @@ void subghz_protocol_decoder_linear_get_string(void* context, FuriString* output furi_string_cat_printf( output, "%s %dbit\r\n" - "Key:0x%08lX\r\n" - "Yek:0x%08lX\r\n" + "Key:0x%03lX\r\n" + "Yek:0x%03lX\r\n" "DIP:" DIP_PATTERN "\r\n", instance->generic.protocol_name, instance->generic.data_count_bit, From f2bfed6bbcdea67aedd1134777cc1a8859a167f6 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Fri, 15 Aug 2025 00:40:01 +0300 Subject: [PATCH 7/8] Avoid false positives for dickert mahs --- lib/subghz/protocols/dickert_mahs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/subghz/protocols/dickert_mahs.c b/lib/subghz/protocols/dickert_mahs.c index 4691e3423..3f614412b 100644 --- a/lib/subghz/protocols/dickert_mahs.c +++ b/lib/subghz/protocols/dickert_mahs.c @@ -288,8 +288,9 @@ void subghz_protocol_decoder_dickert_mahs_feed(void* context, bool level, uint32 instance->decoder.decode_count_bit = 0; } - if((!level) && (duration > 10 * subghz_protocol_dickert_mahs_const.te_short)) { - //Found header DICKERT_MAHS + if((!level) && (DURATION_DIFF(duration, subghz_protocol_dickert_mahs_const.te_long * 50) < + subghz_protocol_dickert_mahs_const.te_delta * 70)) { + //Found header DICKERT_MAHS 44k us instance->decoder.parser_step = DickertMAHSDecoderStepInitial; } break; From efcaf96d07b74288370c9c9ff48897baba75f50e Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Fri, 15 Aug 2025 00:55:58 +0300 Subject: [PATCH 8/8] upd changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25b037c9f..e65eaab3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## Main changes - Current API: 86.0 +* SubGHz: Tune Linear (add better EZCode support), Dickert MAHS decoders * SubGHz: Add ZKTeco 430.5 MHz add manually support * SubGHz: Add variant of 'Add Manually' menu with manual editing for each value (PR #909 #911 #914 | by @MrLego8-9) * OFW PR 4251: CLI: Fix long delay with quick connect/disconnect (by @WillyJL)