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

Fix Byron doorbell detection and processing #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions RFLink/2_Signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define SIGNAL_SEEK_TIMEOUT_MS 25 // 25 // After this time in mSec, RF signal will be considered absent.
#define SIGNAL_MIN_PREAMBLE_US 400 // 400 // After this time in uSec, a RF signal will be considered to have started.
#define MIN_PULSE_LENGTH_US 100 // 100 // Pulses shorter than this value in uSec. will be seen as garbage and not taken as actual pulses.
#define SIGNAL_END_TIMEOUT_US 5000 // 5000 // After this time in uSec, the RF signal will be considered to have stopped.
#define SIGNAL_END_TIMEOUT_US 6000 // 5000 // After this time in uSec, the RF signal will be considered to have stopped.
#define SIGNAL_REPEAT_TIME_MS 250 // 500 // Time in mSec. in which the same RF signal should not be accepted again. Filters out retransmits.
#define SCAN_HIGH_TIME_MS 50 // 50 // time interval in ms. fast processing for background tasks

Expand Down Expand Up @@ -45,4 +45,4 @@ boolean ScanEvent(void);

void AC_Send(unsigned long data, byte cmd);

#endif
#endif
2 changes: 1 addition & 1 deletion RFLink/Plugins/Plugin_001.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ boolean Plugin_001(byte function, char *string)
if (j + 26 > RAW_BUFFER_SIZE - 1)
break; // cant be the packet we look for
//if ( (RawSignal.Pulses[j+26]*RawSignal.Multiply > 2500) && (RawSignal.Pulses[j+26]*RawSignal.Multiply < 3000) && (RawSignal.Pulses[j+26+26]*RawSignal.Multiply > 2500) ) { // first long delay found, make sure we have another at the right position
if ((RawSignal.Pulses[j + 26] > PULSE2500) && (RawSignal.Pulses[j + 26] < PULSE3000) && (RawSignal.Pulses[j + 26 + 26] > PULSE2500))
if ((RawSignal.Pulses[j + 26] > PULSE2500) && (RawSignal.Pulses[j + 26 + 26] > PULSE2500))
{ // first long delay found, make sure we have another at the right position
for (i = 0; i < 26; i++)
{
Expand Down
10 changes: 5 additions & 5 deletions RFLink/Plugins/Plugin_072.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* 20;31;DEBUG;Pulses=511;Pulses(uSec)=450,550,250,550,250,550,250,550,250,525,250,525,250,550,250,550,250,225,575,200,575,200,575,550,250,2825,250,550,250,550,250,550,250,550,250,550,250,550,250,525,250,525,250,200,575,225,575,200,575,550,250,2825,250,525,250,550,250,550,250,550,250,550,250,550,250,550,250,550,250,200,575,200,575,200,575,525,250,2825,250,550,250,550,250,525,250,550,250,550,250,550,250,550,250,550,250,200,575,200,575,200,575,525,250,2825,250,550,250,525,250,525,250,525,250,550,250,550,250,550,250,550,250,225,575,200,575,200,575,525,250,2825,250,550,250,525,250,525,250,525,250,525,250,550,250,550,250,550,250,200,575,200,575,225,575,550,250,2825,225,550,250,525,250,525,250,550,250,550,250,525,250,525,250,525,250,225,575,200,575,225,575,550,250,2850,250,550,250,550,250,550,250,525,250,525,250,525,250,550,250,550,250,225,575,200,575,225,575,550,250,2850,225,550,250,550,250,550,250,550,250,525,250,525,250,525,250,550,250,200,575,200,575,200,575,525,250,2825,250,550,250,550,250,550,250,550,250,550,250,550,250,525,250,525,250,200,575,200,575,200,575,550,250,2825,250,525,250,550,250,550,250,550,250,550,250,550,250,550,250,550,250,200,575,200,575,200,575,550,250,2825,250,550,250,525,250,525,250,525,250,550,250,550,250,550,250,550,250,200,575,200,575,200,575,525,250,2825,250,550,250,550,250,550,250,525,250,550,250,550,250,550,250,550,250,200,575,200,575,225,575,525,250,2825,250,550,250,550,250,525,250,525,250,550,250,550,250,525,250,525,250,200,575,225,575,225,575,550,250,2850,250,550,250,550,250,525,250,525,250,525,250,550,250,550,250,550,250,200,575,225,575,200,575,550,250,2850,250,550,250,550,250,550,250,550,250,525,250,525,250,550,250,550,250,225,575,225,575,200,575,550,250,2825,250,550,250,550,250,550,250,550,250,550,250,550,250,550,250,525,250,200,575,200,575,200,575,550,250,2825,250,525,250,550,250,550,250,550,250,550,250,550,250,550,250,525,250,200,575,200,575,200,575,550,250,2825,250,525,250,550,250,550,250,550,250,550,250,550,250,550,250,550,250,200,575,200,575,200,575,525,250,2825,250,550,250,550,250,525,250,525,250,525,250,550,250,550,250,550;
* 20;25;DEBUG;Pulses=26;Pulses(uSec)=250,550,250,550,250,550,250,550,250,550,250,550,250,525,250,525,250,200,575,225,575,200,575,550,250;
\*********************************************************************************************/
#define BYRON_PLUGIN_ID 072
#define BYRON_PLUGIN_ID 72
#define PLUGIN_DESC_072 "Byron SX"

#define BYRON_PULSECOUNT 26
Expand Down Expand Up @@ -58,11 +58,11 @@ boolean Plugin_072(byte function, char *string)
for (byte x = 2; x < BYRON_PULSECOUNT; x += 2)
{
bitstream <<= 1; // Always shift
if (RawSignal.Pulses[x] * RAWSIGNAL_SAMPLE_RATE < 350)
if (RawSignal.Pulses[x] * RAWSIGNAL_SAMPLE_RATE < 370)
{ // 200-275 (150-350 is accepted)
if (RawSignal.Pulses[x] * RAWSIGNAL_SAMPLE_RATE < 150)
return false; // pulse too short
if (RawSignal.Pulses[x + 1] * RAWSIGNAL_SAMPLE_RATE < 350)
if (RawSignal.Pulses[x + 1] * RAWSIGNAL_SAMPLE_RATE < 370)
return false; // bad manchester code
// bitstream |= 0x0;
}
Expand All @@ -72,7 +72,7 @@ boolean Plugin_072(byte function, char *string)
return false; // bad manchester code
if (RawSignal.Pulses[x] * RAWSIGNAL_SAMPLE_RATE < 450)
return false; // pulse too short
if (RawSignal.Pulses[x] * RAWSIGNAL_SAMPLE_RATE > 650)
if (RawSignal.Pulses[x] * RAWSIGNAL_SAMPLE_RATE > 700)
return false; // pulse too long
bitstream |= 0x1;
}
Expand All @@ -93,7 +93,7 @@ boolean Plugin_072(byte function, char *string)
// Output
//==================================================================================
display_Header();
display_Name(PSTR("Byron SX"));
display_Name(PSTR("Byron"));
display_IDn(((bitstream >> 4) & 0xFF), 4);
display_SWITCH(1);
display_CMD(CMD_Single, CMD_On); // #ALL #ON
Expand Down