Skip to content

Instantly share code, notes, and snippets.

View jtopper's full-sized avatar

Jon Topper jtopper

View GitHub Profile

Title

pulse_detect minmax: genuine OOK packages can be misclassified and discarded as FSK

Summary

pulse_detect_package()'s PD_OOK_STATE_GAP_START handling (src/pulse_detect.c) reclassifies an in-progress OOK package as FSK — discarding it entirely — the moment the parallel FSK minmax tracker's fsk_pulses accumulates more than PD_MIN_PULSES (16, include/pulse_data.h:22) "pulses". This is meant to hand fast-moving FSK signals off to the FSK path early. But the FSK minmax tracker is structurally noisy: it re-slices on every sample and erodes its adaptive window continuously, so a strong or nearby OOK signal's sharp edges can trip the same threshold well before the genuine OOK package is anywhere near done. When that happens, the real OOK package is silently thrown away and reclassified as FSK — and since it isn't actually FSK-modulated data, no decoder recognizes it either. The device just goes silent, with nothing in the logs to point at why.

Found while running two device families thr

Keybase proof

I hereby claim:

  • I am jtopper on github.
  • I am jtopper (https://keybase.io/jtopper) on keybase.
  • I have a public key whose fingerprint is C185 4653 CFD9 D11F 6FA9 8733 C4F9 2C8E C8C7 ECFE

To claim this, I am signing this object:

@jtopper
jtopper / gist:8667226
Last active January 4, 2016 19:29
Autocomplete known ssh hosts and filenames when using ssh or scp
# Add this to .profile or .bashrc
_complete_ssh() {
local cur=${COMP_WORDS[COMP_CWORD]}
local hosts=$(awk -F'[ ,]' '{ print $1 }' ~/.ssh/known_hosts | sort -u)
COMPREPLY=( $(compgen -W "${hosts}" -- ${cur}) )
}
complete -o default -F _complete_ssh ssh scp
@jtopper
jtopper / gist:8588263
Last active December 29, 2024 17:29
Add a new disk to a VMWare vagrant box
config.vm.provider :vmware_fusion do |vm|
vdiskmanager = '/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager'
dir = "#{ENV['HOME']}/vagrant-additional-disk"
unless File.directory?( dir )
Dir.mkdir dir
end
@jtopper
jtopper / gist:2712295
Created May 16, 2012 17:12
Should this be legal?
define sf_apache::firewall_allow::service ( $source ) {
firewall { "080 ${title}":
require => Class["sf_apache::config"],
proto => 'tcp',
dport => $sf_apache::config::httpd_config['Port'],
source => $source
}
}
@jtopper
jtopper / gist:2711679
Created May 16, 2012 16:06
lolcurrying
class sf_apache::params {
$fw_name_service = '0080 apache service'
}
class sf_apache::config ( $httpd_config ) {
include sf_apache::params
@firewall { $sf_apache::params::fw_name_service: