|
请教一下大佬们!如题,想用MAX30205模块做一个温度计。经过测试,硬件都是好的,但是始终连接不上Blinker APP,串口显示如下:
__ __ __
/\ \ /\ \ __ /\ \ v0.3.4
\ \ \___ \ \ \ /\_\ ___\ \ \/'\ __ _ __
\ \ '__`\\ \ \ \/\ \ /' _ `\ \ , < /'__`\/\`'__\
\ \ \L\ \\ \ \_\ \ \/\ \/\ \ \ \\`\ /\ __/\ \ \./
\ \_,__/ \ \__\\ \_\ \_\ \_\ \_\ \_\ \____\\ \_\
\/___/ \/__/ \/_/\/_/\/_/\/_/\/_/\/____/ \/_/
To better use blinker with your IoT project!
Download latest blinker library here!
=> https://github.com/blinker-iot/blinker-library
[108] _aliType:
[110] _duerType:
[112] _miType:
[113] _authKey: 1fb8363254dd
[116] Connecting to TP-LINK_5C4C
[123] ESP8266_MQTT initialized...
[123]
===========================================================
================== Blinker Timer loaded! ==================
Warning!EEPROM address 1536-2431 is used for Blinker Timer!
============= DON'T USE THESE EEPROM ADDRESS! =============
===========================================================
[150] countdown state: false
[151] _cdRunState: 0
[153] _totalTime: 0
[155] _runTime: 0
[157] _action:
[159] loop state: false
[160] _lpRunState: 0
[162] _times: 0
[164] _tri_times: 0
[165] _time1: 0
[167] _action1:
[169] _time2: 0
[170] _action2:
[172] _lpData: 0
[694] Temperature: 256.00 *C
[1205] WiFi Connected.
[1205] IP Address:
[1205] 192.168.0.193
[1226] Temperature: 256.00 *C
[1227] [HTTP] begin: https://iot.diandeng.tech/api/v1 ... uthKey=1fb8363254dd &version=0.1.0
[2469] [HTTP] GET... code: 400
[2474] reply was:
[2474] ==============================
[2474]
[2474] ==============================
[2474] ERROR: Maybe you have put in the wrong AuthKey!
[2477] ERROR: Or maybe your request is too frequently!
[2482] ERROR: Or maybe your network is disconnected!
代码如下:
#define BLINKER_WIFI
#include <Blinker.h>
#include <Wire.h>
#include "ClosedCube_MAX30205.h"
ClosedCube_MAX30205 max30205;
BlinkerNumber TEMP("temp");
char ssid[] = "TP-LINK_4B5B";
char pswd[] = "12345421";
char auth[] = "1hz8379490ca ";
float temp_read = 0;
void setup(void)
{
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);
BLINKER_DEBUG.debugAll();
Blinker.begin(auth,ssid,pswd);
Blinker.attachHeartbeat(heartbeat);
max30205.begin(0x48);
}
void loop()
{
Blinker.run();
float t = max30205.readTemperature();
if (isnan(t))
{
BLINKER_LOG("Failed to read from DHT sensor!");
}
else
{
BLINKER_LOG("Temperature: ", t, " *C");
temp_read = t;
}
Blinker.delay(100);
}
void heartbeat() //心跳包
{
if (temp_read < 15)
{
TEMP.color("#1E90FF");//蓝
TEMP.unit("℃(寒冷)");
}
else if (temp_read > 25)
{
TEMP.color("#DC143C");//红
TEMP.unit("℃(炎热)");
}
else
{
TEMP.color("#00DE00");//绿
TEMP.unit("℃(舒适)");
}
TEMP.print(temp_read );
}
|
|