Minor RTL_433 Tuning (#960)
* Update to SmartRC-CC1101-Driver-Lib@^2.5.4 and removal of workaround from #847 Tks to @LSatan workaround no longer needed https://github.com/LSatan/SmartRC-CC1101-Driver-Lib/issues/65 * Default to value as subject for rtl_433 and receiver switching * Default to not publishing unparsed signals * Fix for missing String for uint64_t * Fix is only required when value a subject is defined and not PiLight Co-authored-by: Northern Man <sgracey@Heisenberg.local>
This commit is contained in:
1 parent
18c8524ae0
commit
33fa1ca759
3 files changed
+40
-4
No files matched your search
@@ -28,6 +28,9 @@
|
||||
*/
|
||||
#include "User_config.h"
|
||||
#ifdef ZgatewayRTL_433
|
||||
# ifndef ZradioCC1101
|
||||
# error "CC1101 is the only supported receiver module for RTL_433 and needs to be enabled."
|
||||
# endif
|
||||
|
||||
# include <rtl_433_ESP.h>
|
||||
|
||||
|
||||
+30
-1
@@ -298,7 +298,7 @@ void pub(const char* topicori, JsonObject& data) {
|
||||
# else
|
||||
SIGNAL_SIZE_UL_ULL value = data["value"];
|
||||
if (value != 0) {
|
||||
topic = topic + "/" + String(value);
|
||||
topic = topic + "/" + toString(value);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
@@ -1783,3 +1783,32 @@ void MQTTtoSYS(char* topicOri, JsonObject& SYSdata) { // json object decoding
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(valueAsASubject) && !defined(ZgatewayPilight)
|
||||
# if defined(ESP32) || defined(ESP8266) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__)
|
||||
String toString(uint64_t input) {
|
||||
String result = "";
|
||||
uint8_t base = 10;
|
||||
|
||||
do {
|
||||
char c = input % base;
|
||||
input /= base;
|
||||
|
||||
if (c < 10)
|
||||
c += '0';
|
||||
else
|
||||
c += 'A' - 10;
|
||||
result = c + result;
|
||||
} while (input);
|
||||
return result;
|
||||
}
|
||||
|
||||
# else
|
||||
|
||||
String toString(uint32_t input) {
|
||||
String result = String(input);
|
||||
|
||||
return result;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
+7
-3
@@ -120,7 +120,7 @@ smartrc-cc1101-driver-lib = SmartRC-CC1101-Driver-Lib@2.5.5
|
||||
stl = https://github.com/mike-matera/ArduinoSTL.git#7411816
|
||||
shtc3 = https://github.com/sparkfun/SparkFun_SHTC3_Arduino_Library
|
||||
somfy_remote=Somfy_Remote_Lib@0.3.0
|
||||
rtl_433_ESP = https://github.com/NorthernMan54/rtl_433_ESP#38ee89a
|
||||
rtl_433_ESP = https://github.com/NorthernMan54/rtl_433_ESP#e03f689
|
||||
emodbus = miq19/eModbus@1.0.0
|
||||
gfSunInverter = https://github.com/BlackSmith/GFSunInverter.git#v1.0.1
|
||||
|
||||
@@ -561,8 +561,11 @@ build_flags =
|
||||
'-DZradioCC1101="CC1101"'
|
||||
'-DZgatewayRTL_433="rtl_433"'
|
||||
'-DGateway_Name="OpenMQTTGateway_rtl_433_ESP"'
|
||||
'-DRF_RECEIVER_GPIO=4'
|
||||
; '-DRTL_DEBUG=4' ; enable rtl_433 verbose device decode
|
||||
'-DRF_RECEIVER_GPIO=4' ; CC1101 - GDO2
|
||||
'-DRF_EMITTER_GPIO=2' ; CC1101 - GDO0
|
||||
'-DvalueAsASubject=true' ; mqtt topic includes model and device
|
||||
; '-DPUBLISH_UNPARSED=true' ; Publish details of undecoded signals
|
||||
; '-DRTL_DEBUG=4' ; enable rtl_433 verbose device decode
|
||||
|
||||
[env:esp32dev-multi_receiver]
|
||||
platform = ${com.esp32_platform}
|
||||
@@ -585,6 +588,7 @@ build_flags =
|
||||
'-DGateway_Name="OpenMQTTGateway_multi_receiver"'
|
||||
'-DRF_RECEIVER_GPIO=4' ; CC1101 - GDO2
|
||||
'-DRF_EMITTER_GPIO=2' ; CC1101 - GDO0
|
||||
'-DvalueAsASubject=true' ; mqtt topic includes model and device (rtl_433) or protocol and id ( RF and PiLight )
|
||||
; '-DDEFAULT_RECEIVER=1' ; Default receiver to enable on startup
|
||||
|
||||
[env:ttgo-lora32-v1]
|
||||
|
||||
Reference in new issue
Block a user