Skip to content

Commit

Permalink
Refresh to rtl_433 24.10 (#161)
Browse files Browse the repository at this point in the history
* Built

* Working
  • Loading branch information
NorthernMan54 authored Nov 29, 2024
1 parent 3fdcdd6 commit 91bd22a
Show file tree
Hide file tree
Showing 186 changed files with 6,999 additions and 2,261 deletions.
351 changes: 186 additions & 165 deletions README.md

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions example/OOK_Receiver/boards/lilygo-lora32-v21-433.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"build": {
"arduino": {
"ldscript": "esp32_out.ld"
},
"core": "esp32",
"extra_flags": [
"-D ARDUINO_TTGO_LoRa32_v21new"
],
"f_cpu": "240000000L",
"f_flash": "40000000L",
"flash_mode": "dio",
"hwids": [
[
"0x1A86",
"0x55D4"
]
],
"mcu": "esp32",
"variant": "ttgo-lora32-v21new"
},
"connectivity": ["wifi", "bluetooth", "ethernet", "can"],
"debug": {
"openocd_board": "esp-wroom-32.cfg"
},
"frameworks": ["arduino", "espidf"],
"name": "LoRa32 V2.1_1.6 ESP32 433MHZ 0.96 Inch OLED SD Card WIFI Module",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 460800
},
"url": "https://lilygo.cc/products/lora3?variant=42476923879605",
"vendor": "LilyGo"
}
12 changes: 6 additions & 6 deletions example/OOK_Receiver/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
default_envs = esp32_lilygo
;default_envs = esp32c3_cdc_cc1101
src_dir = .
boards_dir = boards

[libraries]
arduinolog = https://github.com/1technophile/Arduino-Log.git#d13cd80
Expand Down Expand Up @@ -198,12 +199,12 @@ upload_port = /dev/cu.SLAB_USBtoUART
upload_speed = 921600

[env:esp32_lilygo]
board = ttgo-lora32-v21 ; ~/.platformio/packages/framework-arduinoespressif32/variants/.../pins_arduino.h
board = lilygo-lora32-v21-433
build_flags =
'-DLOG_LEVEL=LOG_LEVEL_TRACE'
'-DONBOARD_LED=LED_BUILTIN' ; Onboard LED is GPIO 25 on the Heltec Board
; *** rtl_433_ESP Options ***
; '-DRTL_DEBUG=4' ; rtl_433 verbose mode
; '-DRTL_DEBUG' ; rtl_433 verbose mode
; '-DRTL_VERBOSE=19' ; LaCrosse TX141-Bv2, TX141TH-Bv2, TX141-Bv3, TX141W, TX145wsdth sensor
; '-DRTL_ANALYZER=true'
; '-DRAW_SIGNAL_DEBUG=true' ; display raw received messages
Expand Down Expand Up @@ -238,9 +239,9 @@ build_flags =
;'-DsetFrequencyDeviation'
;'-DsetRxBW'

monitor_port = /dev/cu.wchusbserial543502851101

monitor_speed = 921600
upload_port = /dev/cu.wchusbserial543502851101

upload_speed = 921600

[env:esp32doitv1_r01]
Expand Down Expand Up @@ -275,7 +276,6 @@ build_flags =
; *** RadioLib Options ***
'-DRADIOLIB_DEBUG=true'
; '-DRADIOLIB_VERBOSE=true'
monitor_port = /dev/cu.usbserial-0001

monitor_speed = 921600
upload_port = /dev/cu.usbserial-0001
upload_speed = 921600
29 changes: 15 additions & 14 deletions include/util.h → include/bit_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,11 @@
(at your option) any later version.
*/

#ifndef INCLUDE_UTIL_H_
#define INCLUDE_UTIL_H_
#ifndef INCLUDE_BIT_UTIL_H_
#define INCLUDE_BIT_UTIL_H_

#include <stdint.h>

// Helper macros, collides with MSVC's stdlib.h unless NOMINMAX is used
#ifndef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif

/// Reverse (reflect) the bits in an 32 bit byte.
///
/// @param x input byte
Expand Down Expand Up @@ -60,7 +52,7 @@ void reflect_nibbles(uint8_t message[], unsigned num_bytes);
/// @param num_bits message length in bits
/// @param dst target buffer for extracted nibbles, at least num_bits/5 size
/// @return number of successfully unstuffed nibbles.
unsigned extract_nibbles_4b1s(uint8_t *message, unsigned offset_bits, unsigned num_bits, uint8_t *dst);
unsigned extract_nibbles_4b1s(uint8_t const *message, unsigned offset_bits, unsigned num_bits, uint8_t *dst);

/// UART "8n1" (10-to-8) decoder with 1 start bit (0), no parity, 1 stop bit (1), LSB-first bit-order.
///
Expand All @@ -69,7 +61,16 @@ unsigned extract_nibbles_4b1s(uint8_t *message, unsigned offset_bits, unsigned n
/// @param num_bits message length in bits
/// @param dst target buffer for extracted bytes, at least num_bits/10 size
/// @return number of successful decoded bytes
unsigned extract_bytes_uart(uint8_t *message, unsigned offset_bits, unsigned num_bits, uint8_t *dst);
unsigned extract_bytes_uart(uint8_t const *message, unsigned offset_bits, unsigned num_bits, uint8_t *dst);

/// UART "8o1" (11-to-8) decoder with 1 start bit (1), odd parity, 1 stop bit (0), MSB-first bit-order.
///
/// @param message bytes of message data
/// @param offset_bits start offset of message in bits
/// @param num_bits message length in bits
/// @param dst target buffer for extracted bytes, at least num_bits/11 size
/// @return number of successful decoded bytes
unsigned extract_bytes_uart_parity(uint8_t const *message, unsigned offset_bits, unsigned num_bits, uint8_t *dst);

/// Decode symbols to bits.
///
Expand All @@ -81,7 +82,7 @@ unsigned extract_bytes_uart(uint8_t *message, unsigned offset_bits, unsigned num
/// @param sync symbol for sync bit, ignored at start, terminates at end
/// @param dst target buffer for extracted bits, at least num_bits/symbol_x_len size
/// @return number of successful decoded bits
unsigned extract_bits_symbols(uint8_t *message, unsigned offset_bits, unsigned num_bits, uint32_t zero, uint32_t one, uint32_t sync, uint8_t *dst);
unsigned extract_bits_symbols(uint8_t const *message, unsigned offset_bits, unsigned num_bits, uint32_t zero, uint32_t one, uint32_t sync, uint8_t *dst);

/// CRC-4.
///
Expand Down Expand Up @@ -204,4 +205,4 @@ int add_bytes(uint8_t const message[], unsigned num_bytes);
/// @return summation value
int add_nibbles(uint8_t const message[], unsigned num_bytes);

#endif /* INCLUDE_UTIL_H_ */
#endif /* INCLUDE_BIT_UTIL_H_ */
23 changes: 23 additions & 0 deletions include/c_util.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/** @file
General C language utility macro.
Copyright (C) 2018 Christian W. Zuckschwerdt <[email protected]>
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.
*/

#ifndef INCLUDE_C_UTIL_H_
#define INCLUDE_C_UTIL_H_

// Helper macros, collides with MSVC's stdlib.h unless NOMINMAX is used
#ifndef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif

#endif /* INCLUDE_C_UTIL_H_ */
39 changes: 39 additions & 0 deletions include/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,46 @@ R_API data_t *data_append(data_t *first, const char *key,
*/
R_API data_t *data_prepend(data_t *first, const char *key,
const char *pretty_key, ...);
/** Adds to a structured data object, by appending `int` data.
Type-safe alternative to `data_make()` and `data_append()`.
*/
R_API data_t *data_int(data_t *first, char const *key, char const *pretty_key, char const *format, int val);

/** Adds to a structured data object, by appending `double` data.
Type-safe alternative to `data_make()` and `data_append()`.
*/
R_API data_t *data_dbl(data_t *first, char const *key, char const *pretty_key, char const *format, double val);

/** Adds to a structured data object, by appending string data.
Type-safe alternative to `data_make()` and `data_append()`.
*/
R_API data_t *data_str(data_t *first, char const *key, char const *pretty_key, char const *format, char const *val);

/** Adds to a structured data object, by appending `data_array_t` data.
Type-safe alternative to `data_make()` and `data_append()`.
*/
R_API data_t *data_ary(data_t *first, char const *key, char const *pretty_key, char const *format, data_array_t *val);

/** Adds to a structured data object, by appending `data_t` data.
Type-safe alternative to `data_make()` and `data_append()`.
*/
R_API data_t *data_dat(data_t *first, char const *key, char const *pretty_key, char const *format, data_t *val);

/** Adds to a structured data object, by appending hex string data.
Type-safe alternative to `data_make()` and `data_append()`.
If `format` is NULL or empty then a default of "%02x" is used.
Caller needs to provide a sufficiently sized buffer.
*/
typedef unsigned char uint8_t;
R_API data_t *data_hex(data_t *first, char const *key, char const *pretty_key, char const *format, uint8_t const *val, unsigned len, char *buf);
/** Constructs an array from given data of the given uniform type.
@param num_values The number of values to be copied.
Expand Down
3 changes: 2 additions & 1 deletion include/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#include "r_device.h"
#include "bitbuffer.h"
#include "data.h"
#include "util.h"
#include "c_util.h"
#include "bit_util.h"
#include "decoder_util.h"

#endif /* INCLUDE_DECODER_H_ */
2 changes: 1 addition & 1 deletion include/decoder_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void decoder_logf(r_device *decoder, int level, char const *func, _Printf_format

/// Output a log message with the content of the bitbuffer.
void decoder_log_bitbuffer(r_device *decoder, int level, char const *func, const bitbuffer_t *bitbuffer, char const *msg);

int decoder_verbose(r_device *decoder);
/// Output a formatted log message with the content of the bitbuffer.
void decoder_logf_bitbuffer(r_device *decoder, int level, char const *func, const bitbuffer_t *bitbuffer, _Printf_format_string_ const char *format, ...)
#if defined(__GNUC__) || defined(__clang__)
Expand Down
2 changes: 1 addition & 1 deletion include/r_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
The line code is a coding of the bitstream data and referred to as the Coding of the data.
We however use the well known terms to refer to the combinations of this.
E.g. the term PWM is well known as anlog or discrete range modulation, but here used
E.g. the term PWM is well known as analog or discrete range modulation, but here used
to refer to a binary Coding of bits to on and off states (or mark and space) of the carrier.
It should be thought of as Pulse-Width-Coding, then modulated on OOK or FSK.
I.e. it is not truly Pulse-Width-Modulation but Pulse-Width-Coding then OOK or FSK modulation.
Expand Down
37 changes: 32 additions & 5 deletions include/rtl_433_devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
DECL(ambientweather_tx8300) \
DECL(ambientweather_wh31e) \
DECL(ant_antplus) \
DECL(arad_ms_meter) \
DECL(archos_tbh) \
DECL(arexx_ml) \
DECL(atech_ws308) \
DECL(auriol_4ld5661) \
DECL(auriol_aft77b2) \
Expand All @@ -39,13 +41,16 @@
DECL(bresser_5in1) \
DECL(bresser_6in1) \
DECL(bresser_7in1) \
DECL(bresser_leakage) \
DECL(bresser_lightning) \
DECL(bt_rain) \
DECL(burnhardbbq) \
DECL(calibeur_RF104) \
DECL(cardin) \
DECL(cavius) \
DECL(ced7000) \
DECL(celsia_czc1) \
DECL(chamberlain_cwpirc) \
DECL(chuango) \
DECL(cmr113) \
DECL(companion_wtr001) \
Expand Down Expand Up @@ -82,19 +87,24 @@
DECL(fineoffset_WH51) \
DECL(fineoffset_WH0530) \
DECL(fineoffset_wh1050) \
DECL(tfa_303151) \
DECL(fineoffset_wh1080) \
DECL(fineoffset_wh1080_fsk) \
DECL(fineoffset_wh31l) \
DECL(fineoffset_wh45) \
DECL(fineoffset_wh46) \
DECL(fineoffset_wh55) \
DECL(fineoffset_wn34) \
DECL(fineoffset_ws80) \
DECL(fineoffset_ws90) \
DECL(flowis) \
DECL(fordremote) \
DECL(fs20) \
DECL(ft004b) \
DECL(funkbus_remote) \
DECL(gasmate_ba1008) \
DECL(ge_coloreffects) \
DECL(geevon) \
DECL(generic_motion) \
DECL(generic_remote) \
DECL(generic_temperature_sensor) \
Expand Down Expand Up @@ -153,6 +163,7 @@
DECL(mebus433) \
DECL(megacode) \
DECL(missil_ml0757) \
DECL(mueller_hotrod) \
DECL(neptune_r900) \
DECL(new_template) \
DECL(newkaku) \
Expand Down Expand Up @@ -181,11 +192,14 @@
DECL(regency_fan) \
DECL(revolt_nc5462) \
DECL(rftech) \
DECL(risco_agility) \
DECL(rojaflex) \
DECL(rosstech_dcu706) \
DECL(rubicson) \
DECL(rubicson_48659) \
DECL(rubicson_pool_48942) \
DECL(s3318p) \
DECL(schou_72543_rain) \
DECL(schraeder) \
DECL(schrader_EG53MA4) \
DECL(schrader_SMD3MA4) \
Expand Down Expand Up @@ -213,9 +227,16 @@
DECL(tfa_twin_plus_303049) \
DECL(thermopro_tp11) \
DECL(thermopro_tp12) \
DECL(thermopro_tp28b) \
DECL(thermopro_tp828b) \
DECL(thermopro_tp829b) \
DECL(thermopro_tx2) \
DECL(thermopro_tx2c) \
DECL(thermor) \
DECL(tpms_abarth124) \
DECL(tpms_ave) \
DECL(tpms_bmw) \
DECL(tpms_bmwg3) \
DECL(tpms_citroen) \
DECL(tpms_eezrv) \
DECL(tpms_elantra2012) \
Expand All @@ -224,6 +245,7 @@
DECL(tpms_jansite) \
DECL(tpms_jansite_solar) \
DECL(tpms_kia) \
DECL(tpms_nissan) \
DECL(tpms_pmv107j) \
DECL(tpms_porsche) \
DECL(tpms_renault) \
Expand All @@ -235,7 +257,9 @@
DECL(ttx201) \
DECL(vaillant_vrt340f) \
DECL(vauno_en8822c) \
DECL(vevor_7in1) \
DECL(visonic_powercode) \
DECL(watts_thermostat) \
DECL(waveman) \
DECL(wec2103) \
DECL(wg_pb12v1) \
Expand All @@ -247,18 +271,21 @@
DECL(x10_sec) \
DECL(yale_hsa) \
/* Add new decoders here. */
# define NUMOF_OOK_DEVICES 157
# define NUMOF_FSK_DEVICES 80
# define NUMOF_OOK_DEVICES 164
# define NUMOF_FSK_DEVICES 97
/* Add new decoders here. */
#else
/**
* Subset of devices that I have access to and have tested with
*/
# define DEVICES \
DECL(lacrosse_tx141x) \
DECL(acurite_986) \
DECL(skylink_motion) \
DECL(prologue) \
DECL(philips_aj3650) \
DECL(fineoffset_WH51) \
/* Add new personal decoders here. */
# define NUMOF_OOK_DEVICES 1
# define NUMOF_FSK_DEVICES 0
# define NUMOFDEVICES 5
#endif

#define DECL(name) extern r_device name;
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "git",
"url": "https://github.com/NorthernMan54/rtl_433_ESP.git"
},
"version": "0.3.2",
"version": "0.4.0",
"license": "GPL-3.0",
"frameworks": "arduino",
"platforms": [
Expand Down
Loading

0 comments on commit 91bd22a

Please sign in to comment.