From b62b82f8144a8df53daea45f6ad68c0577fcda0d Mon Sep 17 00:00:00 2001 From: Florian <1technophile@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:54:57 -0500 Subject: [PATCH] [BOARDS] Remove Arduino boards --- .github/workflows/build.yml | 3 - README.md | 2 +- docs/README.md | 2 +- docs/integrate/aws_iot.md | 13 +--- docs/prerequisites/board.md | 2 +- docs/setitup/ir.md | 1 - docs/setitup/rf.md | 1 - docs/setitup/rs232.md | 1 - docs/use/ir.md | 6 +- environments.ini | 80 ------------------- main/User_config.h | 46 +++-------- main/ZactuatorFASTLED.ino | 2 +- main/ZactuatorONOFF.ino | 4 +- main/ZactuatorPWM.ino | 2 +- main/ZactuatorSomfy.ino | 4 +- main/Zblufi.ino | 2 +- main/ZboardM5.ino | 4 +- main/ZcommonRF.ino | 111 ++++++++++++-------------- main/ZdisplaySSD1306.ino | 2 +- main/Zgateway2G.ino | 4 +- main/ZgatewayBT.ino | 6 +- main/ZgatewayGFSunInverter.ino | 2 +- main/ZgatewayIR.ino | 2 +- main/ZgatewayLORA.ino | 2 +- main/ZgatewayPilight.ino | 2 +- main/ZgatewayRF.ino | 4 +- main/ZgatewayRF2.ino | 6 +- main/ZgatewayRFM69.ino | 2 +- main/ZgatewayRS232.ino | 2 +- main/ZgatewayRTL_433.ino | 2 +- main/ZgatewaySRFB.ino | 4 +- main/ZgatewayWeatherStation.ino | 2 +- main/ZmqttDiscovery.ino | 2 +- main/ZsensorADC.ino | 4 +- main/ZsensorAHTx0.ino | 4 +- main/ZsensorBH1750.ino | 4 +- main/ZsensorBME280.ino | 2 +- main/ZsensorC37_YL83_HMRD.ino | 2 +- main/ZsensorDHT.ino | 4 +- main/ZsensorDS1820.ino | 2 +- main/ZsensorGPIOInput.ino | 4 +- main/ZsensorGPIOKeyCode.ino | 4 +- main/ZsensorHCSR04.ino | 4 +- main/ZsensorHCSR501.ino | 4 +- main/ZsensorHTU21.ino | 4 +- main/ZsensorINA226.ino | 4 +- main/ZsensorLM75.ino | 2 +- main/ZsensorMQ2.ino | 4 +- main/ZsensorRN8209.ino | 2 +- main/ZsensorTEMT6000.ino | 4 +- main/ZsensorTSL2561.ino | 4 +- main/ZsensorTouch.ino | 4 +- main/ZwebUI.ino | 4 +- main/config_2G.h | 4 +- main/config_ADC.h | 4 +- main/config_AHTx0.h | 4 +- main/config_BH1750.h | 4 +- main/config_BME280.h | 4 +- main/config_BT.h | 4 +- main/config_C37_YL83_HMRD.h | 2 +- main/config_DHT.h | 4 +- main/config_DS1820.h | 2 +- main/config_FASTLED.h | 2 +- main/config_GFSunInverter.h | 2 +- main/config_GPIOInput.h | 4 +- main/config_GPIOKeyCode.h | 4 +- main/config_HCSR04.h | 4 +- main/config_HCSR501.h | 4 +- main/config_HTU21.h | 4 +- main/config_INA226.h | 4 +- main/config_IR.h | 21 +---- main/config_LM75.h | 2 +- main/config_LORA.h | 4 +- main/config_M5.h | 4 +- main/config_MQ2.h | 4 +- main/config_ONOFF.h | 4 +- main/config_PWM.h | 2 +- main/config_RF.h | 10 +-- main/config_RFM69.h | 2 +- main/config_RN8209.h | 4 +- main/config_RS232.h | 10 +-- main/config_SHTC3.h | 4 +- main/config_SRFB.h | 4 +- main/config_SSD1306.h | 2 +- main/config_Somfy.h | 4 +- main/config_TEMT6000.h | 4 +- main/config_TSL2561.h | 4 +- main/config_Touch.h | 4 +- main/config_WeatherStation.h | 6 +- main/config_WebContent.h | 2 +- main/config_WebUI.h | 4 +- main/config_mqttDiscovery.h | 2 +- main/main.ino | 133 +++++++++++++------------------- platformio.ini | 1 - 94 files changed, 246 insertions(+), 455 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be63114941..f6d1a5bd06 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,9 +70,6 @@ jobs: - "nodemcuv2-weatherstation" - "sonoff-basic" - "sonoff-basic-rfr3" - - "atmega-all-test" - - "uno-rf" - - "uno-fastled" - "esp32dev-ble-datatest" - "esp32s3-dev-c1-ble" - "esp32c3-dev-m1-ble" diff --git a/README.md b/README.md index 2764fa9bb1..fb0de78d2b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The reference sheet, with the list of all functions, pinouts is [here](https://d ## Upload -Upload OpenMQTTGateway directly from the [upload page](https://docs.openmqttgateway.com/upload/web-install.html) (no additional software required) or [build your own configuration](https://docs.openmqttgateway.com/upload/builds.html) with [PlatformIO](https://platformio.org/) or [Arduino IDE](https://www.arduino.cc/en/software) +Upload OpenMQTTGateway directly from the [upload page](https://docs.openmqttgateway.com/upload/web-install.html) (no additional software required) or [build your own configuration](https://docs.openmqttgateway.com/upload/builds.html) with [PlatformIO](https://platformio.org/). ## Using OpenMQTTGateway ? Support open-source development through sponsorship and gain exclusive access to our private forum. Your questions, issues, and feature requests will receive priority attention, plus you'll gain insider access to our roadmap. diff --git a/docs/README.md b/docs/README.md index adf9a8c445..7b8fcb9f88 100644 --- a/docs/README.md +++ b/docs/README.md @@ -23,7 +23,7 @@ OpenMQTTGateway integrates with established technologies, such as 433mhz/315mhz To have an overview of the supported PIR, door, water, temperature, smoke sensors, sirens, rings, beacons, switches & weather stations you can take a look to the [compatible devices list](https://compatible.openmqttgateway.com/index.php/devices) -You can run OpenMQTTGateway on a wide variety of [boards](https://compatible.openmqttgateway.com/index.php/boards/), ESP32, ESP8266, Arduino MEGA, UNO (with limitation). +You can run OpenMQTTGateway on a wide variety of [boards](https://compatible.openmqttgateway.com/index.php/boards/), ESP32, ESP8266, ESP32S3, ESP32C3. BLE to MQTT gateway can also run on Raspberry Pi, Windows or Unix computers thanks to [Theengs Gateway](https://theengs.github.io/gateway/). Using MQTT, you can seamlessly integrate with home automation platforms such as OpenHAB, Home Assistant, and others, or with IoT software like Node-Red. diff --git a/docs/integrate/aws_iot.md b/docs/integrate/aws_iot.md index 0885cdae24..b77c318a75 100644 --- a/docs/integrate/aws_iot.md +++ b/docs/integrate/aws_iot.md @@ -78,18 +78,7 @@ Now you should have the following information for the OpenMQTTGateway configurat ## Modify OpenMQTTGateway configuration -With Arduino IDE, you can update the following field into User_config.h with the information gathered: -* Gateway_Name -* `MQTT_SERVER "xxxxxx.iot-eu-amazonaws.com"` -* `MQTT_PORT "8883"` -* `AWS_IOT true` -* ss_server_cert with the root certificate -* ss_client_cert with the client certificate -* ss_client_key with the Client key -* `MQTT_SECURE_SELF_SIGNED 1` -* `MQTT_SECURE_DEFAULT true` - -With PlatformIO you can directly leverage the environment `esp32dev-ble-aws` +With PlatformIO you can directly leverage the environment `esp32dev-ble-aws` as an example and modify it following your needs. ## Build and upload diff --git a/docs/prerequisites/board.md b/docs/prerequisites/board.md index ee80e6bf98..3ece66cbae 100644 --- a/docs/prerequisites/board.md +++ b/docs/prerequisites/board.md @@ -1,6 +1,6 @@ # Boards -OpenMQTTGateway is not closed to one board or type of board, by using the power of the Arduino framework and libraries that are cross compatibles it let you many choice of hardware, from an Arduino UNO to an ESP32. +OpenMQTTGateway is not closed to one board or type of board, by using the power of the Arduino framework and libraries that are cross compatibles it let you many choice of hardware, from an ESP8266 to an ESP32. You can take a look to the [OpenMQTTGateway compatible website](https://compatible.openmqttgateway.com) to have a view of the [supported boards](https://compatible.openmqttgateway.com/index.php/boards/). diff --git a/docs/setitup/ir.md b/docs/setitup/ir.md index 3f7ecca2a4..fa2fcf628f 100644 --- a/docs/setitup/ir.md +++ b/docs/setitup/ir.md @@ -13,7 +13,6 @@ The IR setup can work with bc547 and a 4x3 LED-Matrix. ## Pinout |Board| Receiver Pin| Emitter Pin| |-|:-:|:-:| -|Arduino UNO|D2|D9| |ESP8266|D4|D0| |ESP32|27/**26**|14| diff --git a/docs/setitup/rf.md b/docs/setitup/rf.md index 18bdb7097d..971ead7aef 100644 --- a/docs/setitup/rf.md +++ b/docs/setitup/rf.md @@ -32,7 +32,6 @@ Heltec LORA V3 is not compatible with RTL_433 library as it is based on an SX126 ### SRX STX Pinout |Board| Receiver Pin| Emitter Pin| |-|:-:|:-:| -|Arduino UNO|D3|D4| |ESP8266|D2/**D3**/D1/D8|**RX**/D2| |ESP32|**27**/26|12| |RF BRIDGE|-|-| diff --git a/docs/setitup/rs232.md b/docs/setitup/rs232.md index 5206662990..b1818967b3 100644 --- a/docs/setitup/rs232.md +++ b/docs/setitup/rs232.md @@ -10,7 +10,6 @@ Any module using a MAX232 chip will work. Don't pay extra to get all the signals ## Pinout |Board| Receiver Pin| Emitter Pin| |-|:-:|:-:| -|Arduino UNO|D2|D9| |ESP8266|D2|D4| |ESP32|27/**26**|14| diff --git a/docs/use/ir.md b/docs/use/ir.md index 89cb45d473..51e95c81b9 100644 --- a/docs/use/ir.md +++ b/docs/use/ir.md @@ -97,11 +97,7 @@ mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{"value":551489775," ## Send raw IR data by MQTT -2) If you use an Arduino UNO enable `IR_Raw` by uncommenting the line 129 in User_config.h -`#define IR_Raw` -If you are using the uno you will have to comment other gateway like ZgatewayRF, ZgatewayBT and ZgatewayIR to keep enough memory - -3) publish your code like below +Publish your code like below ``` mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{"raw":"8850,4450,600,550,550,550,600,1600,600,550,600,500,600,500,600,550,600,500,600,1650,600,1600,600,550,600,1600,600,1650,600,1600,600,1650,600,1600,600,550,600,500,600,550,550,1650,600,500,600,550,600,500,600,550,550,1650,600,1650,550,1650,600,550,550,1650,600,1650,550,1650,600,1650,600","protocol_name":"Raw"}' ``` diff --git a/environments.ini b/environments.ini index e0150948cc..bf003a1744 100644 --- a/environments.ini +++ b/environments.ini @@ -1504,86 +1504,6 @@ board_build.flash_mode = dout custom_description = Wifi relay and RF receiver using RCSwitch library, [tutorial](https://1technophile.blogspot.com/2019/08/new-sonoff-rfr3-as-433tomqtt-gateway.html) custom_hardware = Sonoff Basic RFR3, [tutorial](https://1technophile.blogspot.com/2019/08/new-sonoff-rfr3-as-433tomqtt-gateway.html) -[env:atmega-all-test] -platform = ${com.atmelavr_platform} -board = megaatmega2560 -lib_deps = - ${com-arduino.lib_deps} - ${libraries.irremote} - ${libraries.rfm69} - ${libraries.rfm69spi} - ${libraries.rfm69_low-power} - ${libraries.rc-switch} - ${libraries.newremoteswitch} - ${libraries.bme280} - ${libraries.bmp180} - ${libraries.htu21} - ${libraries.ahtx0} - ${libraries.unifiedsensor} - ${libraries.dht} - ${libraries.tsl2561} - ${libraries.a6lib} - ${libraries.ina226} - ${libraries.fastled} - ${libraries.onewire} - ${libraries.dallastemperature} - ${libraries.rfWeatherStation} - ${libraries.stl} -build_flags = - ${com-arduino.build_flags} - '-DZgatewayRF="RF"' - '-DZgatewayRF="RF315"' - '-DZgatewayRF2="RF2"' - '-DZgatewayIR="IR"' - '-DZactuatorONOFF="ONOFF"' - '-DZactuatorFASTLED="FASTLED"' - '-DZactuatorPWM="PWM"' - '-DZsensorINA226="INA226"' - '-DZsensorHCSR501="HCSR501"' - '-DZsensorADC="ADC"' - '-DZsensorBH1750="BH1750"' - '-DZsensorBME280="BME280"' - '-DZsensorHTU21="HTU21"' - '-DZsensorAHTx0="AHTx0"' - '-DZsensorTSL2561="TSL2561"' - '-DZsensorDHT="DHT"' - '-DZsensorDS1820="DS1820"' - '-DZgatewayRFM69="RFM69"' - '-DZgatewayWeatherStation="WeatherStation"' - '-DZsensorGPIOInput="GPIOInput"' - ;'-DZsensorGPIOKeyCode="GPIOKeyCode"' - '-DZmqttDiscovery="HADiscovery"' - '-DsimplePublishing=true' - '-DGateway_Name="OMG_ATMEGA_ALL"' - '-UZmqttDiscovery="HADiscovery"' - -[env:uno-rf] -platform = ${com.atmelavr_platform} -board = uno -lib_deps = - ${com-arduino.lib_deps} - ${libraries.rc-switch} -build_flags = - ${com-arduino-low-memory.build_flags} - '-UZmqttDiscovery="HADiscovery"' - '-DZgatewayRF="RF"' - '-DGateway_Name="OMG_1_RF"' - '-DDISABLE_LOGGING' -custom_description = RF gateway based on RCSwitch - -[env:uno-fastled] -platform = ${com.atmelavr_platform} -board = uno -lib_deps = - ${com-arduino.lib_deps} - ${libraries.fastled} -build_flags = - ${com-arduino-low-memory.build_flags} - '-DGateway_Name="OMG_1_FL"' - '-DZactuatorFASTLED="FASTLED"' - '-UZmqttDiscovery="HADiscovery"' -custom_description = FastLed control - [env:esp32dev-ble-datatest] platform = ${com.esp32_platform} board = esp32dev diff --git a/main/User_config.h b/main/User_config.h index b80aa3ca8a..d8fed4a4cd 100644 --- a/main/User_config.h +++ b/main/User_config.h @@ -1,7 +1,7 @@ /* OpenMQTTGateway - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This program enables to: @@ -145,23 +145,17 @@ const byte mac[] = {0xDE, 0xED, 0xBA, 0xFE, 0x54, 0x95}; //W5100 ethernet shield /*-------------DEFINE YOUR MQTT PARAMETERS BELOW----------------*/ //MQTT Parameters definition -#if defined(ESP8266) || defined(ESP32) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) -# define parameters_size 65 -# define mqtt_topic_max_size 150 -# ifndef mqtt_max_packet_size -# ifdef MQTT_HTTPS_FW_UPDATE -# ifndef CHECK_OTA_UPDATE -# define CHECK_OTA_UPDATE true // enable to check for the presence of a new version for your environment on Github -# endif -# define mqtt_max_packet_size 2560 -# else -# define mqtt_max_packet_size 1024 +#define parameters_size 65 +#define mqtt_topic_max_size 150 +#ifndef mqtt_max_packet_size +# ifdef MQTT_HTTPS_FW_UPDATE +# ifndef CHECK_OTA_UPDATE +# define CHECK_OTA_UPDATE true // enable to check for the presence of a new version for your environment on Github # endif +# define mqtt_max_packet_size 2560 +# else +# define mqtt_max_packet_size 1024 # endif -#else -# define parameters_size 30 -# define mqtt_topic_max_size 75 -# define mqtt_max_packet_size 128 #endif #ifndef MQTT_USER @@ -429,10 +423,6 @@ int lowpowermode = DEFAULT_LOW_POWER_MODE; //# define LED_SEND_RECEIVE 40 # elif ESP32 //# define LED_SEND_RECEIVE 40 -# elif __AVR_ATmega2560__ //arduino mega -//# define LED_SEND_RECEIVE 40 -# else //arduino uno/nano -//# define LED_SEND_RECEIVE 40 # endif # endif # ifndef LED_SEND_RECEIVE_ON @@ -443,10 +433,6 @@ int lowpowermode = DEFAULT_LOW_POWER_MODE; //# define LED_ERROR 42 # elif ESP32 //# define LED_ERROR 42 -# elif __AVR_ATmega2560__ //arduino mega -//# define LED_ERROR 42 -# else //arduino uno/nano -//# define LED_ERROR 42 # endif # endif # ifndef LED_ERROR_ON @@ -457,10 +443,6 @@ int lowpowermode = DEFAULT_LOW_POWER_MODE; //# define LED_INFO 44 # elif ESP32 //# define LED_INFO 44 -# elif __AVR_ATmega2560__ //arduino mega -//# define LED_INFO 44 -# else //arduino uno/nano -//# define LED_INFO 44 # endif # endif # ifndef LED_INFO_ON @@ -681,14 +663,6 @@ Adafruit_NeoPixel leds2(ANEOPIX_IND_NUM_LEDS, ANEOPIX_IND_DATA_GPIO2, ANEOPIX_IN # define JSON_MSG_BUFFER 512 // Json message max buffer size, don't put 768 or higher it is causing unexpected behaviour on ESP8266 # define SIGNAL_SIZE_UL_ULL uint64_t # define STRTO_UL_ULL strtoull -#elif defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) -# define JSON_MSG_BUFFER 512 // Json message max buffer size, don't put 1024 or higher -# define SIGNAL_SIZE_UL_ULL uint64_t -# define STRTO_UL_ULL strtoul -#else // boards with smaller memory -# define JSON_MSG_BUFFER 64 // Json message max buffer size, don't put 1024 or higher -# define SIGNAL_SIZE_UL_ULL uint32_t -# define STRTO_UL_ULL strtoul #endif #if defined(ZgatewayRF) || defined(ZgatewayIR) || defined(ZgatewaySRFB) || defined(ZgatewayWeatherStation) || defined(ZgatewayRTL_433) diff --git a/main/ZactuatorFASTLED.ino b/main/ZactuatorFASTLED.ino index b75dabf007..e7bfa5077c 100644 --- a/main/ZactuatorFASTLED.ino +++ b/main/ZactuatorFASTLED.ino @@ -1,5 +1,5 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface This gateway enables to use RGBLED strips like WS2812 diff --git a/main/ZactuatorONOFF.ino b/main/ZactuatorONOFF.ino index be008453b9..25d02eef16 100644 --- a/main/ZactuatorONOFF.ino +++ b/main/ZactuatorONOFF.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT Output GPIO defined to High or Low diff --git a/main/ZactuatorPWM.ino b/main/ZactuatorPWM.ino index 2efd6fcb2e..c5757a0046 100644 --- a/main/ZactuatorPWM.ino +++ b/main/ZactuatorPWM.ino @@ -1,5 +1,5 @@ /* - OpenMQTTGateway - ESP32, ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface This actuator enables control over the PWM outputs of microcontrollers. diff --git a/main/ZactuatorSomfy.ino b/main/ZactuatorSomfy.ino index 3e5cddd77e..ecae060f34 100644 --- a/main/ZactuatorSomfy.ino +++ b/main/ZactuatorSomfy.ino @@ -1,6 +1,6 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This actor enables to: diff --git a/main/Zblufi.ino b/main/Zblufi.ino index f76f378b54..2d036b2168 100644 --- a/main/Zblufi.ino +++ b/main/Zblufi.ino @@ -1,7 +1,7 @@ /* OpenMQTTGateway - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This program enables to: diff --git a/main/ZboardM5.ino b/main/ZboardM5.ino index d7348c42f9..9134b2be3c 100644 --- a/main/ZboardM5.ino +++ b/main/ZboardM5.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT M5 boards management diff --git a/main/ZcommonRF.ino b/main/ZcommonRF.ino index 2d5a41e7c0..5fa88cb3e0 100644 --- a/main/ZcommonRF.ino +++ b/main/ZcommonRF.ino @@ -1,5 +1,5 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface Act as a wifi or ethernet gateway between your BLE/433mhz/infrared IR signal and an MQTT broker Send and receiving command by MQTT @@ -25,14 +25,13 @@ #include "User_config.h" #if defined(ZgatewayRF) || defined(ZgatewayPilight) || defined(ZgatewayRTL_433) || defined(ZgatewayRF2) || defined(ZactuatorSomfy) -# ifndef ARDUINO_AVR_UNO -# ifdef ZradioCC1101 -# include -# endif +# ifdef ZradioCC1101 +# include +# endif void initCC1101() { -# ifdef ZradioCC1101 //receiving with CC1101 +# ifdef ZradioCC1101 //receiving with CC1101 // Loop on getCC1101() until it returns true and break after 10 attempts int delayMS = 16; int delayMaxMS = 500; @@ -50,7 +49,7 @@ void initCC1101() { delayMS = delayMS * 2; if (delayMS > delayMaxMS) delayMS = delayMaxMS; } -# endif +# endif } void setupCommonRF() { @@ -71,105 +70,101 @@ bool validFrequency(float mhz) { int currentReceiver = ACTIVE_NONE; -# if !defined(ZgatewayRFM69) && !defined(ZactuatorSomfy) -# if defined(ESP8266) || defined(ESP32) +# if !defined(ZgatewayRFM69) && !defined(ZactuatorSomfy) +# if defined(ESP8266) || defined(ESP32) // Check if a receiver is available bool validReceiver(int receiver) { switch (receiver) { -# ifdef ZgatewayPilight +# ifdef ZgatewayPilight case ACTIVE_PILIGHT: return true; -# endif -# ifdef ZgatewayRF +# endif +# ifdef ZgatewayRF case ACTIVE_RF: return true; -# endif -# ifdef ZgatewayRTL_433 +# endif +# ifdef ZgatewayRTL_433 case ACTIVE_RTL: return true; -# endif -# ifdef ZgatewayRF2 +# endif +# ifdef ZgatewayRF2 case ACTIVE_RF2: return true; -# endif +# endif default: Log.error(F("ERROR: stored receiver %d not available" CR), receiver); } return false; } -# endif # endif +# endif void disableCurrentReceiver() { Log.trace(F("disableCurrentReceiver: %d" CR), currentReceiver); switch (currentReceiver) { case ACTIVE_NONE: break; -# ifdef ZgatewayPilight +# ifdef ZgatewayPilight case ACTIVE_PILIGHT: disablePilightReceive(); break; -# endif -# ifdef ZgatewayRF +# endif +# ifdef ZgatewayRF case ACTIVE_RF: disableRFReceive(); break; -# endif -# ifdef ZgatewayRTL_433 +# endif +# ifdef ZgatewayRTL_433 case ACTIVE_RTL: disableRTLreceive(); break; -# endif -# ifdef ZgatewayRF2 +# endif +# ifdef ZgatewayRF2 case ACTIVE_RF2: disableRF2Receive(); break; -# endif -# ifndef ARDUINO_AVR_UNO // Space issues with the UNO +# endif default: Log.error(F("ERROR: unsupported receiver %d" CR), RFConfig.activeReceiver); -# endif } } void enableActiveReceiver() { Log.trace(F("enableActiveReceiver: %d" CR), RFConfig.activeReceiver); switch (RFConfig.activeReceiver) { -# ifdef ZgatewayPilight +# ifdef ZgatewayPilight case ACTIVE_PILIGHT: initCC1101(); enablePilightReceive(); currentReceiver = ACTIVE_PILIGHT; break; -# endif -# ifdef ZgatewayRF +# endif +# ifdef ZgatewayRF case ACTIVE_RF: initCC1101(); enableRFReceive(); currentReceiver = ACTIVE_RF; break; -# endif -# ifdef ZgatewayRTL_433 +# endif +# ifdef ZgatewayRTL_433 case ACTIVE_RTL: initCC1101(); enableRTLreceive(); currentReceiver = ACTIVE_RTL; break; -# endif -# ifdef ZgatewayRF2 +# endif +# ifdef ZgatewayRF2 case ACTIVE_RF2: initCC1101(); enableRF2Receive(); currentReceiver = ACTIVE_RF2; break; -# endif +# endif case ACTIVE_RECERROR: Log.error(F("ERROR: no receiver selected" CR)); break; -# ifndef ARDUINO_AVR_UNO // Space issues with the UNO default: Log.error(F("ERROR: unsupported receiver %d" CR), RFConfig.activeReceiver); -# endif } } @@ -178,20 +173,20 @@ String stateRFMeasures() { StaticJsonDocument jsonBuffer; JsonObject RFdata = jsonBuffer.to(); RFdata["active"] = RFConfig.activeReceiver; -# if defined(ZradioCC1101) || defined(ZradioSX127x) +# if defined(ZradioCC1101) || defined(ZradioSX127x) RFdata["frequency"] = RFConfig.frequency; if (RFConfig.activeReceiver == ACTIVE_RTL) { -# ifdef ZgatewayRTL_433 +# ifdef ZgatewayRTL_433 RFdata["rssithreshold"] = (int)getRTLrssiThreshold(); RFdata["rssi"] = (int)getRTLCurrentRSSI(); RFdata["avgrssi"] = (int)getRTLAverageRSSI(); RFdata["count"] = (int)getRTLMessageCount(); -# endif -# ifdef ZradioSX127x +# endif +# ifdef ZradioSX127x RFdata["ookthreshold"] = (int)getOOKThresh(); -# endif - } # endif + } +# endif pub(subjectcommonRFtoMQTT, RFdata); String output; @@ -211,21 +206,21 @@ void RFConfig_fromJson(JsonObject& RFdata) { Config_update(RFdata, "active", RFConfig.activeReceiver); success = true; } -# ifdef ZgatewayRTL_433 +# ifdef ZgatewayRTL_433 if (RFdata.containsKey("rssithreshold")) { Log.notice(F("RTL_433 RSSI Threshold : %d " CR), RFConfig.rssiThreshold); Config_update(RFdata, "rssithreshold", RFConfig.rssiThreshold); rtl_433.setRSSIThreshold(RFConfig.rssiThreshold); success = true; } -# if defined(RF_SX1276) || defined(RF_SX1278) +# if defined(RF_SX1276) || defined(RF_SX1278) if (RFdata.containsKey("ookthreshold")) { Config_update(RFdata, "ookthreshold", RFConfig.newOokThreshold); Log.notice(F("RTL_433 ookThreshold %d" CR), RFConfig.newOokThreshold); rtl_433.setOOKThreshold(RFConfig.newOokThreshold); success = true; } -# endif +# endif if (RFdata.containsKey("status")) { Log.notice(F("RF get status:" CR)); rtl_433.getStatus(); @@ -234,10 +229,10 @@ void RFConfig_fromJson(JsonObject& RFdata) { if (!success) { Log.error(F("MQTTtoRF Fail json" CR)); } -# endif +# endif disableCurrentReceiver(); enableActiveReceiver(); -# ifdef ESP32 +# ifdef ESP32 if (RFdata.containsKey("erase") && RFdata["erase"].as()) { // Erase config from NVS (non-volatile storage) preferences.begin(Gateway_Short_Name, false); @@ -257,10 +252,10 @@ void RFConfig_fromJson(JsonObject& RFdata) { jo["frequency"] = RFConfig.frequency; jo["active"] = RFConfig.activeReceiver; // Don't save those for now, need to be tested -# ifdef ZgatewayRTL_433 +# ifdef ZgatewayRTL_433 //jo["rssithreshold"] = RFConfig.rssiThreshold; //jo["ookthreshold"] = RFConfig.newOokThreshold; -# endif +# endif // Save config into NVS (non-volatile storage) String conf = ""; serializeJson(jsonBuffer, conf); @@ -269,7 +264,7 @@ void RFConfig_fromJson(JsonObject& RFdata) { preferences.end(); Log.notice(F("RF Config_save: %s, result: %d" CR), conf.c_str(), result); } -# endif +# endif } void RFConfig_init() { @@ -280,7 +275,7 @@ void RFConfig_init() { } void RFConfig_load() { -# ifdef ESP32 +# ifdef ESP32 StaticJsonDocument jsonBuffer; preferences.begin(Gateway_Short_Name, true); if (preferences.isKey("RFConfig")) { @@ -302,9 +297,9 @@ void RFConfig_load() { Log.notice(F("RF Config not found using default" CR)); enableActiveReceiver(); } -# else +# else enableActiveReceiver(); -# endif +# endif } void MQTTtoRFset(char* topicOri, JsonObject& RFdata) { @@ -330,10 +325,4 @@ void MQTTtoRFset(char* topicOri, JsonObject& RFdata) { stateRFMeasures(); } } -# else -void RFConfig_init() {} -void RFConfig_load() {} -void MQTTtoRFset(char* topicOri, JsonObject& RFdata) {} -void enableActiveReceiver() {} -# endif #endif diff --git a/main/ZdisplaySSD1306.ino b/main/ZdisplaySSD1306.ino index b791df7e0a..ed7bcfbd73 100644 --- a/main/ZdisplaySSD1306.ino +++ b/main/ZdisplaySSD1306.ino @@ -1,7 +1,7 @@ /* OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT Supported boards with displays diff --git a/main/Zgateway2G.ino b/main/Zgateway2G.ino index 53530583dd..6fd77a85df 100644 --- a/main/Zgateway2G.ino +++ b/main/Zgateway2G.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This gateway enables to: diff --git a/main/ZgatewayBT.ino b/main/ZgatewayBT.ino index e8e633fa6a..a252868bc4 100644 --- a/main/ZgatewayBT.ino +++ b/main/ZgatewayBT.ino @@ -1,13 +1,11 @@ /* OpenMQTTGateway - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal/BLE and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This gateway enables to: - - publish MQTT data to a different topic related to BLE devices rssi signal - - publish MQTT data related to mi flora temperature, moisture, fertility and lux - - publish MQTT data related to mi jia indoor temperature & humidity sensor + - publish MQTT data to a topic related to BLE devices data Copyright: (c)Florian ROBERT diff --git a/main/ZgatewayGFSunInverter.ino b/main/ZgatewayGFSunInverter.ino index 16caa4eee1..3297033f3b 100644 --- a/main/ZgatewayGFSunInverter.ino +++ b/main/ZgatewayGFSunInverter.ino @@ -1,5 +1,5 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface Act as a wifi or ethernet gateway between your GridFree SUN-2000G inverter and a MQTT broker. Send inverter metrics by MQTT. diff --git a/main/ZgatewayIR.ino b/main/ZgatewayIR.ino index 328870abc5..e432c39335 100644 --- a/main/ZgatewayIR.ino +++ b/main/ZgatewayIR.ino @@ -1,7 +1,7 @@ /* OpenMQTTGateway - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This gateway enables to: diff --git a/main/ZgatewayLORA.ino b/main/ZgatewayLORA.ino index a88c3e30d2..4a1a0e70da 100644 --- a/main/ZgatewayLORA.ino +++ b/main/ZgatewayLORA.ino @@ -1,5 +1,5 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface Act as a wifi or ethernet gateway between your 433mhz/infrared IR/BLE signal and a MQTT broker Send and receiving command by MQTT diff --git a/main/ZgatewayPilight.ino b/main/ZgatewayPilight.ino index eb2b8416fa..1f4a3c508b 100644 --- a/main/ZgatewayPilight.ino +++ b/main/ZgatewayPilight.ino @@ -1,7 +1,7 @@ /* OpenMQTTGateway - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This gateway enables to: diff --git a/main/ZgatewayRF.ino b/main/ZgatewayRF.ino index 823359b95a..6f2cbd1355 100644 --- a/main/ZgatewayRF.ino +++ b/main/ZgatewayRF.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This gateway enables to: diff --git a/main/ZgatewayRF2.ino b/main/ZgatewayRF2.ino index 843c38b9d1..e17c85cf56 100644 --- a/main/ZgatewayRF2.ino +++ b/main/ZgatewayRF2.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This gateway enables to: @@ -292,9 +292,7 @@ void MQTTtoRF2(char* topicOri, JsonObject& RF2data) { // json object decoding // we acknowledge the sending by publishing the value to an acknowledgement topic, for the moment even if it is a signal repetition we acknowledge also pub(subjectRF2toMQTT, RF2data); } else { -# ifndef ARDUINO_AVR_UNO // Space issues with the UNO pub(subjectGTWRF2toMQTT, "{\"Status\": \"Error\"}"); // Fail feedback -# endif Log.error(F("MQTTtoRF2 failed json read" CR)); } enableActiveReceiver(); diff --git a/main/ZgatewayRFM69.ino b/main/ZgatewayRFM69.ino index c9aa0590ad..b1900142e5 100644 --- a/main/ZgatewayRFM69.ino +++ b/main/ZgatewayRFM69.ino @@ -1,5 +1,5 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface Act as a wifi or ethernet gateway between your RF/infrared IR signal and a MQTT broker Send and receiving command by MQTT diff --git a/main/ZgatewayRS232.ino b/main/ZgatewayRS232.ino index f6da25e731..e396a2a7c7 100644 --- a/main/ZgatewayRS232.ino +++ b/main/ZgatewayRS232.ino @@ -1,5 +1,5 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface Act as a wifi or ethernet gateway between your RS232 device and a MQTT broker Send and receiving command by MQTT diff --git a/main/ZgatewayRTL_433.ino b/main/ZgatewayRTL_433.ino index 45589ffe3f..350944f78c 100644 --- a/main/ZgatewayRTL_433.ino +++ b/main/ZgatewayRTL_433.ino @@ -1,7 +1,7 @@ /* OpenMQTTGateway - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This gateway enables to: diff --git a/main/ZgatewaySRFB.ino b/main/ZgatewaySRFB.ino index 558fef16fa..6d1293a337 100644 --- a/main/ZgatewaySRFB.ino +++ b/main/ZgatewaySRFB.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This gateway enables to: diff --git a/main/ZgatewayWeatherStation.ino b/main/ZgatewayWeatherStation.ino index e177aa21c5..911267efb9 100644 --- a/main/ZgatewayWeatherStation.ino +++ b/main/ZgatewayWeatherStation.ino @@ -1,7 +1,7 @@ /* OpenMQTTGateway - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This gateway enables to: diff --git a/main/ZmqttDiscovery.ino b/main/ZmqttDiscovery.ino index 4d531ec4fb..ff8805e12e 100644 --- a/main/ZmqttDiscovery.ino +++ b/main/ZmqttDiscovery.ino @@ -1,7 +1,7 @@ /* OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This is the Home Assistant MQTT Discovery addon. diff --git a/main/ZsensorADC.ino b/main/ZsensorADC.ino index 00b4a68063..9931c4b41c 100644 --- a/main/ZsensorADC.ino +++ b/main/ZsensorADC.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT Analog GPIO reading Addon diff --git a/main/ZsensorAHTx0.ino b/main/ZsensorAHTx0.ino index 16af5ed273..6a7c3900ba 100644 --- a/main/ZsensorAHTx0.ino +++ b/main/ZsensorAHTx0.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This is the Climate Addon: diff --git a/main/ZsensorBH1750.ino b/main/ZsensorBH1750.ino index aca97bb309..2090b50f2e 100644 --- a/main/ZsensorBH1750.ino +++ b/main/ZsensorBH1750.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This is the Light Meter Addon: diff --git a/main/ZsensorBME280.ino b/main/ZsensorBME280.ino index 00887300a9..68383ff084 100644 --- a/main/ZsensorBME280.ino +++ b/main/ZsensorBME280.ino @@ -1,7 +1,7 @@ /* OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This is the Climate Addon: diff --git a/main/ZsensorC37_YL83_HMRD.ino b/main/ZsensorC37_YL83_HMRD.ino index b93addaee2..0e0b637786 100644 --- a/main/ZsensorC37_YL83_HMRD.ino +++ b/main/ZsensorC37_YL83_HMRD.ino @@ -1,5 +1,5 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface Act as a wifi or ethernet gateway between your 433mhz/infrared IR/BLE signal and a MQTT broker Send and receiving command by MQTT diff --git a/main/ZsensorDHT.ino b/main/ZsensorDHT.ino index 70c72c0278..cb30db5d5e 100644 --- a/main/ZsensorDHT.ino +++ b/main/ZsensorDHT.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT DHT reading Addon diff --git a/main/ZsensorDS1820.ino b/main/ZsensorDS1820.ino index 4c55bc566a..cf5ff0fabf 100644 --- a/main/ZsensorDS1820.ino +++ b/main/ZsensorDS1820.ino @@ -1,5 +1,5 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface Act as a wifi or ethernet gateway between your 433mhz/infrared IR/BLE signal and a MQTT broker Send and receiving command by MQTT diff --git a/main/ZsensorGPIOInput.ino b/main/ZsensorGPIOInput.ino index 113d89c50b..77956264da 100644 --- a/main/ZsensorGPIOInput.ino +++ b/main/ZsensorGPIOInput.ino @@ -1,6 +1,6 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT GPIO Input derived from HC SR-501 reading Addon and https://www.arduino.cc/en/Tutorial/Debounce diff --git a/main/ZsensorGPIOKeyCode.ino b/main/ZsensorGPIOKeyCode.ino index 4e2189b93e..06c1723289 100644 --- a/main/ZsensorGPIOKeyCode.ino +++ b/main/ZsensorGPIOKeyCode.ino @@ -1,6 +1,6 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT GPIO KeyCode derived from GPIO Input diff --git a/main/ZsensorHCSR04.ino b/main/ZsensorHCSR04.ino index eed7840013..2a6c39e702 100644 --- a/main/ZsensorHCSR04.ino +++ b/main/ZsensorHCSR04.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT HC SR-04 reading Addon diff --git a/main/ZsensorHCSR501.ino b/main/ZsensorHCSR501.ino index 83b2dc951d..77f299dc37 100644 --- a/main/ZsensorHCSR501.ino +++ b/main/ZsensorHCSR501.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT HC SR-501 reading Addon diff --git a/main/ZsensorHTU21.ino b/main/ZsensorHTU21.ino index 7b6445c4d2..8850d456da 100644 --- a/main/ZsensorHTU21.ino +++ b/main/ZsensorHTU21.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This is the Climate Addon: diff --git a/main/ZsensorINA226.ino b/main/ZsensorINA226.ino index ce2146eb03..fac26a9185 100644 --- a/main/ZsensorINA226.ino +++ b/main/ZsensorINA226.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT INA226 reading Addon diff --git a/main/ZsensorLM75.ino b/main/ZsensorLM75.ino index b30080a868..6f4ead434a 100644 --- a/main/ZsensorLM75.ino +++ b/main/ZsensorLM75.ino @@ -1,7 +1,7 @@ /* OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This is a Temperature Addon: diff --git a/main/ZsensorMQ2.ino b/main/ZsensorMQ2.ino index e3b00f01a6..4fe55fba08 100644 --- a/main/ZsensorMQ2.ino +++ b/main/ZsensorMQ2.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This is the MQ2 GAS Sensor Addon based on modules with a MQ: diff --git a/main/ZsensorRN8209.ino b/main/ZsensorRN8209.ino index d0fced60fe..e600265130 100644 --- a/main/ZsensorRN8209.ino +++ b/main/ZsensorRN8209.ino @@ -1,7 +1,7 @@ /* OpenMQTTGateway Addon - ESP8266, ESP32 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT RN8209 reading Addon diff --git a/main/ZsensorTEMT6000.ino b/main/ZsensorTEMT6000.ino index a83e9be2cc..ca783883a4 100644 --- a/main/ZsensorTEMT6000.ino +++ b/main/ZsensorTEMT6000.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This is the Light Meter Addon based on modules with a TEMT6000: diff --git a/main/ZsensorTSL2561.ino b/main/ZsensorTSL2561.ino index c1063bee9e..88ff0be065 100644 --- a/main/ZsensorTSL2561.ino +++ b/main/ZsensorTSL2561.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This is the Light Meter Addon based on modules with a TSL2561: diff --git a/main/ZsensorTouch.ino b/main/ZsensorTouch.ino index 82d154f38b..d8b59d9771 100644 --- a/main/ZsensorTouch.ino +++ b/main/ZsensorTouch.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT For esp32, touch sensor reading add-on. diff --git a/main/ZwebUI.ino b/main/ZwebUI.ino index f743aac3ab..49189755b2 100644 --- a/main/ZwebUI.ino +++ b/main/ZwebUI.ino @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT Copyright: (c)Florian ROBERT diff --git a/main/config_2G.h b/main/config_2G.h index 8456c8b7d1..483764f24c 100644 --- a/main/config_2G.h +++ b/main/config_2G.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This gateway enables to set your parameters for the 2G gateway diff --git a/main/config_ADC.h b/main/config_ADC.h index 393f92365d..00a3f140b6 100644 --- a/main/config_ADC.h +++ b/main/config_ADC.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the ADC value diff --git a/main/config_AHTx0.h b/main/config_AHTx0.h index dba595943e..6e3a867534 100644 --- a/main/config_AHTx0.h +++ b/main/config_AHTx0.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This is the Climate Addon: diff --git a/main/config_BH1750.h b/main/config_BH1750.h index e1f29b65be..cef9902767 100644 --- a/main/config_BH1750.h +++ b/main/config_BH1750.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the BH1750 sensor diff --git a/main/config_BME280.h b/main/config_BME280.h index 3ea6241469..df22d32d0e 100644 --- a/main/config_BME280.h +++ b/main/config_BME280.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables you to set parameters for the BME280 or BMP280 sensors. diff --git a/main/config_BT.h b/main/config_BT.h index a1167017f8..f7e1768181 100644 --- a/main/config_BT.h +++ b/main/config_BT.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the bluetooth low energy gateway (beacons detection) diff --git a/main/config_C37_YL83_HMRD.h b/main/config_C37_YL83_HMRD.h index 018f02a006..df533a1241 100644 --- a/main/config_C37_YL83_HMRD.h +++ b/main/config_C37_YL83_HMRD.h @@ -1,5 +1,5 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface Act as a wifi or ethernet gateway between your RF/infrared IR signal and a MQTT broker Send and receiving command by MQTT diff --git a/main/config_DHT.h b/main/config_DHT.h index 89f4c8c25a..01d5cddbde 100644 --- a/main/config_DHT.h +++ b/main/config_DHT.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the DHT11/22 sensor diff --git a/main/config_DS1820.h b/main/config_DS1820.h index dfba98aecc..6336463876 100644 --- a/main/config_DS1820.h +++ b/main/config_DS1820.h @@ -1,5 +1,5 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface Act as a wifi or ethernet gateway between your RF/infrared IR signal and a MQTT broker Send and receiving command by MQTT diff --git a/main/config_FASTLED.h b/main/config_FASTLED.h index 545ba2859d..6c3790cec1 100644 --- a/main/config_FASTLED.h +++ b/main/config_FASTLED.h @@ -1,5 +1,5 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface This files enables you to set your parameters for the FASTLED actuator diff --git a/main/config_GFSunInverter.h b/main/config_GFSunInverter.h index 7cc1643023..80dae1958f 100644 --- a/main/config_GFSunInverter.h +++ b/main/config_GFSunInverter.h @@ -1,5 +1,5 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface Act as a wifi or ethernet gateway between your GridFree SUN-2000G inverter and a MQTT broker. Send inverter metrics by MQTT. diff --git a/main/config_GPIOInput.h b/main/config_GPIOInput.h index 5c9a34a249..82d426f388 100644 --- a/main/config_GPIOInput.h +++ b/main/config_GPIOInput.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the GPIOInput sensor diff --git a/main/config_GPIOKeyCode.h b/main/config_GPIOKeyCode.h index 9896ccc4be..3f78db6664 100644 --- a/main/config_GPIOKeyCode.h +++ b/main/config_GPIOKeyCode.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the GPIOKeyCode multi input diff --git a/main/config_HCSR04.h b/main/config_HCSR04.h index 7312dff532..b75d122fd8 100644 --- a/main/config_HCSR04.h +++ b/main/config_HCSR04.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the HCSR04 sensor diff --git a/main/config_HCSR501.h b/main/config_HCSR501.h index 1482f76342..eb42a7302e 100644 --- a/main/config_HCSR501.h +++ b/main/config_HCSR501.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the HC SR-501 sensor diff --git a/main/config_HTU21.h b/main/config_HTU21.h index 7efc31b26e..974a8543b1 100644 --- a/main/config_HTU21.h +++ b/main/config_HTU21.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This is the Climate Addon: diff --git a/main/config_INA226.h b/main/config_INA226.h index ebc37f215e..090dcabe56 100644 --- a/main/config_INA226.h +++ b/main/config_INA226.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the INA226 sensor diff --git a/main/config_IR.h b/main/config_IR.h index f646c2c9fd..f4e427066e 100644 --- a/main/config_IR.h +++ b/main/config_IR.h @@ -1,7 +1,7 @@ /* OpenMQTTGateway - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the infrared gateway @@ -159,17 +159,6 @@ extern void MQTTtoIR(char* topicOri, JsonObject& RFdata); # define IR_COOLIX48 # define IR_HITACHI_AC264 # define IR_HITACHI_AC296 -#elif __AVR_ATmega2560__ -# define IR_COOLIX -# define IR_Whynter -# define IR_LG -# define IR_Sony -# define IR_DISH -# define IR_RC5 -# define IR_Sharp -# define IR_SAMSUNG -# define IR_Raw -# define IR_PANASONIC #else //IR supported protocols on arduino uncomment if you want to send with this protocol, NEC protocol is available per default //#define IR_COOLIX //#define IR_Whynter @@ -195,10 +184,6 @@ extern void MQTTtoIR(char* topicOri, JsonObject& RFdata); # define IR_RECEIVER_GPIO 2 //D4 /replace by 4 with sonoff rf bridge # elif ESP32 # define IR_RECEIVER_GPIO 26 -# elif __AVR_ATmega2560__ -# define IR_RECEIVER_GPIO 2 // 2 = D2 on arduino mega -# else -# define IR_RECEIVER_GPIO 0 // 0 = D2 on arduino UNO # endif #endif @@ -207,10 +192,6 @@ extern void MQTTtoIR(char* topicOri, JsonObject& RFdata); # define IR_EMITTER_GPIO 16 //D0/ replace by 0 (D3) if you use IR LOLIN controller shield /replace by 5 with sonoff rf bridge # elif ESP32 # define IR_EMITTER_GPIO 14 -# elif __AVR_ATmega2560__ -# define IR_EMITTER_GPIO 9 -# else -# define IR_EMITTER_GPIO 9 # endif #endif diff --git a/main/config_LM75.h b/main/config_LM75.h index 9b42cb9954..9a615a3efd 100644 --- a/main/config_LM75.h +++ b/main/config_LM75.h @@ -1,7 +1,7 @@ /* OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This is a Temperature Addon: diff --git a/main/config_LORA.h b/main/config_LORA.h index 2db7f66351..8cfed17abb 100644 --- a/main/config_LORA.h +++ b/main/config_LORA.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the LORA gateway diff --git a/main/config_M5.h b/main/config_M5.h index 47f7e40cda..b08ee61b3b 100644 --- a/main/config_M5.h +++ b/main/config_M5.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to use M5Stick C board components (display) diff --git a/main/config_MQ2.h b/main/config_MQ2.h index b5533188aa..789a8b27d9 100644 --- a/main/config_MQ2.h +++ b/main/config_MQ2.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This is the MQ2 GAS Sensor Addon based on modules with a MQ: diff --git a/main/config_ONOFF.h b/main/config_ONOFF.h index 4300569e92..3af16ada9e 100644 --- a/main/config_ONOFF.h +++ b/main/config_ONOFF.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the ON OFF actuator diff --git a/main/config_PWM.h b/main/config_PWM.h index c5a61229d2..c364cc31ce 100644 --- a/main/config_PWM.h +++ b/main/config_PWM.h @@ -1,5 +1,5 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface This files enables you to set your parameters for the PWM actuator diff --git a/main/config_RF.h b/main/config_RF.h index df7a10e03d..90a787604b 100644 --- a/main/config_RF.h +++ b/main/config_RF.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the radiofrequency gateways (ZgatewayRF and ZgatewayRF2) with RCswitch and newremoteswitch library @@ -223,10 +223,6 @@ RFConfig_s RFConfig; # define RF_RECEIVER_GPIO 0 // D3 on nodemcu // put 4 with rf bridge direct mod # elif ESP32 # define RF_RECEIVER_GPIO 27 // D27 on DOIT ESP32 -# elif __AVR_ATmega2560__ -# define RF_RECEIVER_GPIO 1 //1 = D3 on mega -# else -# define RF_RECEIVER_GPIO 1 //1 = D3 on arduino # endif #endif @@ -235,8 +231,6 @@ RFConfig_s RFConfig; # define RF_EMITTER_GPIO 3 // RX on nodemcu if it doesn't work with 3, try with 4 (D2) // put 5 with rf bridge direct mod # elif ESP32 # define RF_EMITTER_GPIO 12 // D12 on DOIT ESP32 -# elif __AVR_ATmega2560__ -# define RF_EMITTER_GPIO 4 # else //IMPORTANT NOTE: On arduino UNO connect IR emitter pin to D9 , comment #define IR_USE_TIMER2 and uncomment #define IR_USE_TIMER1 on library IRremote/boarddefs.h so as to free pin D3 for RF RECEIVER PIN //RF PIN definition diff --git a/main/config_RFM69.h b/main/config_RFM69.h index a8d70373b8..b75fb7b127 100644 --- a/main/config_RFM69.h +++ b/main/config_RFM69.h @@ -1,7 +1,7 @@ /* OpenMQTTGateway - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the radiofrequency gateways (ZgatewayRF and ZgatewayRF2) with RCswitch and newremoteswitch library diff --git a/main/config_RN8209.h b/main/config_RN8209.h index 744ce3942a..f0baac82ac 100644 --- a/main/config_RN8209.h +++ b/main/config_RN8209.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the RN8209 sensor diff --git a/main/config_RS232.h b/main/config_RS232.h index a91cbe181a..9b532730ba 100644 --- a/main/config_RS232.h +++ b/main/config_RS232.h @@ -1,5 +1,5 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface Act as a wifi or ethernet gateway between your RS232 device and a MQTT broker Send and receiving command by MQTT @@ -129,10 +129,6 @@ extern void MQTTtoRS232(char* topicOri, JsonObject& RS232data); # define RS232_RX_GPIO 4 //D2 # elif defined(ESP32) # define RS232_RX_GPIO 26 -# elif defined(__AVR_ATmega2560__) && !defined(RS232_UART) -# define RS232_RX_GPIO 2 // 2 = D2 on arduino mega -# else -# define RS232_RX_GPIO 0 // 0 = D2 on arduino UNO # endif #endif @@ -142,10 +138,6 @@ extern void MQTTtoRS232(char* topicOri, JsonObject& RS232data); # define RS232_TX_GPIO 2 //D4 # elif ESP32 # define RS232_TX_GPIO 14 -# elif defined(__AVR_ATmega2560__) && !defined(RS232_UART) -# define RS232_TX_GPIO 9 -# else -# define RS232_TX_GPIO 9 # endif #endif diff --git a/main/config_SHTC3.h b/main/config_SHTC3.h index 0f2653519c..bdfa0342d2 100644 --- a/main/config_SHTC3.h +++ b/main/config_SHTC3.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the SHTC311/22 sensor diff --git a/main/config_SRFB.h b/main/config_SRFB.h index c6173898ea..c4c4811576 100644 --- a/main/config_SRFB.h +++ b/main/config_SRFB.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the radiofrequency gateway on sonoff rf bridge (ZgatewaySRFB) diff --git a/main/config_SSD1306.h b/main/config_SSD1306.h index 6f66229750..2e761186ee 100644 --- a/main/config_SSD1306.h +++ b/main/config_SSD1306.h @@ -1,7 +1,7 @@ /* OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT Supported boards with displays diff --git a/main/config_Somfy.h b/main/config_Somfy.h index dc397af3cd..f705166057 100644 --- a/main/config_Somfy.h +++ b/main/config_Somfy.h @@ -1,6 +1,6 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This actor enables to: diff --git a/main/config_TEMT6000.h b/main/config_TEMT6000.h index e8dac39c49..edeb494d55 100644 --- a/main/config_TEMT6000.h +++ b/main/config_TEMT6000.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway Addon - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This is the Light Meter Addon based on modules with a TEMT6000: diff --git a/main/config_TSL2561.h b/main/config_TSL2561.h index 17d804aa03..1eccc4a358 100644 --- a/main/config_TSL2561.h +++ b/main/config_TSL2561.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files exposes light level measured by a TSL2651 module diff --git a/main/config_Touch.h b/main/config_Touch.h index 4a537ad96e..f4cd9d4c77 100644 --- a/main/config_Touch.h +++ b/main/config_Touch.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the esp32's touch buttons diff --git a/main/config_WeatherStation.h b/main/config_WeatherStation.h index 2d2bdeeb23..db312aea43 100644 --- a/main/config_WeatherStation.h +++ b/main/config_WeatherStation.h @@ -1,7 +1,7 @@ /* OpenMQTTGateway - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the DHT11/22 sensor @@ -41,10 +41,6 @@ extern void ZgatewayWeatherStationtoMQTT(); # define RF_WS_RECEIVER_GPIO 0 // D3 on nodemcu // put 4 with rf bridge direct mod # elif ESP32 # define RF_WS_RECEIVER_GPIO 27 // D27 on DOIT ESP32 -# elif __AVR_ATmega2560__ -# define RF_WS_RECEIVER_GPIO 1 //1 = D3 on mega -# else -# define RF_WS_RECEIVER_GPIO 1 //1 = D3 on arduino # endif #endif diff --git a/main/config_WebContent.h b/main/config_WebContent.h index 05104d2297..323663d461 100644 --- a/main/config_WebContent.h +++ b/main/config_WebContent.h @@ -1,7 +1,7 @@ /* OpenMQTTGateway - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the DHT11/22 sensor diff --git a/main/config_WebUI.h b/main/config_WebUI.h index ca978a02e8..e05f947b01 100644 --- a/main/config_WebUI.h +++ b/main/config_WebUI.h @@ -1,7 +1,7 @@ /* - OpenMQTTGateway - ESP8266 or Arduino program for home automation + Theengs OpenMQTTGateway - We Unite Sensors in One Open-Source Interface - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the DHT11/22 sensor diff --git a/main/config_mqttDiscovery.h b/main/config_mqttDiscovery.h index b38ec3a789..ac8dc905c5 100644 --- a/main/config_mqttDiscovery.h +++ b/main/config_mqttDiscovery.h @@ -1,7 +1,7 @@ /* OpenMQTTGateway - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This files enables to set your parameter for the Home assistant mqtt Discovery diff --git a/main/main.ino b/main/main.ino index 57c5cd0814..24b706f797 100644 --- a/main/main.ino +++ b/main/main.ino @@ -1,7 +1,7 @@ /* OpenMQTTGateway - ESP8266 or Arduino program for home automation - Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker + Act as a gateway between your 433mhz, infrared IR, BLE, LoRa signal and one interface like an MQTT broker Send and receiving command by MQTT This program enables to: @@ -43,33 +43,28 @@ struct ReceivedSignal { SIGNAL_SIZE_UL_ULL value; uint32_t time; }; -# if defined(ESP8266) || defined(ESP32) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) + ReceivedSignal receivedSignal[] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}; -# else // boards with smaller memory -ReceivedSignal receivedSignal[] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}}; -# endif + # define struct_size (sizeof(receivedSignal) / sizeof(ReceivedSignal)) #endif -#if defined(ESP8266) || defined(ESP32) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) //Time used to wait for an interval before checking system measures unsigned long timer_sys_measures = 0; // Time used to wait before system checkings unsigned long timer_sys_checks = 0; -# define ARDUINOJSON_USE_LONG_LONG 1 -# define ARDUINOJSON_ENABLE_STD_STRING 1 +#define ARDUINOJSON_USE_LONG_LONG 1 +#define ARDUINOJSON_ENABLE_STD_STRING 1 -# include +#include int queueLength = 0; unsigned long queueLengthSum = 0; unsigned long blockedMessages = 0; int maxQueueLength = 0; -# ifndef QueueSize -# define QueueSize 18 -# endif - +#ifndef QueueSize +# define QueueSize 18 #endif /** @@ -86,18 +81,15 @@ bool ready_to_sleep = false; #include -#if defined(ESP8266) || defined(ESP32) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) struct JsonBundle { StaticJsonDocument doc; }; std::queue jsonQueue; -# ifdef ESP32 +#ifdef ESP32 // Mutex to protect the queue SemaphoreHandle_t xQueueMutex; -# endif - #endif StaticJsonDocument modulesBuffer; @@ -440,7 +432,6 @@ void enqueueJsonObject(const StaticJsonDocument& jsonDoc) { Log.error(F("Empty JSON, skipping" CR)); return; } -#if defined(ESP8266) || defined(ESP32) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) if (queueLength >= QueueSize) { Log.warning(F("%d Doc(s) in queue, doc blocked" CR), queueLength); blockedMessages++; @@ -451,11 +442,6 @@ void enqueueJsonObject(const StaticJsonDocument& jsonDoc) { bundle.doc = jsonDoc; jsonQueue.push(bundle); Log.trace(F("Queue length: %d" CR), jsonQueue.size()); -#else - // Pub to main core - JsonObject jsonObj = jsonDoc.to(); - pubMainCore(jsonObj); // Arduino UNO or other boards with small memory, we don't store and directly publish -#endif } #ifdef ESP32 @@ -483,8 +469,6 @@ bool handleJsonEnqueue(const StaticJsonDocument& jsonDoc) { return handleJsonEnqueue(jsonDoc, QueueSemaphoreTimeOutLoop); } -#if defined(ESP8266) || defined(ESP32) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) - /* * Add the jsonObject id as a topic to the jsonObject origin * @@ -503,7 +487,7 @@ void buildTopicFromId(JsonObject& Jsondata, const char* origin) { topic.erase(pos, 1); pos = topic.find(":", pos); } -# ifdef ZgatewayBT +#ifdef ZgatewayBT if (BTConfig.pubBeaconUuidForTopic && !BTConfig.extDecoderEnable && Jsondata.containsKey("model_id") && Jsondata["model_id"].as() == "IBEACON") { if (Jsondata.containsKey("uuid")) { topic = Jsondata["uuid"].as(); @@ -514,7 +498,7 @@ void buildTopicFromId(JsonObject& Jsondata, const char* origin) { if (BTConfig.extDecoderEnable && !Jsondata.containsKey("model")) topic = BTConfig.extDecoderTopic.c_str(); -# endif +#endif std::string subjectStr(origin); topic = subjectStr + "/" + topic; @@ -540,9 +524,6 @@ void emptyQueue() { pubMainCore(obj); queueLengthSum++; } -#else -void emptyQueue() {} -#endif /** * @brief Publish the payload on default MQTT topic. @@ -1192,9 +1173,7 @@ void setup() { delay(1500); #if defined(ZgatewayRF) || defined(ZgatewayPilight) || defined(ZgatewayRTL_433) || defined(ZgatewayRF2) || defined(ZactuatorSomfy) -# ifndef ARDUINO_AVR_UNO setupCommonRF(); -# endif #endif #ifdef ZsensorBME280 setupZsensorBME280(); @@ -1351,11 +1330,9 @@ void setup() { #endif Log.trace(F("mqtt_max_packet_size: %d" CR), mqtt_max_packet_size); -#ifndef ARDUINO_AVR_UNO // Space issues with the UNO char jsonChar[100]; serializeJson(modules, jsonChar, measureJson(modules) + 1); Log.notice(F("OpenMQTTGateway modules: %s" CR), jsonChar); -#endif Log.notice(F("************** Setup OpenMQTTGateway end **************" CR)); } @@ -2105,47 +2082,45 @@ void loop() { #endif connectedOnce = true; connected = true; -#if defined(ESP8266) || defined(ESP32) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) if (now > (timer_sys_measures + (TimeBetweenReadingSYS * 1000)) || !timer_sys_measures) { timer_sys_measures = millis(); stateMeasures(); -# ifdef ZgatewayBT +#ifdef ZgatewayBT stateBTMeasures(false); -# endif -# ifdef ZactuatorONOFF +#endif +#ifdef ZactuatorONOFF stateONOFFMeasures(); -# endif -# ifdef ZdisplaySSD1306 +#endif +#ifdef ZdisplaySSD1306 stateSSD1306Display(); -# endif -# ifdef ZgatewayLORA +#endif +#ifdef ZgatewayLORA stateLORAMeasures(); -# endif -# if defined(ZgatewayRTL_433) || defined(ZgatewayPilight) || defined(ZgatewayRF) || defined(ZgatewayRF2) || defined(ZactuatorSomfy) +#endif +#if defined(ZgatewayRTL_433) || defined(ZgatewayPilight) || defined(ZgatewayRF) || defined(ZgatewayRF2) || defined(ZactuatorSomfy) stateRFMeasures(); -# endif -# if defined(ZwebUI) && defined(ESP32) +#endif +#if defined(ZwebUI) && defined(ESP32) stateWebUIStatus(); -# endif +#endif } if (now > (timer_sys_checks + (TimeBetweenCheckingSYS * 1000)) || !timer_sys_checks) { -# if defined(ESP8266) || defined(ESP32) -# if message_UTCtimestamp || message_unixtimestamp +#if defined(ESP8266) || defined(ESP32) +# if message_UTCtimestamp || message_unixtimestamp syncNTP(); -# endif # endif +#endif if (!timer_sys_checks) { // Update check at start up only -# if defined(ESP32) && defined(MQTT_HTTPS_FW_UPDATE) +#if defined(ESP32) && defined(MQTT_HTTPS_FW_UPDATE) checkForUpdates(); -# endif -# ifdef ZgatewayBT +#endif +#ifdef ZgatewayBT BTProcessLock = !BTConfig.enabled; // Release BLE processes at start if enabled -# endif +#endif } timer_sys_checks = millis(); } -#endif emptyQueue(); #ifdef ZsensorBME280 MeasureTempHumAndPressure(); //Addon to measure Temperature, Humidity, Pressure and Altitude with a Bosch BME280/BMP280 @@ -2400,55 +2375,54 @@ void eraseAndRestart() { #endif -#if defined(ESP8266) || defined(ESP32) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) String stateMeasures() { StaticJsonDocument SYSdata; SYSdata["uptime"] = uptime(); SYSdata["version"] = OMG_VERSION; -# ifdef RGB_INDICATORS +#ifdef RGB_INDICATORS SYSdata["rgbb"] = SYSConfig.rgbbrightness; -# endif -# ifdef ZmqttDiscovery +#endif +#ifdef ZmqttDiscovery SYSdata["disc"] = SYSConfig.discovery; SYSdata["ohdisc"] = SYSConfig.ohdiscovery; -# endif -# if defined(ESP8266) || defined(ESP32) +#endif +#if defined(ESP8266) || defined(ESP32) SYSdata["env"] = ENV_NAME; uint32_t freeMem; uint32_t minFreeMem; freeMem = ESP.getFreeHeap(); -# ifdef ZgatewayRTL_433 +# ifdef ZgatewayRTL_433 // Some RTL_433 decoders have memory leak, this is a temporary workaround if (freeMem < MinimumMemory) { Log.error(F("Not enough memory %d, restarting" CR), freeMem); ESPRestart(8); } -# endif +# endif SYSdata["freemem"] = freeMem; SYSdata["mqttp"] = mqtt_port; SYSdata["mqtts"] = mqtt_secure; SYSdata["msgprc"] = queueLengthSum; SYSdata["msgblck"] = blockedMessages; SYSdata["maxq"] = maxQueueLength; -# ifdef ESP32 +# ifdef ESP32 minFreeMem = ESP.getMinFreeHeap(); SYSdata["minmem"] = minFreeMem; -# ifndef NO_INT_TEMP_READING +# ifndef NO_INT_TEMP_READING SYSdata["tempc"] = round2(intTemperatureRead()); -# endif - SYSdata["freestck"] = uxTaskGetStackHighWaterMark(NULL); # endif + SYSdata["freestck"] = uxTaskGetStackHighWaterMark(NULL); +# endif SYSdata["eth"] = ethConnected; if (ethConnected) { -# ifdef ESP32_ETHERNET +# ifdef ESP32_ETHERNET SYSdata["mac"] = (char*)ETH.macAddress().c_str(); SYSdata["ip"] = ip2CharArray(ETH.localIP()); ETH.fullDuplex() ? SYSdata["fd"] = (bool)"true" : SYSdata["fd"] = (bool)"false"; SYSdata["linkspeed"] = (int)ETH.linkSpeed(); -# endif +# endif } else { SYSdata["rssi"] = (long)WiFi.RSSI(); SYSdata["SSID"] = (char*)WiFi.SSID().c_str(); @@ -2457,19 +2431,19 @@ String stateMeasures() { SYSdata["mac"] = (char*)WiFi.macAddress().c_str(); } -# endif -# ifdef ZgatewayBT -# ifdef ESP32 +#endif +#ifdef ZgatewayBT +# ifdef ESP32 SYSdata["lowpowermode"] = (int)lowpowermode; -# endif # endif -# ifdef ZboardM5STACK +#endif +#ifdef ZboardM5STACK M5.Power.begin(); SYSdata["m5battlevel"] = (int8_t)M5.Power.getBatteryLevel(); SYSdata["m5ischarging"] = (bool)M5.Power.isCharging(); SYSdata["m5ischargefull"] = (bool)M5.Power.isChargeFull(); -# endif -# if defined(ZboardM5STICKC) || defined(ZboardM5STICKCP) || defined(ZboardM5TOUGH) +#endif +#if defined(ZboardM5STICKC) || defined(ZboardM5STICKCP) || defined(ZboardM5TOUGH) M5.Axp.EnableCoulombcounter(); SYSdata["m5batvoltage"] = (float)M5.Axp.GetBatVoltage(); SYSdata["m5batcurrent"] = (float)M5.Axp.GetBatCurrent(); @@ -2481,7 +2455,7 @@ String stateMeasures() { SYSdata["m5batpower"] = (float)M5.Axp.GetBatPower(); SYSdata["m5batchargecurrent"] = (float)M5.Axp.GetBatChargeCurrent(); SYSdata["m5apsvoltage"] = (float)M5.Axp.GetAPSVoltage(); -# endif +#endif SYSdata["modules"] = modules; SYSdata["origin"] = subjectSYStoMQTT; @@ -2504,7 +2478,6 @@ String stateMeasures() { serializeJson(SYSdata, output); return output; } -#endif #if defined(ZgatewayRF) || defined(ZgatewayIR) || defined(ZgatewaySRFB) || defined(ZgatewayWeatherStation) || defined(ZgatewayRTL_433) /** @@ -3119,7 +3092,6 @@ void MQTTtoSYS(char* topicOri, JsonObject& SYSdata) { // json object decoding } #if valueAsATopic && !defined(ZgatewayPilight) -# if defined(ESP32) || defined(ESP8266) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) String toString(uint64_t input) { String result = ""; uint8_t base = 10; @@ -3137,12 +3109,11 @@ String toString(uint64_t input) { return result; } -# else +#else String toString(uint32_t input) { String result = String(input); return result; } -# endif #endif diff --git a/platformio.ini b/platformio.ini index 7a4038d56d..ba1d261561 100644 --- a/platformio.ini +++ b/platformio.ini @@ -119,7 +119,6 @@ rc-switch = https://github.com/1technophile/rc-switch.git#98537e9 newremoteswitch = https://github.com/1technophile/NewRemoteSwitch.git#8eb980e ble = https://github.com/h2zero/NimBLE-Arduino.git#1.4.1 irremoteesp = IRremoteESP8266@2.8.2 -irremote = https://github.com/z3t0/Arduino-IRremote.git#1c08a37 lora = https://github.com/sandeepmistry/arduino-LoRa.git#f4a1d27 esppilight = ESPiLight@0.17.0 rfWeatherStation = WeatherStationDataRx@0.3.1