From 33aa430f6492983ce588997edab0aa7255691dcd Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 19 Aug 2019 11:47:59 +0200 Subject: [PATCH] Add support for RDM6300 125kHz RFID Reader by Gerhard Mutz Add support for RDM6300 125kHz RFID Reader by Gerhard Mutz --- sonoff/_changelog.ino | 1 + sonoff/my_user_config.h | 1 + sonoff/sonoff_post.h | 10 ++++++++++ sonoff/sonoff_template.h | 8 ++++---- sonoff/support_features.ino | 12 +++++++++--- sonoff/xdrv_01_webserver.ino | 4 ++-- tools/decode-status.py | 6 +++--- 7 files changed, 30 insertions(+), 12 deletions(-) diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index 0763e1b45..50b784f03 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -3,6 +3,7 @@ * Add command WebSensor 0/1 to control display of sensor data in web GUI (#6085) * Change some table locations from RAM to Flash * Fix wrong telemetry message when SetOption68 1 (#6191) + * Add support for RDM6300 125kHz RFID Reader by Gerhard Mutz * * 6.6.0.4 20190806 * Add support for CHIRP soil moisture sensor by Christian Baars diff --git a/sonoff/my_user_config.h b/sonoff/my_user_config.h index 5f18d20e2..869208675 100644 --- a/sonoff/my_user_config.h +++ b/sonoff/my_user_config.h @@ -414,6 +414,7 @@ // #define USE_PN532_CAUSE_EVENTS // Cause event execution for PN532_UID= and PN532_DATA=[if defined] (+ 30 bytes code) // #define USE_PN532_DATA_FUNCTION // Add sensor40 command support for erase, setting data block content (+1k7 code, 388 bytes mem) // #define USE_PN532_DATA_RAW // Allow DATA block to be used by non-alpha-numberic data (+ 80 bytes code, 48 bytes ram) +//#define USE_RDM6300 // Add support for RDM6300 125kHz RFID Reader (+0k8) // Power monitoring sensors ----------------------- #define USE_ENERGY_MARGIN_DETECTION // Add support for Energy Margin detection (+1k6 code) diff --git a/sonoff/sonoff_post.h b/sonoff/sonoff_post.h index 2e7a258b0..33242128a 100644 --- a/sonoff/sonoff_post.h +++ b/sonoff/sonoff_post.h @@ -153,6 +153,8 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c #define MP3_VOLUME 10 // Set the startup volume on init, the range can be 0..30(max) //#define USE_AZ7798 // Add support for AZ-Instrument 7798 CO2 datalogger #define USE_PN532_HSU // Add support for PN532 using HSU (Serial) interface (+1k8 code, 140 bytes mem) +#define USE_RDM6300 // Add support for RDM6300 125kHz RFID Reader (+0k8) + #define USE_PZEM004T // Add support for PZEM004T Energy monitor (+2k code) #define USE_PZEM_AC // Add support for PZEM014,016 Energy monitor (+1k1 code) #define USE_PZEM_DC // Add support for PZEM003,017 Energy monitor (+1k1 code) @@ -232,6 +234,8 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c #undef USE_MP3_PLAYER // Disable DFPlayer Mini MP3 Player RB-DFR-562 commands: play, volume and stop #undef USE_AZ7798 // Disable support for AZ-Instrument 7798 CO2 datalogger #undef USE_PN532_HSU // Disable support for PN532 using HSU (Serial) interface (+1k8 code, 140 bytes mem) +#undef USE_RDM6300 // Disable support for RDM6300 125kHz RFID Reader (+0k8) + #undef USE_PZEM004T // Disable PZEM004T energy sensor #undef USE_PZEM_AC // Disable PZEM014,016 Energy monitor #undef USE_PZEM_DC // Disable PZEM003,017 Energy monitor @@ -338,6 +342,7 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c #undef USE_MQTT_TLS // Disable TLS support won't work as the MQTTHost is not set #undef USE_KNX // Disable KNX IP Protocol Support //#undef USE_WEBSERVER // Disable Webserver +#undef USE_WEBSEND_RESPONSE // Disable command WebSend response message (+1k code) //#undef USE_EMULATION // Disable Wemo or Hue emulation #undef USE_CUSTOM // Disable Custom features #undef USE_DISCOVERY // Disable Discovery services for both MQTT and web server @@ -370,6 +375,8 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c #undef USE_MP3_PLAYER // Disable DFPlayer Mini MP3 Player RB-DFR-562 commands: play, volume and stop #undef USE_AZ7798 // Disable support for AZ-Instrument 7798 CO2 datalogger #undef USE_PN532_HSU // Disable support for PN532 using HSU (Serial) interface (+1k8 code, 140 bytes mem) +#undef USE_RDM6300 // Disable support for RDM6300 125kHz RFID Reader (+0k8) + #undef USE_PZEM004T // Disable PZEM004T energy sensor #undef USE_PZEM_AC // Disable PZEM014,016 Energy monitor #undef USE_PZEM_DC // Disable PZEM003,017 Energy monitor @@ -412,6 +419,7 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c #undef USE_MQTT_TLS // Disable TLS support won't work as the MQTTHost is not set #undef USE_KNX // Disable KNX IP Protocol Support //#undef USE_WEBSERVER // Disable Webserver +#undef USE_WEBSEND_RESPONSE // Disable command WebSend response message (+1k code) #undef USE_EMULATION // Disable Wemo or Hue emulation #undef USE_CUSTOM // Disable Custom features #undef USE_DISCOVERY // Disable Discovery services for both MQTT and web server @@ -446,6 +454,8 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c #undef USE_MP3_PLAYER // Disable DFPlayer Mini MP3 Player RB-DFR-562 commands: play, volume and stop #undef USE_AZ7798 // Disable support for AZ-Instrument 7798 CO2 datalogger #undef USE_PN532_HSU // Disable support for PN532 using HSU (Serial) interface (+1k8 code, 140 bytes mem) +#undef USE_RDM6300 // Disable support for RDM6300 125kHz RFID Reader (+0k8) + #undef USE_PZEM004T // Disable PZEM004T energy sensor #undef USE_PZEM_AC // Disable PZEM014,016 Energy monitor #undef USE_PZEM_DC // Disable PZEM003,017 Energy monitor diff --git a/sonoff/sonoff_template.h b/sonoff/sonoff_template.h index 92f1b7c2e..41b97eb40 100644 --- a/sonoff/sonoff_template.h +++ b/sonoff/sonoff_template.h @@ -628,6 +628,9 @@ const uint8_t kGpioNiceList[] PROGMEM = { GPIO_PN532_TXD, // PN532 HSU Tx GPIO_PN532_RXD, // PN532 HSU Rx #endif +#ifdef USE_RDM6300 + GPIO_RDM6300_RX, +#endif #ifdef USE_MGC3130 GPIO_MGC3130_XFER, GPIO_MGC3130_RESET, @@ -658,15 +661,12 @@ const uint8_t kGpioNiceList[] PROGMEM = { #endif #ifdef USE_HRE GPIO_HRE_CLOCK, - GPIO_HRE_DATA + GPIO_HRE_DATA, #endif #ifdef USE_SOLAX_X1 GPIO_SOLAXX1_TX, // Solax Inverter tx pin GPIO_SOLAXX1_RX, // Solax Inverter rx pin #endif -#ifdef USE_RDM6300 - GPIO_RDM6300_RX, -#endif }; const uint8_t kModuleNiceList[] PROGMEM = { diff --git a/sonoff/support_features.ino b/sonoff/support_features.ino index 15f4ad17c..d0c33e24b 100644 --- a/sonoff/support_features.ino +++ b/sonoff/support_features.ino @@ -418,8 +418,12 @@ void GetFeatures(void) #ifdef USE_CHIRP feature_sns2 |= 0x20000000; // xsns_48_chirp.ino #endif -// feature_sns2 |= 0x40000000; -// feature_sns2 |= 0x80000000; +#ifdef USE_SOLAX_X1 + feature_sns2 |= 0x40000000; // xsns_49_solaxX1.ino +#endif +#ifdef USE_PAJ7620 + feature_sns2 |= 0x80000000; // xsns_50_paj7620.ino +#endif /*********************************************************************************************/ @@ -428,7 +432,9 @@ void GetFeatures(void) #ifdef USE_BUZZER feature5 |= 0x00000001; // xdrv_24_buzzer.ino #endif -// feature5 |= 0x00000002; +#ifdef USE_RDM6300 + feature5 |= 0x00000002; // xsns_51_rdm6300.ino +#endif // feature5 |= 0x00000004; // feature5 |= 0x00000008; diff --git a/sonoff/xdrv_01_webserver.ino b/sonoff/xdrv_01_webserver.ino index 2d42815d4..9a30d8a95 100644 --- a/sonoff/xdrv_01_webserver.ino +++ b/sonoff/xdrv_01_webserver.ino @@ -2418,8 +2418,8 @@ extern uint8_t tasm_cmd_activ; // recursive call must be possible in this case tasm_cmd_activ=0; XdrvRulesProcess(); -#endif -#endif +#endif // USE_SCRIPT +#endif // USE_WEBSEND_RESPONSE } status = 0; // No error - Done } else { diff --git a/tools/decode-status.py b/tools/decode-status.py index 74e3ff012..25ff03723 100755 --- a/tools/decode-status.py +++ b/tools/decode-status.py @@ -158,9 +158,9 @@ a_features = [[ "USE_THEO_V2","USE_ALECTO_V2","USE_AZ7798","USE_MAX31855", "USE_PN532_I2C","USE_MAX44009","USE_SCD30","USE_HRE", "USE_ADE7953","USE_SPS30","USE_VL53L0X","USE_MLX90614", - "USE_MAX31865","USE_CHIRP","","" + "USE_MAX31865","USE_CHIRP","USE_SOLAX_X1","USE_PAJ7620" ],[ - "USE_BUZZER","","","", + "USE_BUZZER","USE_RDM6300","","", "","","","", "","","","", "","","","", @@ -201,7 +201,7 @@ else: obj = json.load(fp) def StartDecode(): - print ("\n*** decode-status.py v20190204 by Theo Arends and Jacek Ziolkowski ***") + print ("\n*** decode-status.py v20190819 by Theo Arends and Jacek Ziolkowski ***") # print("Decoding\n{}".format(obj))