Skip to content

Commit cdcf388

Browse files
authored
Merge pull request #551 from blinker-iot/dev_3.0
Dev 3.0
2 parents b9e3aa2 + e999369 commit cdcf388

28 files changed

+1861
-288
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/* *****************************************************************
2+
*
3+
* Download latest Blinker library here:
4+
* https://github.com/blinker-iot/blinker-library/archive/master.zip
5+
*
6+
*
7+
* Blinker is a cross-hardware, cross-platform solution for the IoT.
8+
* It provides APP, device and server support,
9+
* and uses public cloud services for data transmission and storage.
10+
* It can be used in smart home, data monitoring and other fields
11+
* to help users build Internet of Things projects better and faster.
12+
*
13+
* Make sure installed 2.5.0 or later ESP8266/Arduino package,
14+
* if use ESP8266 with Blinker.
15+
* https://github.com/esp8266/Arduino/releases
16+
*
17+
* Make sure installed 1.0.2 or later ESP32/Arduino package,
18+
* if use ESP32 with Blinker.
19+
* https://github.com/espressif/arduino-esp32/releases
20+
*
21+
* Docs: https://diandeng.tech/doc
22+
* https://github.com/blinker-iot/blinker-doc/wiki
23+
*
24+
* *****************************************************************
25+
*
26+
* Blinker 库下载地址:
27+
* https://github.com/blinker-iot/blinker-library/archive/master.zip
28+
*
29+
* Blinker 是一套跨硬件、跨平台的物联网解决方案,提供APP端、设备端、
30+
* 服务器端支持,使用公有云服务进行数据传输存储。可用于智能家居、
31+
* 数据监测等领域,可以帮助用户更好更快地搭建物联网项目。
32+
*
33+
* 如果使用 ESP8266 接入 Blinker,
34+
* 请确保安装了 2.5.0 或更新的 ESP8266/Arduino 支持包。
35+
* https://github.com/esp8266/Arduino/releases
36+
*
37+
* 如果使用 ESP32 接入 Blinker,
38+
* 请确保安装了 1.0.2 或更新的 ESP32/Arduino 支持包。
39+
* https://github.com/espressif/arduino-esp32/releases
40+
*
41+
* 文档: https://diandeng.tech/doc
42+
* https://github.com/blinker-iot/blinker-doc/wiki
43+
*
44+
* *****************************************************************/
45+
46+
#define BLINKER_WIFI
47+
48+
#include <Blinker.h>
49+
50+
char auth[] = "Your Device Secret Key";
51+
char ssid[] = "Your WiFi network SSID or name";
52+
char pswd[] = "Your WiFi network WPA password or WEP key";
53+
54+
void dataRead(const String & data)
55+
{
56+
BLINKER_LOG("Blinker readString: ", data);
57+
58+
uint32_t BlinkerTime = millis();
59+
60+
Blinker.jsonData("{\"key\":\"value\"");
61+
62+
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
63+
}
64+
65+
void setup()
66+
{
67+
Serial.begin(115200);
68+
BLINKER_DEBUG.stream(Serial);
69+
70+
pinMode(LED_BUILTIN, OUTPUT);
71+
digitalWrite(LED_BUILTIN, LOW);
72+
73+
Blinker.begin(auth, ssid, pswd);
74+
Blinker.attachData(dataRead);
75+
}
76+
77+
void loop()
78+
{
79+
Blinker.run();
80+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/* *****************************************************************
2+
*
3+
* Download latest Blinker library here:
4+
* https://github.com/blinker-iot/blinker-library/archive/master.zip
5+
*
6+
*
7+
* Blinker is a cross-hardware, cross-platform solution for the IoT.
8+
* It provides APP, device and server support,
9+
* and uses public cloud services for data transmission and storage.
10+
* It can be used in smart home, data monitoring and other fields
11+
* to help users build Internet of Things projects better and faster.
12+
*
13+
* Make sure installed 2.5.0 or later ESP8266/Arduino package,
14+
* if use ESP8266 with Blinker.
15+
* https://github.com/esp8266/Arduino/releases
16+
*
17+
* Make sure installed 1.0.2 or later ESP32/Arduino package,
18+
* if use ESP32 with Blinker.
19+
* https://github.com/espressif/arduino-esp32/releases
20+
*
21+
* Docs: https://diandeng.tech/doc
22+
* https://github.com/blinker-iot/blinker-doc/wiki
23+
*
24+
* *****************************************************************
25+
*
26+
* Blinker 库下载地址:
27+
* https://github.com/blinker-iot/blinker-library/archive/master.zip
28+
*
29+
* Blinker 是一套跨硬件、跨平台的物联网解决方案,提供APP端、设备端、
30+
* 服务器端支持,使用公有云服务进行数据传输存储。可用于智能家居、
31+
* 数据监测等领域,可以帮助用户更好更快地搭建物联网项目。
32+
*
33+
* 如果使用 ESP8266 接入 Blinker,
34+
* 请确保安装了 2.5.0 或更新的 ESP8266/Arduino 支持包。
35+
* https://github.com/esp8266/Arduino/releases
36+
*
37+
* 如果使用 ESP32 接入 Blinker,
38+
* 请确保安装了 1.0.2 或更新的 ESP32/Arduino 支持包。
39+
* https://github.com/espressif/arduino-esp32/releases
40+
*
41+
* 文档: https://diandeng.tech/doc
42+
* https://github.com/blinker-iot/blinker-doc/wiki
43+
*
44+
* *****************************************************************/
45+
46+
#define BLINKER_WIFI
47+
48+
#include <Blinker.h>
49+
50+
char auth[] = "Your Device Secret Key";
51+
char ssid[] = "Your WiFi network SSID or name";
52+
char pswd[] = "Your WiFi network WPA password or WEP key";
53+
54+
void dataRead(const String & data)
55+
{
56+
BLINKER_LOG("Blinker readString: ", data);
57+
58+
uint32_t BlinkerTime = millis();
59+
60+
Blinker.textData("text data");
61+
62+
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
63+
}
64+
65+
void setup()
66+
{
67+
Serial.begin(115200);
68+
BLINKER_DEBUG.stream(Serial);
69+
70+
pinMode(LED_BUILTIN, OUTPUT);
71+
digitalWrite(LED_BUILTIN, LOW);
72+
73+
Blinker.begin(auth, ssid, pswd);
74+
Blinker.attachData(dataRead);
75+
}
76+
77+
void loop()
78+
{
79+
Blinker.run();
80+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/* *****************************************************************
2+
*
3+
* Download latest Blinker library here:
4+
* https://github.com/blinker-iot/blinker-library/archive/master.zip
5+
*
6+
*
7+
* Blinker is a cross-hardware, cross-platform solution for the IoT.
8+
* It provides APP, device and server support,
9+
* and uses public cloud services for data transmission and storage.
10+
* It can be used in smart home, data monitoring and other fields
11+
* to help users build Internet of Things projects better and faster.
12+
*
13+
* Make sure installed 2.5.0 or later ESP8266/Arduino package,
14+
* if use ESP8266 with Blinker.
15+
* https://github.com/esp8266/Arduino/releases
16+
*
17+
* Make sure installed 1.0.2 or later ESP32/Arduino package,
18+
* if use ESP32 with Blinker.
19+
* https://github.com/espressif/arduino-esp32/releases
20+
*
21+
* Docs: https://diandeng.tech/doc
22+
* https://github.com/blinker-iot/blinker-doc/wiki
23+
*
24+
* *****************************************************************
25+
*
26+
* Blinker 库下载地址:
27+
* https://github.com/blinker-iot/blinker-library/archive/master.zip
28+
*
29+
* Blinker 是一套跨硬件、跨平台的物联网解决方案,提供APP端、设备端、
30+
* 服务器端支持,使用公有云服务进行数据传输存储。可用于智能家居、
31+
* 数据监测等领域,可以帮助用户更好更快地搭建物联网项目。
32+
*
33+
* 如果使用 ESP8266 接入 Blinker,
34+
* 请确保安装了 2.5.0 或更新的 ESP8266/Arduino 支持包。
35+
* https://github.com/esp8266/Arduino/releases
36+
*
37+
* 如果使用 ESP32 接入 Blinker,
38+
* 请确保安装了 1.0.2 或更新的 ESP32/Arduino 支持包。
39+
* https://github.com/espressif/arduino-esp32/releases
40+
*
41+
* 文档: https://diandeng.tech/doc
42+
* https://github.com/blinker-iot/blinker-doc/wiki
43+
*
44+
* *****************************************************************/
45+
46+
#define BLINKER_WIFI
47+
48+
#include <Blinker.h>
49+
50+
char auth[] = "Your Device Secret Key";
51+
char ssid[] = "Your WiFi network SSID or name";
52+
char pswd[] = "Your WiFi network WPA password or WEP key";
53+
54+
void dataRead(const String & data)
55+
{
56+
BLINKER_LOG("Blinker readString: ", data);
57+
58+
uint32_t BlinkerTime = millis();
59+
60+
Blinker.vibrate();
61+
Blinker.print("millis", BlinkerTime);
62+
63+
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
64+
}
65+
66+
void dataStorage()
67+
{
68+
Blinker.timeSlotData("data1", (int32_t)random(0,120));
69+
Blinker.timeSlotData("data2", random(0,120)/(float)1.5);
70+
}
71+
72+
void setup()
73+
{
74+
Serial.begin(115200);
75+
BLINKER_DEBUG.stream(Serial);
76+
77+
pinMode(LED_BUILTIN, OUTPUT);
78+
digitalWrite(LED_BUILTIN, LOW);
79+
80+
Blinker.begin(auth, ssid, pswd);
81+
Blinker.attachData(dataRead);
82+
Blinker.attachDataStorage(dataStorage);
83+
}
84+
85+
void loop()
86+
{
87+
Blinker.run();
88+
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/* *****************************************************************
2+
*
3+
* Download latest Blinker library here:
4+
* https://github.com/blinker-iot/blinker-library/archive/master.zip
5+
*
6+
*
7+
* Blinker is a cross-hardware, cross-platform solution for the IoT.
8+
* It provides APP, device and server support,
9+
* and uses public cloud services for data transmission and storage.
10+
* It can be used in smart home, data monitoring and other fields
11+
* to help users build Internet of Things projects better and faster.
12+
*
13+
* Make sure installed 2.5.0 or later ESP8266/Arduino package,
14+
* if use ESP8266 with Blinker.
15+
* https://github.com/esp8266/Arduino/releases
16+
*
17+
* Make sure installed 1.0.2 or later ESP32/Arduino package,
18+
* if use ESP32 with Blinker.
19+
* https://github.com/espressif/arduino-esp32/releases
20+
*
21+
* Docs: https://diandeng.tech/doc
22+
* https://github.com/blinker-iot/blinker-doc/wiki
23+
*
24+
* *****************************************************************
25+
*
26+
* Blinker 库下载地址:
27+
* https://github.com/blinker-iot/blinker-library/archive/master.zip
28+
*
29+
* Blinker 是一套跨硬件、跨平台的物联网解决方案,提供APP端、设备端、
30+
* 服务器端支持,使用公有云服务进行数据传输存储。可用于智能家居、
31+
* 数据监测等领域,可以帮助用户更好更快地搭建物联网项目。
32+
*
33+
* 如果使用 ESP8266 接入 Blinker,
34+
* 请确保安装了 2.5.0 或更新的 ESP8266/Arduino 支持包。
35+
* https://github.com/esp8266/Arduino/releases
36+
*
37+
* 如果使用 ESP32 接入 Blinker,
38+
* 请确保安装了 1.0.2 或更新的 ESP32/Arduino 支持包。
39+
* https://github.com/espressif/arduino-esp32/releases
40+
*
41+
* 文档: https://diandeng.tech/doc
42+
* https://github.com/blinker-iot/blinker-doc/wiki
43+
*
44+
* *****************************************************************/
45+
46+
#define BLINKER_WIFI
47+
#define BLINKER_ESP_SMARTCONFIG
48+
49+
#include <Blinker.h>
50+
#include "ESP32_CAM_SERVER.h"
51+
52+
char auth[] = "Your Device Secret Key";
53+
bool setup_camera = false;
54+
55+
void dataRead(const String & data)
56+
{
57+
BLINKER_LOG("Blinker readString: ", data);
58+
59+
Blinker.vibrate();
60+
61+
uint32_t BlinkerTime = millis();
62+
63+
Blinker.printObject("video", "{\"str\":\"mjpg\",\"url\":\"http:"+ String(WiFi.localIP()) + "\"}");
64+
}
65+
66+
void setup()
67+
{
68+
Serial.begin(115200);
69+
BLINKER_DEBUG.stream(Serial);
70+
71+
pinMode(LED_BUILTIN, OUTPUT);
72+
digitalWrite(LED_BUILTIN, LOW);
73+
74+
Blinker.begin(auth);
75+
Blinker.attachData(dataRead);
76+
}
77+
78+
void loop()
79+
{
80+
Blinker.run();
81+
82+
if (Blinker.connected() && !setup_camera)
83+
{
84+
setupCamera();
85+
setup_camera = true;
86+
87+
Blinker.printObject("video", "{\"str\":\"mjpg\",\"url\":\"http:"+ String(WiFi.localIP()) + "\"}");
88+
}
89+
}

0 commit comments

Comments
 (0)