Skip to content

Commit

Permalink
Merge pull request #564 from blinker-iot/dev_3.0
Browse files Browse the repository at this point in the history
update codes, upgrade MQTT EXTRA TOPIC codes.
  • Loading branch information
i3water authored Feb 27, 2021
2 parents 37c268d + ee67e1a commit 73d7058
Show file tree
Hide file tree
Showing 99 changed files with 257 additions and 204 deletions.
4 changes: 2 additions & 2 deletions examples/Blinker_AHRS/AHRS_BLE/AHRS_BLE.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
4 changes: 2 additions & 2 deletions examples/Blinker_AHRS/AHRS_WiFi/AHRS_WiFi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
24 changes: 22 additions & 2 deletions examples/Blinker_APCONFIG/APCONFIG_WiFi/APCONFIG_WiFi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand All @@ -48,8 +48,26 @@

#include <Blinker.h>

// Download OneButton library here:
// https://github.com/mathertel/OneButton
#include "OneButton.h"

#if defined(ESP32)
#define BLINKER_BUTTON_PIN 4
#else
#define BLINKER_BUTTON_PIN D7
#endif
// button trigged when pin input level is LOW
OneButton button(BLINKER_BUTTON_PIN, true);

char auth[] = "Your Device Secret Key";

void deviceReset()
{
// Reset device ,erase WiFi config.
Blinker.reset();
}

void dataRead(const String & data)
{
BLINKER_LOG("Blinker readString: ", data);
Expand All @@ -71,9 +89,11 @@ void setup()

Blinker.begin(auth);
Blinker.attachData(dataRead);
button.attachLongPressStop(deviceReset);
}

void loop()
{
Blinker.run();
button.tick();
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
4 changes: 2 additions & 2 deletions examples/Blinker_AUTO/AUTO_Pro/AUTO_Pro.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
4 changes: 2 additions & 2 deletions examples/Blinker_AUTO/AUTO_WiFi/AUTO_WiFi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
6 changes: 4 additions & 2 deletions examples/Blinker_AliGenie/AliGenie_LIGHT/AliGenie_LIGHT.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down Expand Up @@ -144,6 +144,8 @@ void aligeniePowerState(const String & state)
BlinkerAliGenie.print();

wsState = false;

colorW == 0;
}

pixelShow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
4 changes: 2 additions & 2 deletions examples/Blinker_AliGenie/AliGenie_OUTLET/AliGenie_OUTLET.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
4 changes: 2 additions & 2 deletions examples/Blinker_AliGenie/AliGenie_SENSOR/AliGenie_SENSOR.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
4 changes: 2 additions & 2 deletions examples/Blinker_BMP180/BMP180_WiFi/BMP180_WiFi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
4 changes: 2 additions & 2 deletions examples/Blinker_Bridge/Bridge_WiFi/Bridge_WiFi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
4 changes: 2 additions & 2 deletions examples/Blinker_Button/Button_BLE/Button_BLE.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
4 changes: 2 additions & 2 deletions examples/Blinker_Button/Button_WiFi/Button_WiFi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
4 changes: 2 additions & 2 deletions examples/Blinker_CLOUDDATA/CLOUDDATA_WiFi/CLOUDDATA_WiFi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
4 changes: 2 additions & 2 deletions examples/Blinker_DHT/DHT_BLE/DHT_BLE.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.4 or later ESP32/Arduino package,
* Make sure installed 1.0.5 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
Expand All @@ -35,7 +35,7 @@
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.4 或更新的 ESP32/Arduino 支持包。
* 请确保安装了 1.0.5 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
Expand Down
Loading

0 comments on commit 73d7058

Please sign in to comment.