Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mastercode SubGHz Protocol #3187

Merged

Conversation

flipperzelebro
Copy link
Contributor

@flipperzelebro flipperzelebro commented Nov 1, 2023

What's new

Resolves #3182

Implements the Sub GHz Protocol for the garage remote Clemsa Mastercode MV12 .

Its a fixed code 433.92 MHz remote with modulation AM270.

Its very similar to Clemsa protocol already implemented, but with some changes:

  • Time of the On, Off, pause.
  • Length of the key.
  • Order of the bits for switches.

Verification

The PR includes a raw SUB file to test the decode and a SUB to test de codification.
Attached are 2 additional SUB to test it.
In the wild you can test it using a remote and using 433.92 MHz and modulation AM270.

Checklist (For Reviewer)

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

@Skorpionm
Copy link
Member

Skorpionm commented Nov 2, 2023

In your RAW file the frequency is set to 434.075 MHz, I assume that this is not the correct frequency. The RAW file itself contains no payload, only noise
image

@Skorpionm
Copy link
Member

You have 36bit in your parcel, you do not display and decrypt everything. It is possible to obtain RAW recordings of different switch positions for analysis. there's clearly enough tone here

@flipperzelebro
Copy link
Contributor Author

flipperzelebro commented Nov 2, 2023

It´s true you are righ,!!! Now I have commited 2 correct raw files and 2 tests for them.

The fisrt file mastercode_raw.sub has this DIP setting:
(+): ---**---
(o): --------
(-): ***--***

and the second mastercore2_raw.sub has:
(+): --***---
(o): --------
(-): **---***

Also I fixed the key printed in info to show all the hex digits instead of the fisrts 2 bytes.

@Skorpionm
Copy link
Member

and again, please give me, just in the archive, recordings of the remote control with different switch positions, the recording should be with the button pressed for about 2+ seconds. switch positions (all down, all in the center, all up, all ladder) and you also need a photo of the DIP switches on the remote control, something tells me that you missed something

@flipperzelebro
Copy link
Contributor Author

No problem, I really appreciate you check it, because its my first contribution and its fine to double checki it.
I wish the files are fine
IMG_20231103_182217
SUB mastercode.zip

@Skorpionm
Copy link
Member

image

  1. you lose the older one when displaying what you need
    B 7E 00 3C 08
    displayed
    0 7E 00 3C 08

  2. unit_test doesn't work.
    image

you can run and check, assemble and download
"./fbt flash_usb_full FIRMWARE_APP_SET=unit_tests"
launch CLI cmd "unit_tests subghz"

  1. Bit durations and generation of guard time during emulation were incorrectly calculated
    image
    .te_short = 1072,
    .te_long = 2145,

    P.S. don't get me wrong, I'm not being picky, we need a fully working PR

@hedger hedger added Sub-GHz Sub-GHz-related New Feature Contains an IMPLEMENTATION of a new feature labels Nov 6, 2023
@flipperzelebro
Copy link
Contributor Author

Finally I have fixed the two bugs that I had, on the one hand the duration of the pulses was not correct and on the other hand the Key was not being displayed completely.
I found @Skorpionm comments and the detail on how to do the unit tests very helpful. I think everything is now correct.

@Skorpionm
Copy link
Member

@flipperzelebro
SUCCESS! I'm very glad you didn't give up.

@skotopes skotopes merged commit a61b5d4 into flipperdevices:dev Nov 15, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Feature Contains an IMPLEMENTATION of a new feature Sub-GHz Sub-GHz-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new SubGhz protocol for Clemsa MasterCode MV12
4 participants