Skip to content

Add ability to listen only to a specific protocol #845

@Jojo-1000

Description

@Jojo-1000

TL;DR

I would like a setting to select a specific remote type for listening, which improves receive reliability to nearly 100% from ~50%.

Description

After I got the FUT092 remote working, I noticed that the listening is not very reliable. Sometimes I have to press 3-4 times before it shows up in the sniffer. It is much less reliable than the light is actually reacting. I enabled the debug printing and got these outputs and similar:

Radio is available
Packet received (12 bytes): 09 C4 14 70 0A 9A 04 D0 99 15 8C 2B
Successfully parsed packet of length 10
Received packet (len = 10)!
NRF24MiLightRadio - received packet!
NRF24MiLightRadio - Checking packet length (expecting 10, is 10)
Packet id: 50197
Testing whether formater for ID 32 can handle packet: with protocol ID 37...
Testing whether formater for ID 37 can handle packet: with protocol ID 37...
Radio is available
Packet received (9 bytes): 09 C4 14 70 0A 9A 04 D0 99 
Failed CRC: expected 4480, got 99D0
Radio is available
Packet received (9 bytes): 09 C4 14 70 0A 9A 04 D0 99 
Failed CRC: expected 4480, got 99D0
Radio is available
Packet received (9 bytes): 09 C4 14 70 0A 9A 04 D0 99
Failed CRC: expected 4480, got 99D0

These are all retries from the same button press on the remote.

As you can see, the packets are getting cut off:
Packet received (12 bytes): 09 C4 14 70 0A 9A 04 D0 99 15 8C 2B
Packet received (9 bytes): 09 C4 14 70 0A 9A 04 D0 99

In this case, the retries by the remote were enough to catch the correct one, but other times it missed the packet entirely. First I thought there is some receiver interference that drops part of the packets, but the packet length is not determined by the data at all. I dug in the code to see what is causing this and found that the radio receiver is reconfigured constantly between the different protocol types and packet lengths. So depending on the exact timing, it might be decoded correctly, or it might be missed.

I think this is a good default state, because it allows to detect any kind of remote after pressing repeatedly. However, I only own one remote and would like to use it for automation. So for me, reliability is more important than supporting a range of devices. This is why I propose a UI setting to select a certain remote type from the list, or listen for all of them. After I removed the switching, the remote was detected every time.

UI Mockup

This is a quick mockup for the settings:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions