rtl433  UNKNOWN
RTL-433 utility
digitech_xc0324.c File Reference

Decoder for Digitech XC-0324 temperature sensor. More...

Functions

static int decode_xc0324_message (r_device *decoder, bitbuffer_t *bitbuffer, unsigned row, uint16_t bitpos, const int latest_event, data_t **data)
 
static int xc0324_callback (r_device *decoder, bitbuffer_t *bitbuffer)
 Digitech XC-0324 device. More...
 

Variables

static const uint8_t preamble_pattern [1] = {XC0324_DEVICE_STARTBYTE}
 
static char * output_fields []
 
r_device digitech_xc0324
 

Detailed Description

Decoder for Digitech XC-0324 temperature sensor.

Copyright (C) 2018 Geoff Lee

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Function Documentation

◆ decode_xc0324_message()

static int decode_xc0324_message ( r_device decoder,
bitbuffer_t bitbuffer,
unsigned  row,
uint16_t  bitpos,
const int  latest_event,
data_t **  data 
)
static

◆ xc0324_callback()

static int xc0324_callback ( r_device decoder,
bitbuffer_t bitbuffer 
)
static

Digitech XC-0324 device.

The encoding is pulse position modulation (i.e. gap width contains the modulation information)

  • pulse is about 400 us
  • short gap is (approx) 520 us
  • long gap is (approx) 1000 us

Deciphered using two transmitters.

A transmission package is 148 bits (plus or minus one or two due to demodulation or transmission errors).

Each transmission contains 3 repeats of the 48 bit message, with 2 zero bits separating each repetition.

A 48 bit message consists of:

  • byte 0: preamble (for synchronisation), 0x5F
  • byte 1: device id
  • byte 2 and the first nibble of byte 3: encodes the temperature as a 12 bit integer, transmitted in least significant bit first order in tenths of degree Celsius offset from -40.0 degrees C (minimum temp spec of the device)
  • byte 4: constant (in all my data) 0x80 maybe a battery status ???
  • byte 5: a check byte (the XOR of bytes 0-4 inclusive) each bit is effectively a parity bit for correspondingly positioned bit in the real message

This decoder is associated with a tutorial entry in the rtl_433 wiki describing the way the transmissions were deciphered. See https://github.com/merbanan/rtl_433/wiki/digitech_xc0324.README.md

The tutorial is "by a newbie, for a newbie", ie intended to assist newcomers who wish to learn how to decipher a new device, and develop a rtl_433 device decoder from scratch for the first time.

To illustrate stages in the deciphering process, this decoder includes some debug style trace messages that would normally be removed. Specifically, running this decoder with debug level :

  • -vvv simulates what might be seen early in the deciphering process, when only the modulation scheme and parameters have been discovered,
  • -vv simulates what might be seen once the synchronisation/preamble and message length has been uncovered, and it is time to start work on deciphering individual fields in the message, with no debug flags set provides the final (production stage) results, and
  • -vvvv is a special "finished development" output. It provides a file of reference values, to be included with the test data for future regression test purposes.

References bitbuffer::bb, bitbuffer_search(), bitbuffer::bits_per_row, data_append(), DATA_INT, decode_xc0324_message(), decoder_output_bitbufferf(), decoder_output_bitrowf(), decoder_output_data(), decoder_output_messagef(), bitbuffer::num_rows, preamble_pattern, and r_device::verbose.

Variable Documentation

◆ digitech_xc0324

r_device digitech_xc0324
Initial value:
= {
.name = "Digitech XC-0324 temperature sensor",
.modulation = OOK_PULSE_PPM,
.short_width = 520,
.long_width = 1000,
.reset_limit = 3000,
.decode_fn = &xc0324_callback,
.disabled = 1,
.fields = output_fields,
}
Pulse Position Modulation. Short gap = 0, Long = 1.
Definition: r_device.h:12
static int xc0324_callback(r_device *decoder, bitbuffer_t *bitbuffer)
Digitech XC-0324 device.
Definition: digitech_xc0324.c:157
static char * output_fields[]
Definition: digitech_xc0324.c:147

◆ output_fields

char* output_fields[]
static
Initial value:
= {
"model",
"id",
"temperature_C",
"flags",
"mic",
"message_num",
NULL
}

◆ preamble_pattern

const uint8_t preamble_pattern[1] = {XC0324_DEVICE_STARTBYTE}
static

Referenced by xc0324_callback().