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

Flipper SubGhz RAW File only support integer bit durations

Open evilpete opened this issue 2 years ago • 5 comments

Describe the bug

While encoding a Raw RF signal for Insteon (Home Automation) that required 9124 baud I ran into a problem due to integer bit (level?) durations

RAW_Data: -110 220 -220 220 -330 ...

protocol requires 9124 baud, this works out to a bit (level?) durations of 109.600 microseconds

Given: 9124 baud -> 1/9124 -> 0.00010960105 sec -> 109.60105 ms

When I encode using 110 ms durations the signal is not recognized, if I use 109 ms durations the signal is only recognized approximate 25% of the time.

as a work around I ended up encoding at 109 with 1ms padding every three of four bits, honestly this is a bit of a hack and takes tweaking to work.

To Reproduce

On request I can generate a example file to test but will need the 3 byte address target device

Expected behavior

The best workaround I can think of is adding an optional line for baud to the SubGhz File description

while the CC1101 does not support exact baud rates it can get within 99.998% (according to my math)

evilpete avatar Jun 17 '22 02:06 evilpete

something is wrong with you even with an accuracy of 5% it is - + 5.75us I doubt very much that it's + -1us

Skorpionm avatar Jun 17 '22 20:06 Skorpionm

when the packet is 364 or 896 a .4 difference adds up .

evilpete avatar Jul 01 '22 05:07 evilpete

Theoretically we may add ability to configure timer clocking, please check if TIM2 can be configured for your needs?

skotopes avatar Jul 10 '22 14:07 skotopes

I was able to work around by tracking the timing offset and adding/deleting 1ms from from the bit duration to keep the packet timing in sync

evilpete avatar Jul 12 '22 07:07 evilpete

@evilpete also check digital signal library, it's designed to do that automatically

skotopes avatar Jul 12 '22 12:07 skotopes

@evilpete also check digital signal library, it's designed to do that automatically

i was working on generated SubGhz RAW, thus can't use the internal signal libaray

evilpete avatar Aug 05 '22 20:08 evilpete