From 28eb6d7661eba30def86d9f009dbdf757fde03e9 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 25 Aug 2019 12:29:48 +0200 Subject: [PATCH] Integrate ibeacon --- sonoff/_changelog.ino | 1 + sonoff/my_user_config.h | 2 +- sonoff/sonoff_post.h | 4 ++++ sonoff/sonoff_template.h | 8 ++++---- sonoff/support_features.ino | 4 +++- tools/decode-status.py | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index cc9c497e4..0461160ae 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -2,6 +2,7 @@ * 6.6.0.6 20190819 * Add I2C display driver for SH1106 oled by Gerhard Mutz * Add SPI display drivers for epaper 4.2 inch, ILI9488 TFT, SSD1351 Color oled and RA8876 TFT by Gerhard Mutz + * Add support for HM17 bluetooth LE passive scan of ibeacon devices by Gerhard Mutz * * 6.6.0.5 20190816 * Add command WebSensor 0/1 to control display of sensor data in web GUI (#6085) diff --git a/sonoff/my_user_config.h b/sonoff/my_user_config.h index 33ba9327e..8e180a6f6 100644 --- a/sonoff/my_user_config.h +++ b/sonoff/my_user_config.h @@ -420,7 +420,7 @@ // #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) -#define USE_IBEACON // Add support for bluetooth LE passive scan of ibeacon devices (uses HM17 module) +//#define USE_IBEACON // Add support for bluetooth LE passive scan of ibeacon devices (uses HM17 module) // 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 33242128a..cccdabd5b 100644 --- a/sonoff/sonoff_post.h +++ b/sonoff/sonoff_post.h @@ -154,6 +154,7 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c //#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_IBEACON // Add support for bluetooth LE passive scan of ibeacon devices (uses HM17 module) #define USE_PZEM004T // Add support for PZEM004T Energy monitor (+2k code) #define USE_PZEM_AC // Add support for PZEM014,016 Energy monitor (+1k1 code) @@ -235,6 +236,7 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c #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_IBEACON // Disable support for bluetooth LE passive scan of ibeacon devices (uses HM17 module) #undef USE_PZEM004T // Disable PZEM004T energy sensor #undef USE_PZEM_AC // Disable PZEM014,016 Energy monitor @@ -376,6 +378,7 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c #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_IBEACON // Disable support for bluetooth LE passive scan of ibeacon devices (uses HM17 module) #undef USE_PZEM004T // Disable PZEM004T energy sensor #undef USE_PZEM_AC // Disable PZEM014,016 Energy monitor @@ -455,6 +458,7 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c #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_IBEACON // Disable support for bluetooth LE passive scan of ibeacon devices (uses HM17 module) #undef USE_PZEM004T // Disable PZEM004T energy sensor #undef USE_PZEM_AC // Disable PZEM014,016 Energy monitor diff --git a/sonoff/sonoff_template.h b/sonoff/sonoff_template.h index 2d763cb47..f83f488ad 100644 --- a/sonoff/sonoff_template.h +++ b/sonoff/sonoff_template.h @@ -634,6 +634,10 @@ const uint8_t kGpioNiceList[] PROGMEM = { #ifdef USE_RDM6300 GPIO_RDM6300_RX, #endif +#ifdef USE_IBEACON + GPIO_IBEACON_RX, + GPIO_IBEACON_TX, +#endif #ifdef USE_MGC3130 GPIO_MGC3130_XFER, GPIO_MGC3130_RESET, @@ -670,10 +674,6 @@ const uint8_t kGpioNiceList[] PROGMEM = { GPIO_SOLAXX1_TX, // Solax Inverter tx pin GPIO_SOLAXX1_RX, // Solax Inverter rx pin #endif -#ifdef USE_IBEACON - GPIO_IBEACON_RX, - GPIO_IBEACON_TX, -#endif }; const uint8_t kModuleNiceList[] PROGMEM = { diff --git a/sonoff/support_features.ino b/sonoff/support_features.ino index d0c33e24b..dfccdbd33 100644 --- a/sonoff/support_features.ino +++ b/sonoff/support_features.ino @@ -435,7 +435,9 @@ void GetFeatures(void) #ifdef USE_RDM6300 feature5 |= 0x00000002; // xsns_51_rdm6300.ino #endif -// feature5 |= 0x00000004; +#ifdef USE_IBEACON + feature5 |= 0x00000004; // xsns_52_ibeacon.ino +#endif // feature5 |= 0x00000008; // feature5 |= 0x00000010; diff --git a/tools/decode-status.py b/tools/decode-status.py index 25ff03723..973c8655c 100755 --- a/tools/decode-status.py +++ b/tools/decode-status.py @@ -160,7 +160,7 @@ a_features = [[ "USE_ADE7953","USE_SPS30","USE_VL53L0X","USE_MLX90614", "USE_MAX31865","USE_CHIRP","USE_SOLAX_X1","USE_PAJ7620" ],[ - "USE_BUZZER","USE_RDM6300","","", + "USE_BUZZER","USE_RDM6300","USE_IBEACON","", "","","","", "","","","", "","","","",