Fix Acurite-590TX timings (closes #3039)
This commit is contained in:
parent
d0142bb093
commit
f0ba153821
5 changed files with 32 additions and 36 deletions
|
@ -199,7 +199,7 @@ See [CONTRIBUTING.md](./docs/CONTRIBUTING.md).
|
||||||
[111] Emos TTX201 Temperature Sensor
|
[111] Emos TTX201 Temperature Sensor
|
||||||
[112] Ambient Weather TX-8300 Temperature/Humidity Sensor
|
[112] Ambient Weather TX-8300 Temperature/Humidity Sensor
|
||||||
[113] Ambient Weather WH31E Thermo-Hygrometer Sensor, EcoWitt WH40 rain gauge, WS68 weather station
|
[113] Ambient Weather WH31E Thermo-Hygrometer Sensor, EcoWitt WH40 rain gauge, WS68 weather station
|
||||||
[114] Maverick et73
|
[114] Maverick ET73
|
||||||
[115] Honeywell ActivLink, Wireless Doorbell
|
[115] Honeywell ActivLink, Wireless Doorbell
|
||||||
[116] Honeywell ActivLink, Wireless Doorbell (FSK)
|
[116] Honeywell ActivLink, Wireless Doorbell (FSK)
|
||||||
[117]* ESA1000 / ESA2000 Energy Monitor
|
[117]* ESA1000 / ESA2000 Energy Monitor
|
||||||
|
|
|
@ -340,7 +340,7 @@ convert si
|
||||||
protocol 111 # Emos TTX201 Temperature Sensor
|
protocol 111 # Emos TTX201 Temperature Sensor
|
||||||
protocol 112 # Ambient Weather TX-8300 Temperature/Humidity Sensor
|
protocol 112 # Ambient Weather TX-8300 Temperature/Humidity Sensor
|
||||||
protocol 113 # Ambient Weather WH31E Thermo-Hygrometer Sensor, EcoWitt WH40 rain gauge, WS68 weather station
|
protocol 113 # Ambient Weather WH31E Thermo-Hygrometer Sensor, EcoWitt WH40 rain gauge, WS68 weather station
|
||||||
protocol 114 # Maverick et73
|
protocol 114 # Maverick ET73
|
||||||
protocol 115 # Honeywell ActivLink, Wireless Doorbell
|
protocol 115 # Honeywell ActivLink, Wireless Doorbell
|
||||||
protocol 116 # Honeywell ActivLink, Wireless Doorbell (FSK)
|
protocol 116 # Honeywell ActivLink, Wireless Doorbell (FSK)
|
||||||
# protocol 117 # ESA1000 / ESA2000 Energy Monitor
|
# protocol 117 # ESA1000 / ESA2000 Energy Monitor
|
||||||
|
|
|
@ -1671,28 +1671,26 @@ static int acurite_606_decode(r_device *decoder, bitbuffer_t *bitbuffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Acurite 590TX temperature/humidity sensor
|
Acurite 590TX temperature/humidity sensor.
|
||||||
|
|
||||||
|
The signal is OOK PPM with pulses of 500 us.
|
||||||
|
There is a sync pulse with a 3000 us gap, then 24 bits with 500 us / 1500 us gaps.
|
||||||
|
There is no packet gap -- the sync pulse will look like the 25th bit with 500 us gap.
|
||||||
|
A transmission contains 14 repeats.
|
||||||
|
|
||||||
|
We'll read the packet after the sync and treat the next sync as a trailing 0 bit
|
||||||
|
|
||||||
*/
|
*/
|
||||||
static int acurite_590tx_decode(r_device *decoder, bitbuffer_t *bitbuffer)
|
static int acurite_590tx_decode(r_device *decoder, bitbuffer_t *bitbuffer)
|
||||||
{
|
{
|
||||||
uint8_t *b;
|
int row = bitbuffer_find_repeated_row(bitbuffer, 3, 25); // expected are min 3 rows
|
||||||
int row;
|
|
||||||
int sensor_id; // the sensor ID - basically a random number that gets reset whenever the battery is removed
|
|
||||||
int battery_ok; // the battery status: 1 is good, 0 is low
|
|
||||||
int channel;
|
|
||||||
int humidity;
|
|
||||||
int temp_raw; // temperature as read from the data packet
|
|
||||||
float temp_c; // temperature in C
|
|
||||||
|
|
||||||
row = bitbuffer_find_repeated_row(bitbuffer, 3, 25); // expected are min 3 rows
|
|
||||||
if (row < 0)
|
if (row < 0)
|
||||||
return DECODE_ABORT_EARLY;
|
return DECODE_ABORT_EARLY;
|
||||||
|
|
||||||
if (bitbuffer->bits_per_row[row] > 25)
|
if (bitbuffer->bits_per_row[row] > 25)
|
||||||
return DECODE_ABORT_LENGTH;
|
return DECODE_ABORT_LENGTH;
|
||||||
|
|
||||||
b = bitbuffer->bb[row];
|
uint8_t *b = bitbuffer->bb[row];
|
||||||
|
|
||||||
if (b[4] != 0) // last byte should be zero
|
if (b[4] != 0) // last byte should be zero
|
||||||
return DECODE_FAIL_SANITY;
|
return DECODE_FAIL_SANITY;
|
||||||
|
@ -1714,23 +1712,21 @@ static int acurite_590tx_decode(r_device *decoder, bitbuffer_t *bitbuffer)
|
||||||
return DECODE_FAIL_MIC;
|
return DECODE_FAIL_MIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Processing the temperature:
|
// the sensor ID - basically a random number that gets reset whenever the battery is removed
|
||||||
// Upper 4 bits are stored in nibble 1, lower 8 bits are stored in nibble 2
|
int sensor_id = b[0] & 0xFE; // first 6 bits and it changes each time it resets or change the battery
|
||||||
// upper 4 bits of nibble 1 are reserved for other usages (e.g. battery status)
|
int battery_ok = (b[0] & 0x01); // 1=ok, 0=low battery
|
||||||
sensor_id = b[0] & 0xFE; //first 6 bits and it changes each time it resets or change the battery
|
// upper 4 bits of byte 1 are parity and channel
|
||||||
battery_ok = (b[0] & 0x01); //1=ok, 0=low battery
|
int channel = (b[1] >> 4) & 0x03;
|
||||||
//next 2 bits are checksum
|
|
||||||
//next two bits are identify ID (maybe channel ?)
|
|
||||||
channel = (b[1] >> 4) & 0x03;
|
|
||||||
|
|
||||||
temp_raw = (int16_t)(((b[1] & 0x0F) << 12) | (b[2] << 4));
|
// Upper 4 temperature bits are stored in byte 1, lower 8 bits are stored in byte 2
|
||||||
temp_raw = temp_raw >> 4;
|
int temp_raw = (int16_t)(((b[1] & 0x0F) << 12) | (b[2] << 4));
|
||||||
temp_c = (temp_raw - 500) * 0.1f; // NOTE: there seems to be a 50 degree offset?
|
temp_raw = temp_raw >> 4; // sign-extend
|
||||||
|
float temp_c = (temp_raw - 500) * 0.1f; // a 50 degree offset
|
||||||
|
|
||||||
if (temp_raw >= 0 && temp_raw <= 100) // NOTE: no other way to differentiate humidity from temperature?
|
int humidity = -1;
|
||||||
|
if (temp_raw >= 0 && temp_raw <= 100) { // NOTE: no other way to differentiate humidity from temperature?
|
||||||
humidity = temp_raw;
|
humidity = temp_raw;
|
||||||
else
|
}
|
||||||
humidity = -1;
|
|
||||||
|
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
data_t *data = data_make(
|
data_t *data = data_make(
|
||||||
|
@ -2028,12 +2024,11 @@ r_device const acurite_00275rm = {
|
||||||
|
|
||||||
r_device const acurite_590tx = {
|
r_device const acurite_590tx = {
|
||||||
.name = "Acurite 590TX Temperature with optional Humidity",
|
.name = "Acurite 590TX Temperature with optional Humidity",
|
||||||
.modulation = OOK_PULSE_PPM, // OOK_PULSE_PWM,
|
.modulation = OOK_PULSE_PPM,
|
||||||
.short_width = 500, // short pulse is 232 us
|
.short_width = 500, // short gap is 500 us
|
||||||
.long_width = 1500, // long pulse is 420 us
|
.long_width = 1500, // long gap is 1500 us
|
||||||
.gap_limit = 1484, // long gap is 384 us, sync gap is 592 us
|
.gap_limit = 2000, // (preceeding) sync gap is 3000 us
|
||||||
.reset_limit = 3000, // no packet gap, sync gap is 592 us
|
.reset_limit = 3500, // no packet gap, sync gap is 500 us
|
||||||
.sync_width = 500, // sync pulse is 632 us
|
|
||||||
.decode_fn = &acurite_590tx_decode,
|
.decode_fn = &acurite_590tx_decode,
|
||||||
.fields = acurite_590_output_fields,
|
.fields = acurite_590_output_fields,
|
||||||
};
|
};
|
||||||
|
|
|
@ -99,7 +99,7 @@ static char const *const output_fields[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
r_device const maverick_et73 = {
|
r_device const maverick_et73 = {
|
||||||
.name = "Maverick et73",
|
.name = "Maverick ET73",
|
||||||
.modulation = OOK_PULSE_PPM,
|
.modulation = OOK_PULSE_PPM,
|
||||||
.short_width = 1050,
|
.short_width = 1050,
|
||||||
.long_width = 2050,
|
.long_width = 2050,
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
/** @fn int prologue_callback(r_device *decoder, bitbuffer_t *bitbuffer)
|
/** @fn int prologue_callback(r_device *decoder, bitbuffer_t *bitbuffer)
|
||||||
Prologue sensor protocol,
|
Prologue sensor protocol,
|
||||||
also FreeTec NC-7104 sensor for FreeTec Weatherstation NC-7102,
|
also FreeTec NC-7104 sensor for FreeTec Weatherstation NC-7102,
|
||||||
and Pearl NC-7159-675.
|
also Pearl NC-7159-675,
|
||||||
|
also TFA pool thermometer 30.3240.10 #2651
|
||||||
The sensor can be bought at Clas Ohlson.
|
The sensor can be bought at Clas Ohlson.
|
||||||
|
|
||||||
Note: this is a false positive for AlectoV1.
|
Note: this is a false positive for AlectoV1.
|
||||||
|
|
Loading…
Add table
Reference in a new issue