From 53e60cc8e846bded18a9d31135546b2623f2ae84 Mon Sep 17 00:00:00 2001
From: MX <10697207+xMasterX@users.noreply.github.com>
Date: Wed, 3 Aug 2022 00:32:55 +0300
Subject: [PATCH] subghz frequency range updates
---
.drone.yml | 12 +++-
ReadMe.md | 16 +++---
.../subghz/scenes/subghz_scene_show_only_rx.c | 7 +--
applications/subghz/subghz_cli.c | 4 +-
applications/subghz/subghz_i.c | 4 +-
applications/unirfremix/unirfremix_app.c | 18 +++---
.../targets/f7/furi_hal/furi_hal_subghz.c | 57 ++++++++++---------
7 files changed, 60 insertions(+), 58 deletions(-)
diff --git a/.drone.yml b/.drone.yml
index 270dda15f..0bcd97780 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -17,7 +17,7 @@ steps:
commands:
- export DIST_SUFFIX=${DRONE_TAG}
- export WORKFLOW_BRANCH_OR_TAG=dev-cfw
- - ./fbt --with-updater COMPACT=1 DEBUG=0 updater_package
+ - ./fbt COMPACT=1 DEBUG=0 updater_package
- mkdir artifacts-default
- mv dist/f7-C/* artifacts-default/
- ls -laS artifacts-default
@@ -105,7 +105,10 @@ steps:
Version: {{build.tag}}
- [-Github-](https://github.com/Eng1n33r/flipperzero-firmware/releases/tag/${DRONE_TAG})"
+ [-Github-](https://github.com/Eng1n33r/flipperzero-firmware/releases/tag/${DRONE_TAG})
+
+
+ [-Install via Web Updater-](https://my.flipp.dev/?url=https://unleashedflip.com/builds/flipper-z-f7-update-${DRONE_TAG}.tgz&channel=dev-cfw&version=${DRONE_TAG})"
document:
- artifacts-default/flipper-z-f7-full-${DRONE_TAG}.dfu
- artifacts-default/flipper-z-f7-update-${DRONE_TAG}.zip
@@ -124,7 +127,10 @@ steps:
Version: {{build.tag}}
- [[Github]](https://github.com/Eng1n33r/flipperzero-firmware/releases/latest)"
+ [[Github]](https://github.com/Eng1n33r/flipperzero-firmware/releases/tag/${DRONE_TAG})
+
+
+ [-Install via Web Updater-](https://my.flipp.dev/?url=https://unleashedflip.com/builds/flipper-z-f7-update-${DRONE_TAG}.tgz&channel=dev-cfw&version=${DRONE_TAG})"
trigger:
event:
diff --git a/ReadMe.md b/ReadMe.md
index de66f4b28..2efedb830 100644
--- a/ReadMe.md
+++ b/ReadMe.md
@@ -5,16 +5,14 @@
Welcome to Flipper Zero's Custom Firmware repo!
Our goal is to make any features possible in this device without any limitations!
-Please help us implement emulation for all dynamic (rolling codes) protocols and brute-force app!
-
+Please help us implement emulation for all subghz dynamic (rolling code) protocols and static code brute-force app!
+
### This software is for experimental purposes only and is not meant for any illegal activity/purposes.
We do not condone illegal activity and strongly encourage keeping transmissions to legal/valid uses allowed by law.
Also this software is made without any support from Flipper Devices and in no way related to official devs.
-### Please use for experimental purposes only!
-
Our Discord Community:
@@ -41,14 +39,14 @@ See changelog in releases for latest updates!
- HCS101
- An-Motors
- CAME Atomo
-- FAAC SLH (Spa)
-- BFT Mitto
+- FAAC SLH (Spa) [if cloning existing remote - external seed calculation required]
+- BFT Mitto [if cloning existing remote - external seed calculation required]
- Keeloq (+ proper manufacturer codes selection) [Not ALL systems supported yet!]
- Nice Flor S
-- SecPlus v1 & v2
+- Security+ v1 & v2
- Star Line
-### Apps included:
+### Community apps included:
- UPC-A Barcode generator plugin [(By McAzzaMan)](https://github.com/McAzzaMan/flipperzero-firmware/tree/UPC-A_Barcode_Generator/applications/barcode_generator)
- GPIO: Sentry Safe plugin [(By H4ckd4ddy)](https://github.com/H4ckd4ddy/flipperzero-sentry-safe-plugin)
@@ -93,7 +91,7 @@ See changelog in releases for latest updates!
**SubGHz**
-## [- How to extend SubGHz frequency range](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/DangerousSettings.md)
+## [- Transmission is blocked? - How to extend SubGHz frequency range](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/DangerousSettings.md)
## [- How to add extra SubGHz frequencies](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/SubGHzSettings.md)
diff --git a/applications/subghz/scenes/subghz_scene_show_only_rx.c b/applications/subghz/scenes/subghz_scene_show_only_rx.c
index 48fa751e0..039540e6f 100644
--- a/applications/subghz/scenes/subghz_scene_show_only_rx.c
+++ b/applications/subghz/scenes/subghz_scene_show_only_rx.c
@@ -13,12 +13,7 @@ void subghz_scene_show_only_rx_on_enter(void* context) {
Popup* popup = subghz->popup;
popup_set_icon(popup, 67, 12, &I_DolphinFirstStart7_61x51);
popup_set_text(
- popup,
- "This frequency can\nonly be used for RX\nin your region",
- 38,
- 40,
- AlignCenter,
- AlignBottom);
+ popup, "This frequency is\noutside of default\nrange", 38, 40, AlignCenter, AlignBottom);
popup_set_timeout(popup, 1500);
popup_set_context(popup, subghz);
popup_set_callback(popup, subghz_scene_show_only_rx_popup_callback);
diff --git a/applications/subghz/subghz_cli.c b/applications/subghz/subghz_cli.c
index 2b6fdd841..1d67f97de 100644
--- a/applications/subghz/subghz_cli.c
+++ b/applications/subghz/subghz_cli.c
@@ -54,7 +54,7 @@ void subghz_cli_command_tx_carrier(Cli* cli, string_t args, void* context) {
furi_delay_ms(250);
}
} else {
- printf("This frequency can only be used for RX in your region\r\n");
+ printf("This frequency can only be used for RX in your settings\r\n");
}
furi_hal_subghz_set_path(FuriHalSubGhzPathIsolate);
@@ -535,7 +535,7 @@ static void subghz_cli_command_chat(Cli* cli, string_t args) {
}
if(!furi_hal_subghz_is_tx_allowed(frequency)) {
printf(
- "In your region, only reception on this frequency (%lu) is allowed,\r\n"
+ "In your settings, only reception on this frequency (%lu) is allowed,\r\n"
"the actual operation of the application is not possible\r\n ",
frequency);
return;
diff --git a/applications/subghz/subghz_i.c b/applications/subghz/subghz_i.c
index 00cc922c7..9f3153d69 100644
--- a/applications/subghz/subghz_i.c
+++ b/applications/subghz/subghz_i.c
@@ -223,7 +223,7 @@ void subghz_dialog_message_show_only_rx(SubGhz* subghz) {
dialog_message_set_text(
message,
- "This frequency\nis restricted to\nreceiving only\nin your region.",
+ "Frequency\nis outside of\ndefault range.\nCheck docs.",
3,
17,
AlignLeft,
@@ -279,7 +279,7 @@ bool subghz_key_load(SubGhz* subghz, const char* file_path, bool show_dialog) {
}
if(!furi_hal_subghz_is_tx_allowed(temp_data32)) {
- FURI_LOG_E(TAG, "This frequency can only be used for RX in your region");
+ FURI_LOG_E(TAG, "This frequency can only be used for RX");
load_key_state = SubGhzLoadKeyStateOnlyRx;
break;
}
diff --git a/applications/unirfremix/unirfremix_app.c b/applications/unirfremix/unirfremix_app.c
index 23d3786c8..4f43428a4 100644
--- a/applications/unirfremix/unirfremix_app.c
+++ b/applications/unirfremix/unirfremix_app.c
@@ -476,7 +476,13 @@ static void unirfremix_send_signal(
for(int x = 1; x <= app->repeat; x++) {
frequency = frequency ? frequency : 433920000;
FURI_LOG_E(TAG, "file to send: %s", string_get_cstr(signal));
-
+ if(!furi_hal_subghz_is_tx_allowed(frequency)) {
+ printf(
+ "In your settings, only reception on this frequency (%lu) is allowed,\r\n"
+ "the actual operation of the unirf app is not possible\r\n ",
+ frequency);
+ break;
+ }
string_t flipper_format_string;
if(strcmp(string_get_cstr(protocol), "RAW") == 0) {
@@ -498,21 +504,17 @@ static void unirfremix_send_signal(
subghz_transmitter_deserialize(transmitter, flipper_format);
furi_hal_subghz_reset();
- furi_hal_subghz_load_preset(FuriHalSubGhzPresetOok270Async);
+ furi_hal_subghz_load_preset(FuriHalSubGhzPresetOok650Async);
furi_hal_subghz_set_frequency_and_path(frequency);
- furi_hal_subghz_reset();
- furi_hal_subghz_load_preset(FuriHalSubGhzPresetOok270Async);
- furi_hal_subghz_set_frequency_and_path(frequency);
-
- printf("Transmitting at %lu, repeat %d.\r\n", frequency, x);
+ //printf("Transmitting at %lu, repeat %d.\r\n", frequency, x);
furi_hal_power_suppress_charge_enter();
furi_hal_subghz_start_async_tx(subghz_transmitter_yield, transmitter);
while(!(furi_hal_subghz_is_async_tx_complete())) {
notification_message(notification, &sequence_blink_magenta_10);
- printf("Sending...");
+ //printf("Sending...");
fflush(stdout);
furi_delay_ms(333);
}
diff --git a/firmware/targets/f7/furi_hal/furi_hal_subghz.c b/firmware/targets/f7/furi_hal/furi_hal_subghz.c
index f8e998be1..0e2810141 100644
--- a/firmware/targets/f7/furi_hal/furi_hal_subghz.c
+++ b/firmware/targets/f7/furi_hal/furi_hal_subghz.c
@@ -287,13 +287,39 @@ uint8_t furi_hal_subghz_get_lqi() {
}
/*
- Modified by @tkerby to the full YARD Stick One extended range of 281-361 MHz, 378-481 MHz, and 749-962 MHz.
+ Modified by @tkerby & MX to the full YARD Stick One extended range of 281-361 MHz, 378-481 MHz, and 749-962 MHz.
These changes are at your own risk. The PLL may not lock and FZ devs have warned of possible damage!
*/
+
bool furi_hal_subghz_is_frequency_valid(uint32_t value) {
+ if(!(value >= 281000000 && value <= 361000000) &&
+ !(value >= 378000000 && value <= 481000000) &&
+ !(value >= 749000000 && value <= 962000000)) {
+ return false;
+ }
+
+ return true;
+}
+
+uint32_t furi_hal_subghz_set_frequency_and_path(uint32_t value) {
+ // Set these values to the extended frequency range only. They dont define if you can transmit but do select the correct RF path
+ value = furi_hal_subghz_set_frequency(value);
+ if(value >= 281000000 && value <= 361000000) {
+ furi_hal_subghz_set_path(FuriHalSubGhzPath315);
+ } else if(value >= 378000000 && value <= 481000000) {
+ furi_hal_subghz_set_path(FuriHalSubGhzPath433);
+ } else if(value >= 749000000 && value <= 962000000) {
+ furi_hal_subghz_set_path(FuriHalSubGhzPath868);
+ } else {
+ furi_crash("SubGhz: Incorrect frequency during set.");
+ }
+ return value;
+}
+
+bool furi_hal_subghz_is_tx_allowed(uint32_t value) {
bool is_extended = false;
- // TODO: Move file check to another place
+ // TODO: !!! Move file check to another place
Storage* storage = furi_record_open("storage");
FlipperFormat* fff_data_file = flipper_format_file_alloc(storage);
@@ -321,33 +347,8 @@ bool furi_hal_subghz_is_frequency_valid(uint32_t value) {
return true;
}
-uint32_t furi_hal_subghz_set_frequency_and_path(uint32_t value) {
- // Set these values to the extended frequency range only. They dont define if you can transmit but do select the correct RF path
- value = furi_hal_subghz_set_frequency(value);
- if(value >= 281000000 && value <= 361000000) {
- furi_hal_subghz_set_path(FuriHalSubGhzPath315);
- } else if(value >= 378000000 && value <= 481000000) {
- furi_hal_subghz_set_path(FuriHalSubGhzPath433);
- } else if(value >= 749000000 && value <= 962000000) {
- furi_hal_subghz_set_path(FuriHalSubGhzPath868);
- } else {
- furi_crash("SubGhz: Incorrect frequency during set.");
- }
- return value;
-}
-
-bool furi_hal_subghz_is_tx_allowed(uint32_t value) {
- UNUSED(value);
- // Removed region check
- return true;
-}
-
uint32_t furi_hal_subghz_set_frequency(uint32_t value) {
- if(furi_hal_subghz_is_tx_allowed(value)) {
- furi_hal_subghz.regulation = SubGhzRegulationTxRx;
- } else {
- furi_hal_subghz.regulation = SubGhzRegulationOnlyRx;
- }
+ furi_hal_subghz.regulation = SubGhzRegulationTxRx;
furi_hal_spi_acquire(&furi_hal_spi_bus_handle_subghz);
uint32_t real_frequency = cc1101_set_frequency(&furi_hal_spi_bus_handle_subghz, value);