Skip to content

Commit

Permalink
Merge pull request #551 from blinker-iot/dev_3.0
Browse files Browse the repository at this point in the history
Dev 3.0
  • Loading branch information
i3water authored Aug 6, 2020
2 parents b9e3aa2 + e999369 commit cdcf388
Show file tree
Hide file tree
Showing 28 changed files with 1,861 additions and 288 deletions.
80 changes: 80 additions & 0 deletions examples/Blinker_DataStorage/Blinker_JsonData/Blinker_JsonData.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/* *****************************************************************
*
* Download latest Blinker library here:
* https://github.com/blinker-iot/blinker-library/archive/master.zip
*
*
* Blinker is a cross-hardware, cross-platform solution for the IoT.
* It provides APP, device and server support,
* and uses public cloud services for data transmission and storage.
* It can be used in smart home, data monitoring and other fields
* to help users build Internet of Things projects better and faster.
*
* Make sure installed 2.5.0 or later ESP8266/Arduino package,
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.2 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
* Docs: https://diandeng.tech/doc
* https://github.com/blinker-iot/blinker-doc/wiki
*
* *****************************************************************
*
* Blinker 库下载地址:
* https://github.com/blinker-iot/blinker-library/archive/master.zip
*
* Blinker 是一套跨硬件、跨平台的物联网解决方案,提供APP端、设备端、
* 服务器端支持,使用公有云服务进行数据传输存储。可用于智能家居、
* 数据监测等领域,可以帮助用户更好更快地搭建物联网项目。
*
* 如果使用 ESP8266 接入 Blinker,
* 请确保安装了 2.5.0 或更新的 ESP8266/Arduino 支持包。
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.2 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
* https://github.com/blinker-iot/blinker-doc/wiki
*
* *****************************************************************/

#define BLINKER_WIFI

#include <Blinker.h>

char auth[] = "Your Device Secret Key";
char ssid[] = "Your WiFi network SSID or name";
char pswd[] = "Your WiFi network WPA password or WEP key";

void dataRead(const String & data)
{
BLINKER_LOG("Blinker readString: ", data);

uint32_t BlinkerTime = millis();

Blinker.jsonData("{\"key\":\"value\"");

digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
}

void setup()
{
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);

pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);

Blinker.begin(auth, ssid, pswd);
Blinker.attachData(dataRead);
}

void loop()
{
Blinker.run();
}
80 changes: 80 additions & 0 deletions examples/Blinker_DataStorage/Blinker_TextData/Blinker_TextData.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/* *****************************************************************
*
* Download latest Blinker library here:
* https://github.com/blinker-iot/blinker-library/archive/master.zip
*
*
* Blinker is a cross-hardware, cross-platform solution for the IoT.
* It provides APP, device and server support,
* and uses public cloud services for data transmission and storage.
* It can be used in smart home, data monitoring and other fields
* to help users build Internet of Things projects better and faster.
*
* Make sure installed 2.5.0 or later ESP8266/Arduino package,
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.2 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
* Docs: https://diandeng.tech/doc
* https://github.com/blinker-iot/blinker-doc/wiki
*
* *****************************************************************
*
* Blinker 库下载地址:
* https://github.com/blinker-iot/blinker-library/archive/master.zip
*
* Blinker 是一套跨硬件、跨平台的物联网解决方案,提供APP端、设备端、
* 服务器端支持,使用公有云服务进行数据传输存储。可用于智能家居、
* 数据监测等领域,可以帮助用户更好更快地搭建物联网项目。
*
* 如果使用 ESP8266 接入 Blinker,
* 请确保安装了 2.5.0 或更新的 ESP8266/Arduino 支持包。
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.2 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
* https://github.com/blinker-iot/blinker-doc/wiki
*
* *****************************************************************/

#define BLINKER_WIFI

#include <Blinker.h>

char auth[] = "Your Device Secret Key";
char ssid[] = "Your WiFi network SSID or name";
char pswd[] = "Your WiFi network WPA password or WEP key";

void dataRead(const String & data)
{
BLINKER_LOG("Blinker readString: ", data);

uint32_t BlinkerTime = millis();

Blinker.textData("text data");

digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
}

void setup()
{
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);

pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);

Blinker.begin(auth, ssid, pswd);
Blinker.attachData(dataRead);
}

void loop()
{
Blinker.run();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/* *****************************************************************
*
* Download latest Blinker library here:
* https://github.com/blinker-iot/blinker-library/archive/master.zip
*
*
* Blinker is a cross-hardware, cross-platform solution for the IoT.
* It provides APP, device and server support,
* and uses public cloud services for data transmission and storage.
* It can be used in smart home, data monitoring and other fields
* to help users build Internet of Things projects better and faster.
*
* Make sure installed 2.5.0 or later ESP8266/Arduino package,
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.2 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
* Docs: https://diandeng.tech/doc
* https://github.com/blinker-iot/blinker-doc/wiki
*
* *****************************************************************
*
* Blinker 库下载地址:
* https://github.com/blinker-iot/blinker-library/archive/master.zip
*
* Blinker 是一套跨硬件、跨平台的物联网解决方案,提供APP端、设备端、
* 服务器端支持,使用公有云服务进行数据传输存储。可用于智能家居、
* 数据监测等领域,可以帮助用户更好更快地搭建物联网项目。
*
* 如果使用 ESP8266 接入 Blinker,
* 请确保安装了 2.5.0 或更新的 ESP8266/Arduino 支持包。
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.2 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
* https://github.com/blinker-iot/blinker-doc/wiki
*
* *****************************************************************/

#define BLINKER_WIFI

#include <Blinker.h>

char auth[] = "Your Device Secret Key";
char ssid[] = "Your WiFi network SSID or name";
char pswd[] = "Your WiFi network WPA password or WEP key";

void dataRead(const String & data)
{
BLINKER_LOG("Blinker readString: ", data);

uint32_t BlinkerTime = millis();

Blinker.vibrate();
Blinker.print("millis", BlinkerTime);

digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
}

void dataStorage()
{
Blinker.timeSlotData("data1", (int32_t)random(0,120));
Blinker.timeSlotData("data2", random(0,120)/(float)1.5);
}

void setup()
{
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);

pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);

Blinker.begin(auth, ssid, pswd);
Blinker.attachData(dataRead);
Blinker.attachDataStorage(dataStorage);
}

void loop()
{
Blinker.run();
}
89 changes: 89 additions & 0 deletions examples/Blinker_ESP32_CAM/Blinker_ESP32_CAM.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/* *****************************************************************
*
* Download latest Blinker library here:
* https://github.com/blinker-iot/blinker-library/archive/master.zip
*
*
* Blinker is a cross-hardware, cross-platform solution for the IoT.
* It provides APP, device and server support,
* and uses public cloud services for data transmission and storage.
* It can be used in smart home, data monitoring and other fields
* to help users build Internet of Things projects better and faster.
*
* Make sure installed 2.5.0 or later ESP8266/Arduino package,
* if use ESP8266 with Blinker.
* https://github.com/esp8266/Arduino/releases
*
* Make sure installed 1.0.2 or later ESP32/Arduino package,
* if use ESP32 with Blinker.
* https://github.com/espressif/arduino-esp32/releases
*
* Docs: https://diandeng.tech/doc
* https://github.com/blinker-iot/blinker-doc/wiki
*
* *****************************************************************
*
* Blinker 库下载地址:
* https://github.com/blinker-iot/blinker-library/archive/master.zip
*
* Blinker 是一套跨硬件、跨平台的物联网解决方案,提供APP端、设备端、
* 服务器端支持,使用公有云服务进行数据传输存储。可用于智能家居、
* 数据监测等领域,可以帮助用户更好更快地搭建物联网项目。
*
* 如果使用 ESP8266 接入 Blinker,
* 请确保安装了 2.5.0 或更新的 ESP8266/Arduino 支持包。
* https://github.com/esp8266/Arduino/releases
*
* 如果使用 ESP32 接入 Blinker,
* 请确保安装了 1.0.2 或更新的 ESP32/Arduino 支持包。
* https://github.com/espressif/arduino-esp32/releases
*
* 文档: https://diandeng.tech/doc
* https://github.com/blinker-iot/blinker-doc/wiki
*
* *****************************************************************/

#define BLINKER_WIFI
#define BLINKER_ESP_SMARTCONFIG

#include <Blinker.h>
#include "ESP32_CAM_SERVER.h"

char auth[] = "Your Device Secret Key";
bool setup_camera = false;

void dataRead(const String & data)
{
BLINKER_LOG("Blinker readString: ", data);

Blinker.vibrate();

uint32_t BlinkerTime = millis();

Blinker.printObject("video", "{\"str\":\"mjpg\",\"url\":\"http:"+ String(WiFi.localIP()) + "\"}");
}

void setup()
{
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);

pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);

Blinker.begin(auth);
Blinker.attachData(dataRead);
}

void loop()
{
Blinker.run();

if (Blinker.connected() && !setup_camera)
{
setupCamera();
setup_camera = true;

Blinker.printObject("video", "{\"str\":\"mjpg\",\"url\":\"http:"+ String(WiFi.localIP()) + "\"}");
}
}
Loading

0 comments on commit cdcf388

Please sign in to comment.