Refactor LED management (#745)
-replace low power led by led info -enable to change the led ON value -go upper case for the led macros Also transform BLE connect warning to notice in log Add Sonoff RF Bridge LED
This commit is contained in:
1 parent
5e2d86e963
commit
7b9944d1ca
6 files changed
+86
-65
No files matched your search
@@ -7,3 +7,18 @@
|
|||||||
## Erase the ESP settings
|
## Erase the ESP settings
|
||||||
|
|
||||||
`mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoSYS/config" -m '{"cmd":"erase"}'`
|
`mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoSYS/config" -m '{"cmd":"erase"}'`
|
||||||
|
|
||||||
|
# State LED usage
|
||||||
|
|
||||||
|
The gateway can support up to 3 LED to display its operating state:
|
||||||
|
* LED_INFO
|
||||||
|
switched ON when network and MQTT connection are OK
|
||||||
|
5s ON, 5s OFF when WIFI is disconnected
|
||||||
|
1s ON, 4s OFF when MQTT is disconnected
|
||||||
|
|
||||||
|
* LED_RECEIVE
|
||||||
|
Blink for `TimeLedON` 0.5s when the gateway receive a signal from one of its module so as to send to MQTT
|
||||||
|
|
||||||
|
* LED_SEND
|
||||||
|
Blink for `TimeLedON` 0.5s when the gateway send a signal with one of its module from an MQTT command
|
||||||
|
|
||||||
+27
-23
@@ -174,18 +174,12 @@ const char* certificate CERT_ATTRIBUTE = R"EOF("
|
|||||||
|
|
||||||
/*------------------DEEP SLEEP parameters ------------------*/
|
/*------------------DEEP SLEEP parameters ------------------*/
|
||||||
//DEFAULT_LOW_POWER_MODE 0 to normal mode (no power consumption optimisations)
|
//DEFAULT_LOW_POWER_MODE 0 to normal mode (no power consumption optimisations)
|
||||||
//DEFAULT_LOW_POWER_MODE 1 to activate deep sleep with LCD ON when a function is processing,
|
//DEFAULT_LOW_POWER_MODE 1 to activate deep sleep
|
||||||
//DEFAULT_LOW_POWER_MODE 2 to activate deep sleep with LED ON when a function is processing (LCD is turned OFF)
|
//DEFAULT_LOW_POWER_MODE 2 to activate deep sleep (LCD is turned OFF)
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
# ifndef DEFAULT_LOW_POWER_MODE
|
# ifndef DEFAULT_LOW_POWER_MODE
|
||||||
# define DEFAULT_LOW_POWER_MODE 0
|
# define DEFAULT_LOW_POWER_MODE 0
|
||||||
# endif
|
# endif
|
||||||
# ifndef LOW_POWER_LED
|
|
||||||
# define LOW_POWER_LED 2
|
|
||||||
# endif
|
|
||||||
# ifndef LOW_POWER_LED_OFF
|
|
||||||
# define LOW_POWER_LED_OFF 1
|
|
||||||
# endif
|
|
||||||
int low_power_mode = DEFAULT_LOW_POWER_MODE;
|
int low_power_mode = DEFAULT_LOW_POWER_MODE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -282,39 +276,48 @@ uint8_t wifiProtocol = 0; // default mode, automatic selection
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*-------------DEFINE PINs FOR STATUS LEDs----------------*/
|
/*-------------DEFINE PINs FOR STATUS LEDs----------------*/
|
||||||
#ifndef led_receive
|
#ifndef LED_RECEIVE
|
||||||
# ifdef ESP8266
|
# ifdef ESP8266
|
||||||
# define led_receive 40
|
# define LED_RECEIVE 40
|
||||||
# elif ESP32
|
# elif ESP32
|
||||||
# define led_receive 40
|
# define LED_RECEIVE 40
|
||||||
# elif __AVR_ATmega2560__ //arduino mega
|
# elif __AVR_ATmega2560__ //arduino mega
|
||||||
# define led_receive 40
|
# define LED_RECEIVE 40
|
||||||
# else //arduino uno/nano
|
# else //arduino uno/nano
|
||||||
# define led_receive 40
|
# define LED_RECEIVE 40
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef led_send
|
#ifndef LED_RECEIVE_ON
|
||||||
|
# define LED_RECEIVE_ON HIGH
|
||||||
|
#endif
|
||||||
|
#ifndef LED_SEND
|
||||||
# ifdef ESP8266
|
# ifdef ESP8266
|
||||||
# define led_send 42
|
# define LED_SEND 42
|
||||||
# elif ESP32
|
# elif ESP32
|
||||||
# define led_send 42
|
# define LED_SEND 42
|
||||||
# elif __AVR_ATmega2560__ //arduino mega
|
# elif __AVR_ATmega2560__ //arduino mega
|
||||||
# define led_send 42
|
# define LED_SEND 42
|
||||||
# else //arduino uno/nano
|
# else //arduino uno/nano
|
||||||
# define led_send 42
|
# define LED_SEND 42
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef led_info
|
#ifndef LED_SEND_ON
|
||||||
|
# define LED_SEND_ON HIGH
|
||||||
|
#endif
|
||||||
|
#ifndef LED_INFO
|
||||||
# ifdef ESP8266
|
# ifdef ESP8266
|
||||||
# define led_info 44
|
# define LED_INFO 44
|
||||||
# elif ESP32
|
# elif ESP32
|
||||||
# define led_info 44
|
# define LED_INFO 44
|
||||||
# elif __AVR_ATmega2560__ //arduino mega
|
# elif __AVR_ATmega2560__ //arduino mega
|
||||||
# define led_info 44
|
# define LED_INFO 44
|
||||||
# else //arduino uno/nano
|
# else //arduino uno/nano
|
||||||
# define led_info 44
|
# define LED_INFO 44
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef LED_INFO_ON
|
||||||
|
# define LED_INFO_ON HIGH
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
//# define TRIGGER_GPIO 14 // pin D5 as full reset button (long press >10s)
|
//# define TRIGGER_GPIO 14 // pin D5 as full reset button (long press >10s)
|
||||||
@@ -366,6 +369,7 @@ uint8_t wifiProtocol = 0; // default mode, automatic selection
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TimeBetweenReadingSYS 120 // time between (s) system readings (like memory)
|
#define TimeBetweenReadingSYS 120 // time between (s) system readings (like memory)
|
||||||
|
#define TimeLedON 0.5 // time LED are ON
|
||||||
#define InitialMQTTConnectionTimeout 10 // time estimated (s) before the board is connected to MQTT
|
#define InitialMQTTConnectionTimeout 10 // time estimated (s) before the board is connected to MQTT
|
||||||
#define subjectSYStoMQTT "/SYStoMQTT"
|
#define subjectSYStoMQTT "/SYStoMQTT"
|
||||||
#define subjectMQTTtoSYSset "/commands/MQTTtoSYS/config"
|
#define subjectMQTTtoSYSset "/commands/MQTTtoSYS/config"
|
||||||
|
|||||||
+2
-2
@@ -215,7 +215,7 @@ void drawLogo(int logoSize, int circle1X, int circle1Y, bool circle1, bool circl
|
|||||||
}
|
}
|
||||||
|
|
||||||
void M5Display(char* line1, char* line2, char* line3) {
|
void M5Display(char* line1, char* line2, char* line3) {
|
||||||
if (low_power_mode == 2) digitalWrite(LOW_POWER_LED, 1 - LOW_POWER_LED_OFF);
|
if (low_power_mode == 2) digitalWrite(LED_INFO, LED_INFO_ON);
|
||||||
wakeScreen(NORMAL_LCD_BRIGHTNESS);
|
wakeScreen(NORMAL_LCD_BRIGHTNESS);
|
||||||
M5.Lcd.fillScreen(TFT_WHITE);
|
M5.Lcd.fillScreen(TFT_WHITE);
|
||||||
drawLogo(M5.Lcd.width() * 0.1875, (M5.Lcd.width() / 2) - M5.Lcd.width() * 0.24, M5.Lcd.height() * 0.5, true, true, true, true, true, true);
|
drawLogo(M5.Lcd.width() * 0.1875, (M5.Lcd.width() / 2) - M5.Lcd.width() * 0.24, M5.Lcd.height() * 0.5, true, true, true, true, true, true);
|
||||||
@@ -224,6 +224,6 @@ void M5Display(char* line1, char* line2, char* line3) {
|
|||||||
M5.Lcd.drawString(line2, 5, M5.Lcd.height() * 0.8, 1);
|
M5.Lcd.drawString(line2, 5, M5.Lcd.height() * 0.8, 1);
|
||||||
M5.Lcd.drawString(line3, 5, M5.Lcd.height() * 0.9, 1);
|
M5.Lcd.drawString(line3, 5, M5.Lcd.height() * 0.9, 1);
|
||||||
delay(2000);
|
delay(2000);
|
||||||
digitalWrite(LOW_POWER_LED, LOW_POWER_LED_OFF); // to switch off no need of condition
|
digitalWrite(LED_INFO, !LED_INFO_ON); // to switch off no need of condition
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
+5
-11
@@ -527,7 +527,7 @@ void notifyCB(
|
|||||||
String mactopic = subjectBTtoMQTT + String("/") + mac_adress;
|
String mactopic = subjectBTtoMQTT + String("/") + mac_adress;
|
||||||
pub((char*)mactopic.c_str(), BLEdata);
|
pub((char*)mactopic.c_str(), BLEdata);
|
||||||
} else {
|
} else {
|
||||||
Log.warning(F("Device not identified" CR));
|
Log.notice(F("Device not identified" CR));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.trace(F("Callback process canceled by processLock" CR));
|
Log.trace(F("Callback process canceled by processLock" CR));
|
||||||
@@ -550,12 +550,12 @@ void BLEconnect() {
|
|||||||
BLEUUID charUUID("ebe0ccc1-7a0a-4b0c-8a1a-6ff2997da3a6");
|
BLEUUID charUUID("ebe0ccc1-7a0a-4b0c-8a1a-6ff2997da3a6");
|
||||||
BLEAddress sensorAddress(p->macAdr);
|
BLEAddress sensorAddress(p->macAdr);
|
||||||
if (!pClient->connect(sensorAddress)) {
|
if (!pClient->connect(sensorAddress)) {
|
||||||
Log.warning(F("Failed to find client: %s" CR), p->macAdr);
|
Log.notice(F("Failed to find client: %s" CR), p->macAdr);
|
||||||
NimBLEDevice::deleteClient(pClient);
|
NimBLEDevice::deleteClient(pClient);
|
||||||
} else {
|
} else {
|
||||||
BLERemoteService* pRemoteService = pClient->getService(serviceUUID);
|
BLERemoteService* pRemoteService = pClient->getService(serviceUUID);
|
||||||
if (!pRemoteService) {
|
if (!pRemoteService) {
|
||||||
Log.warning(F("Failed to find service UUID: %s" CR), serviceUUID.toString().c_str());
|
Log.notice(F("Failed to find service UUID: %s" CR), serviceUUID.toString().c_str());
|
||||||
pClient->disconnect();
|
pClient->disconnect();
|
||||||
} else {
|
} else {
|
||||||
Log.trace(F("Found service: %s" CR), serviceUUID.toString().c_str());
|
Log.trace(F("Found service: %s" CR), serviceUUID.toString().c_str());
|
||||||
@@ -564,14 +564,14 @@ void BLEconnect() {
|
|||||||
Log.trace(F("Client isConnected, freeHeap: %d" CR), ESP.getFreeHeap());
|
Log.trace(F("Client isConnected, freeHeap: %d" CR), ESP.getFreeHeap());
|
||||||
BLERemoteCharacteristic* pRemoteCharacteristic = pRemoteService->getCharacteristic(charUUID);
|
BLERemoteCharacteristic* pRemoteCharacteristic = pRemoteService->getCharacteristic(charUUID);
|
||||||
if (!pRemoteCharacteristic) {
|
if (!pRemoteCharacteristic) {
|
||||||
Log.warning(F("Failed to find characteristic UUID: %s" CR), charUUID.toString().c_str());
|
Log.notice(F("Failed to find characteristic UUID: %s" CR), charUUID.toString().c_str());
|
||||||
pClient->disconnect();
|
pClient->disconnect();
|
||||||
} else {
|
} else {
|
||||||
if (pRemoteCharacteristic->canNotify()) {
|
if (pRemoteCharacteristic->canNotify()) {
|
||||||
Log.trace(F("Registering notification" CR));
|
Log.trace(F("Registering notification" CR));
|
||||||
pRemoteCharacteristic->subscribe(true, notifyCB);
|
pRemoteCharacteristic->subscribe(true, notifyCB);
|
||||||
} else {
|
} else {
|
||||||
Log.warning(F("Failed registering notification" CR));
|
Log.notice(F("Failed registering notification" CR));
|
||||||
pClient->disconnect();
|
pClient->disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -606,18 +606,12 @@ void coreTask(void* pvParameters) {
|
|||||||
if (client.state() != 0) {
|
if (client.state() != 0) {
|
||||||
Log.warning(F("MQTT client disconnected no BLE scan" CR));
|
Log.warning(F("MQTT client disconnected no BLE scan" CR));
|
||||||
} else {
|
} else {
|
||||||
pinMode(LOW_POWER_LED, OUTPUT);
|
|
||||||
if (low_power_mode == 2)
|
|
||||||
digitalWrite(LOW_POWER_LED, 1 - LOW_POWER_LED_OFF);
|
|
||||||
BLEscan();
|
BLEscan();
|
||||||
// Launching a connect every BLEscanBeforeConnect
|
// Launching a connect every BLEscanBeforeConnect
|
||||||
if (!(scanCount % BLEscanBeforeConnect) || scanCount == 1)
|
if (!(scanCount % BLEscanBeforeConnect) || scanCount == 1)
|
||||||
BLEconnect();
|
BLEconnect();
|
||||||
launchDiscovery();
|
launchDiscovery();
|
||||||
dumpDevices();
|
dumpDevices();
|
||||||
// Only change LOW_POWER_LED if low power mode is enabled
|
|
||||||
if (low_power_mode)
|
|
||||||
digitalWrite(LOW_POWER_LED, LOW_POWER_LED_OFF);
|
|
||||||
}
|
}
|
||||||
if (low_power_mode) {
|
if (low_power_mode) {
|
||||||
lowPowerESP32();
|
lowPowerESP32();
|
||||||
|
|||||||
+27
-21
@@ -144,6 +144,8 @@ bool connectedOnce = false; //indicate if we have been connected once to MQTT
|
|||||||
int failure_number_ntwk = 0; // number of failure connecting to network
|
int failure_number_ntwk = 0; // number of failure connecting to network
|
||||||
int failure_number_mqtt = 0; // number of failure connecting to MQTT
|
int failure_number_mqtt = 0; // number of failure connecting to MQTT
|
||||||
|
|
||||||
|
unsigned long timer_led_measures = 0;
|
||||||
|
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
# include <ArduinoOTA.h>
|
# include <ArduinoOTA.h>
|
||||||
# include <FS.h>
|
# include <FS.h>
|
||||||
@@ -236,9 +238,9 @@ void pub(char* topicori, char* payload, bool retainFlag) {
|
|||||||
|
|
||||||
void pub(char* topicori, JsonObject& data) {
|
void pub(char* topicori, JsonObject& data) {
|
||||||
Log.notice(F("Subject: %s" CR), topicori);
|
Log.notice(F("Subject: %s" CR), topicori);
|
||||||
|
digitalWrite(LED_RECEIVE, LED_RECEIVE_ON);
|
||||||
logJson(data);
|
logJson(data);
|
||||||
if (client.connected()) {
|
if (client.connected()) {
|
||||||
digitalWrite(led_receive, HIGH);
|
|
||||||
String topic = String(mqtt_topic) + String(topicori);
|
String topic = String(mqtt_topic) + String(topicori);
|
||||||
#ifdef valueAsASubject
|
#ifdef valueAsASubject
|
||||||
SIGNAL_SIZE_UL_ULL value = data["value"];
|
SIGNAL_SIZE_UL_ULL value = data["value"];
|
||||||
@@ -463,7 +465,10 @@ void connectMQTT() {
|
|||||||
#elif defined(SECURE_CONNECTION) && defined(ESP8266)
|
#elif defined(SECURE_CONNECTION) && defined(ESP8266)
|
||||||
Log.warning(F("failed, ssl error code=%d" CR), eClient.getLastSSLError());
|
Log.warning(F("failed, ssl error code=%d" CR), eClient.getLastSSLError());
|
||||||
#endif
|
#endif
|
||||||
delay(5000);
|
digitalWrite(LED_INFO, LED_INFO_ON);
|
||||||
|
delay(1000);
|
||||||
|
digitalWrite(LED_INFO, !LED_INFO_ON);
|
||||||
|
delay(4000);
|
||||||
#if defined(ESP8266) || defined(ESP32)
|
#if defined(ESP8266) || defined(ESP32)
|
||||||
disconnection_handling(failure_number_mqtt);
|
disconnection_handling(failure_number_mqtt);
|
||||||
#endif
|
#endif
|
||||||
@@ -538,12 +543,12 @@ void setup() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//setup LED status
|
//setup LED status
|
||||||
pinMode(led_receive, OUTPUT);
|
pinMode(LED_RECEIVE, OUTPUT);
|
||||||
pinMode(led_send, OUTPUT);
|
pinMode(LED_SEND, OUTPUT);
|
||||||
pinMode(led_info, OUTPUT);
|
pinMode(LED_INFO, OUTPUT);
|
||||||
digitalWrite(led_receive, LOW);
|
digitalWrite(LED_RECEIVE, !LED_RECEIVE_ON);
|
||||||
digitalWrite(led_send, LOW);
|
digitalWrite(LED_SEND, !LED_SEND_ON);
|
||||||
digitalWrite(led_info, LOW);
|
digitalWrite(LED_INFO, !LED_INFO_ON);
|
||||||
|
|
||||||
#if defined(MDNS_SD) && defined(ESP8266)
|
#if defined(MDNS_SD) && defined(ESP8266)
|
||||||
Log.trace(F("Connecting to MQTT by mDNS without mqtt hostname" CR));
|
Log.trace(F("Connecting to MQTT by mDNS without mqtt hostname" CR));
|
||||||
@@ -1087,12 +1092,16 @@ void loop() {
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
digitalWrite(led_receive, LOW);
|
|
||||||
digitalWrite(led_info, LOW);
|
|
||||||
digitalWrite(led_send, LOW);
|
|
||||||
|
|
||||||
unsigned long now = millis();
|
unsigned long now = millis();
|
||||||
|
|
||||||
|
// Switch off of the LED after TimeLedON
|
||||||
|
if (now > (timer_led_measures + (TimeLedON * 1000))) {
|
||||||
|
timer_led_measures = millis();
|
||||||
|
digitalWrite(LED_RECEIVE, !LED_RECEIVE_ON);
|
||||||
|
digitalWrite(LED_INFO, !LED_INFO_ON);
|
||||||
|
digitalWrite(LED_SEND, !LED_SEND_ON);
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(ESP8266) || defined(ESP32)
|
#if defined(ESP8266) || defined(ESP32)
|
||||||
if (WiFi.status() == WL_CONNECTED) {
|
if (WiFi.status() == WL_CONNECTED) {
|
||||||
ArduinoOTA.handle();
|
ArduinoOTA.handle();
|
||||||
@@ -1104,7 +1113,7 @@ void loop() {
|
|||||||
#ifdef ZmqttDiscovery
|
#ifdef ZmqttDiscovery
|
||||||
if (!connectedOnce) pubMqttDiscovery(); // at first connection we publish the discovery payloads
|
if (!connectedOnce) pubMqttDiscovery(); // at first connection we publish the discovery payloads
|
||||||
#endif
|
#endif
|
||||||
|
digitalWrite(LED_INFO, LED_INFO_ON);
|
||||||
connectedOnce = true;
|
connectedOnce = true;
|
||||||
failure_number_ntwk = 0;
|
failure_number_ntwk = 0;
|
||||||
|
|
||||||
@@ -1199,7 +1208,10 @@ void loop() {
|
|||||||
} else { // disconnected from network
|
} else { // disconnected from network
|
||||||
#if defined(ESP8266) || defined(ESP32)
|
#if defined(ESP8266) || defined(ESP32)
|
||||||
Log.warning(F("wifi disconnected" CR));
|
Log.warning(F("wifi disconnected" CR));
|
||||||
delay(10000); // add a delay to avoid ESP32 crash and reset
|
digitalWrite(LED_INFO, LED_INFO_ON);
|
||||||
|
delay(5000); // add a delay to avoid ESP32 crash and reset
|
||||||
|
digitalWrite(LED_INFO, !LED_INFO_ON);
|
||||||
|
delay(5000);
|
||||||
failure_number_ntwk++;
|
failure_number_ntwk++;
|
||||||
disconnection_handling(failure_number_ntwk);
|
disconnection_handling(failure_number_ntwk);
|
||||||
#else
|
#else
|
||||||
@@ -1413,7 +1425,6 @@ void receivingMQTT(char* topicOri, char* datacallback) {
|
|||||||
if (jsondata.success()) { // json object ok -> json decoding
|
if (jsondata.success()) { // json object ok -> json decoding
|
||||||
// log the received json
|
// log the received json
|
||||||
logJson(jsondata);
|
logJson(jsondata);
|
||||||
|
|
||||||
#ifdef ZgatewayPilight // ZgatewayPilight is only defined with json publishing due to its numerous parameters
|
#ifdef ZgatewayPilight // ZgatewayPilight is only defined with json publishing due to its numerous parameters
|
||||||
MQTTtoPilight(topicOri, jsondata);
|
MQTTtoPilight(topicOri, jsondata);
|
||||||
#endif
|
#endif
|
||||||
@@ -1452,8 +1463,7 @@ void receivingMQTT(char* topicOri, char* datacallback) {
|
|||||||
MQTTtoONOFF(topicOri, jsondata);
|
MQTTtoONOFF(topicOri, jsondata);
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
digitalWrite(LED_SEND, LED_SEND_ON);
|
||||||
digitalWrite(led_send, HIGH);
|
|
||||||
|
|
||||||
MQTTtoSYS(topicOri, jsondata);
|
MQTTtoSYS(topicOri, jsondata);
|
||||||
} else { // not a json object --> simple decoding
|
} else { // not a json object --> simple decoding
|
||||||
@@ -1486,11 +1496,7 @@ void receivingMQTT(char* topicOri, char* datacallback) {
|
|||||||
#ifdef ZactuatorONOFF
|
#ifdef ZactuatorONOFF
|
||||||
MQTTtoONOFF(topicOri, datacallback);
|
MQTTtoONOFF(topicOri, datacallback);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
digitalWrite(led_send, HIGH);
|
|
||||||
}
|
}
|
||||||
//YELLOW OFF
|
|
||||||
digitalWrite(led_send, HIGH);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MQTTtoSYS(char* topicOri, JsonObject& SYSdata) { // json object decoding
|
void MQTTtoSYS(char* topicOri, JsonObject& SYSdata) { // json object decoding
|
||||||
|
|||||||
+10
-8
@@ -163,6 +163,8 @@ lib_deps =
|
|||||||
build_flags =
|
build_flags =
|
||||||
${com-esp.build_flags}
|
${com-esp.build_flags}
|
||||||
'-DZgatewaySRFB="SRFB"'
|
'-DZgatewaySRFB="SRFB"'
|
||||||
|
'-DLED_INFO=13'
|
||||||
|
'-DLED_INFO_ON=0'
|
||||||
'-DGateway_Name="OpenMQTTGateway_SRFB"'
|
'-DGateway_Name="OpenMQTTGateway_SRFB"'
|
||||||
board_build.flash_mode = dout
|
board_build.flash_mode = dout
|
||||||
|
|
||||||
@@ -284,8 +286,8 @@ lib_deps =
|
|||||||
build_flags =
|
build_flags =
|
||||||
${com-esp.build_flags}
|
${com-esp.build_flags}
|
||||||
'-DZgatewayBT="BT"'
|
'-DZgatewayBT="BT"'
|
||||||
'-DLOW_POWER_LED=2'
|
'-DLED_RECEIVE=2'
|
||||||
'-DLOW_POWER_LED_OFF=1'
|
'-DLED_RECEIVE_ON=0'
|
||||||
'-DGateway_Name="OpenMQTTGateway_ESP32_BLE"'
|
'-DGateway_Name="OpenMQTTGateway_ESP32_BLE"'
|
||||||
|
|
||||||
[env:esp32-m5stick-ble]
|
[env:esp32-m5stick-ble]
|
||||||
@@ -300,8 +302,8 @@ build_flags =
|
|||||||
${com-esp.build_flags}
|
${com-esp.build_flags}
|
||||||
'-DZgatewayBT="BT"'
|
'-DZgatewayBT="BT"'
|
||||||
'-DZgatewayIR="IR"'
|
'-DZgatewayIR="IR"'
|
||||||
'-DLOW_POWER_LED=19'
|
'-DLED_RECEIVE=19'
|
||||||
'-DLOW_POWER_LED_OFF=0'
|
'-DLED_RECEIVE_ON=1'
|
||||||
'-DTRIGGER_GPIO=35'
|
'-DTRIGGER_GPIO=35'
|
||||||
'-DIR_EMITTER_GPIO=17'
|
'-DIR_EMITTER_GPIO=17'
|
||||||
'-DGateway_Name="OpenMQTTGateway_ESP32_M5STICK_BLE_IR"'
|
'-DGateway_Name="OpenMQTTGateway_ESP32_M5STICK_BLE_IR"'
|
||||||
@@ -320,7 +322,7 @@ build_flags =
|
|||||||
'-DZgatewayBT="BT"'
|
'-DZgatewayBT="BT"'
|
||||||
'-DZsensorGPIOInput="GPIOInput"'
|
'-DZsensorGPIOInput="GPIOInput"'
|
||||||
'-DZboardM5STACK="M5Stack"'
|
'-DZboardM5STACK="M5Stack"'
|
||||||
'-DLOW_POWER_LED=15'
|
'-DLED_RECEIVE=15'
|
||||||
'-DTRIGGER_GPIO=37'
|
'-DTRIGGER_GPIO=37'
|
||||||
'-DSLEEP_BUTTON=38'
|
'-DSLEEP_BUTTON=38'
|
||||||
'-DINPUT_GPIO=39'
|
'-DINPUT_GPIO=39'
|
||||||
@@ -344,8 +346,8 @@ build_flags =
|
|||||||
'-DZboardM5STICKC="M5StickC"'
|
'-DZboardM5STICKC="M5StickC"'
|
||||||
'-DACTUATOR_ONOFF_GPIO=10'
|
'-DACTUATOR_ONOFF_GPIO=10'
|
||||||
'-DINPUT_GPIO=37'
|
'-DINPUT_GPIO=37'
|
||||||
'-DLOW_POWER_LED=10'
|
'-DLED_RECEIVE=10'
|
||||||
'-DLOW_POWER_LED_OFF=1'
|
'-DLED_RECEIVE_ON=0'
|
||||||
'-DSLEEP_BUTTON=39'
|
'-DSLEEP_BUTTON=39'
|
||||||
'-DTRIGGER_GPIO=39'
|
'-DTRIGGER_GPIO=39'
|
||||||
'-DIR_EMITTER_INVERTED=true'
|
'-DIR_EMITTER_INVERTED=true'
|
||||||
@@ -485,7 +487,7 @@ build_flags =
|
|||||||
${com-esp.build_flags}
|
${com-esp.build_flags}
|
||||||
'-DZgatewayIR="IR"'
|
'-DZgatewayIR="IR"'
|
||||||
'-DTRIGGER_GPIO=13'
|
'-DTRIGGER_GPIO=13'
|
||||||
'-Dled_send=4'
|
'-DLED_SEND=4'
|
||||||
'-DIR_EMITTER_GPIO=14'
|
'-DIR_EMITTER_GPIO=14'
|
||||||
'-DIR_RECEIVER_GPIO=5'
|
'-DIR_RECEIVER_GPIO=5'
|
||||||
'-DGateway_Name="OpenMQTTGateway_AVATTO_IR"'
|
'-DGateway_Name="OpenMQTTGateway_AVATTO_IR"'
|
||||||
|
|||||||
Reference in new issue
Block a user