unleashed-firmware icon indicating copy to clipboard operation
unleashed-firmware copied to clipboard

Bandwidth, Datarate and Macnhester Enable decoding configuration

Open X-Stuff opened this issue 2 years ago • 3 comments

IMPORTANT

This is a copy from https://github.com/flipperdevices/flipperzero-firmware/pull/2230 In fact those changes were made in the fork of this (unleashed) repo. However I thought the original firmware might be interested in them too. So I would propose to check status of PR to original repo. If it will be approved - this PR might be rejected and sooner or later those changes will get into this repo. However the final decision what to do with this PR is up to unleashed repo owners, you might merge it before original (hopefully there should not be problems with merge)

What's new

  • [SubGhz]

    • [Receiver] Special preset AM* introduced. This preset allows to modify Bandwidth, Datarate and Macnhester decoding parameters of CC1101 chip. This PR also allows to get information about these fields from default (or other custom) modulation presets
  • [unit_tests]

    • Minor improvement to unit_tests app - allows to set desired log level before running unit_tests

Abstract

Some transmitters may have non-standard transmission params. So in order to get pulses more accurate you might need to have options to adjust some CC1101 settings manually.

This PR also could be a basement for other configurable parameters of CC1101 chip editing.

Verification

  • Open SubGHz App and enter read raw mode: 0000
  • Select modulation preset AM* 0001 0002

    Please note: default preset AM650 will show invalid Bandwidth, Datarate and Manchester decoding params because this preset was initialized with NULL as it CC1101's registers data

  • Setup desired configuration and test it 0003
  • Recorded RAW file will contain CC1101 registers configuration according to your setup
  • Loading this RAW file should setup exact configuration

    Please note: CUSTOM presets also allowed to be modified, so once you load your RAW file, you may change the advanced configuration of custom preset for RAW file

Checklist (For Reviewer)

  • [x] PR has description of feature/bug or link to Confluence/Jira task
  • [x] Description contains actions to verify feature/bugfix
  • [ ] I've built this code, uploaded it to the device and verified feature/bugfix

X-Stuff avatar Dec 31 '22 00:12 X-Stuff

Hi, thats a good improvement over subghz app, what do you think about adding FM too? FM with adjustable deviation Because now we have couple of FM presets that’s are differs only in deviation I will review and merge this PR in next days

xMasterX avatar Dec 31 '22 11:12 xMasterX

Hi, thats a good improvement over subghz app, what do you think about adding FM too? FM with adjustable deviation Because now we have couple of FM presets that’s are differs only in deviation I will review and merge this PR in next days

Yeah, technically expose deviation setting should have same approach. Ideally would be reproduce all RF Parameters from SmartRF Studio: image

It would be much easier if flipper UI API was supporting more features. Since some options should be hidden/shown depending on selected modulation. However this should be done later.

X-Stuff avatar Dec 31 '22 13:12 X-Stuff

Hello again, I looked into your PR and what i can say, it will be great to see FM* as i said in first message, FM with ability to change deviation

Also i like your implementation for Data rate input, we totally need to do similar thing to allow entering custom frequency, because now its a bit "hard" to add a non standard frequency, only via config file on microsd

Also one change needs to be made - AM* should be hidden in standard Read menu, because we have no extra options to edit it, it will be on its default values, which is not known for regular user We can edit and see what we selected only in RAW mode

Otherwise all looks fine, thanks for a great work

xMasterX avatar Jan 01 '23 20:01 xMasterX

Changes to hide AM* preset from standard Read menu were made.

Unfortunately, lack of flipper UI API, doesn't allow just "hide" the preset from selection (without huge increase of code complexity) Here another way was used: we just delete this preset before standard read scene, and add it before ReadRaw. But this approach leads to one minor "problem":

  • If you configured AM* in ReadRaw, and then switched to Read - preset and its configuration will be deleted (switching to other modes doesn't do this). So when you switch to Read Raw again - you have to configure AM* preset again.

However I would like to mention that:

  • Other presets like HND_1 are available in standard Read mode, which setting are hidden from user as well
  • You still are able to use AM* preset in standard Read mode but it's little bit tricky:
    • Open Read Raw and configure AM* preset
    • Remove RSSI threshold, capture some data (empty) and save raw file
    • Go to saved and load this file:

      flipper will create new preset named CUSTOM with parameters from recorded file, but they will be the same as they were in your configured AM* preset

    • Go to Read scene, then Config and select CUSTOM preset

Also I would like to mention also that decode button (from saved actions) is not available for original firmware, so probably this exact changes should not be in the original review. In other words, if users wanted to capture some standard known protocols but with custom modulation params - they will have to do that trick with CUSTOM preset, described above.

X-Stuff avatar Jan 02 '23 22:01 X-Stuff

Changes from this PR Will be temporary reverted from dev, I will return to your idea but i want to do some changes

xMasterX avatar Jan 18 '23 15:01 xMasterX