专属设备配网时一直无法找到设备,是什么问题??
#define BLINKER_PRO_ESP#define BLINKER_BUTTON
#define BLINKER_BUTTON_LONGPRESS_POWERDOWN
#define BLINKER_BUTTON_PIN 4
#define BLINKER_OTA_VERSION_CODE "0.1.1"
#include <Blinker.h>
char type[] = "FVozFbCAJ3KJ";
char auth[] = "4tuXJQuBWW2R";
BlinkerButton Button1("btn-abc");
BlinkerNumber Number1("num-abc");
int counter = 0;
void button1_callback(const String & state)
{
BLINKER_LOG("get button state: ", state);
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
}
bool dataParse(const JsonObject & data)
{
String getData;
serializeJson(data, getData);
BLINKER_LOG("Get user command: ", getData);
// if you parsed this data, return TRUE.
// return true;
return false;
}
void heartbeat()
{
BLINKER_LOG("heartbeat!");
}
#if defined(BLINKER_BUTTON)
ICACHE_RAM_ATTR void buttonTick()
{
Blinker.tick();
}
void singleClick()
{
BLINKER_LOG("Button clicked!");
}
/*
* Add your code in this function
*
* When button double clicked, device will call this function
*/
void doubleClick()
{
BLINKER_LOG("Button double clicked!");
}
/*
* Add your code in this function
*
* When long press start, device will call this function
*/
void longPressStart()
{
BLINKER_LOG("Button long press start!");
}
/*
* Add your code in this function
*
* When during long press, device will call this function
*/
void duringLongPress()
{
// BLINKER_LOG("During button long press!");
uint16_t pressed_time = Blinker.pressedTime();
if (pressed_time >= 5000 && Blinker.configType() != BLINKER_AP_CONFIG)
{
Blinker.esptouchInit();
}
}
#endif
void dataRead(const String & data)
{
BLINKER_LOG("Blinker readString: ", data);
counter++;
Number1.print(counter);
}
void setup()
{
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);
BLINKER_DEBUG.debugAll();
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
Blinker.begin(auth, type);
Blinker.attachData(dataRead);
Blinker.attachParse(dataParse);
Blinker.attachHeartbeat(heartbeat);
Button1.attach(button1_callback);
#if defined(BLINKER_BUTTON)
Blinker.attachClick(singleClick);
Blinker.attachDoubleClick(doubleClick);
Blinker.attachLongPressStart(longPressStart);
Blinker.attachDuringLongPress(duringLongPress);
attachInterrupt(BLINKER_BUTTON_PIN, buttonTick, CHANGE);
#endif
}
void loop()
{
Blinker.run();
}
1.确保blinker lib和package都是文档提供的最新版。2.手机wifi搜索下,看看有没有看到设备的AP
可以看到设备的AP.但是无法搜索设备 zhihuiscau 发表于 2022-4-17 12:06
可以看到设备的AP.但是无法搜索设备
lib 0.3.9
package8266-3.0.2 32-2.0.2
app2.6.4
都是最新版吗? blinker lib和package都是文档提供的最新版 都是最新的
问题已经解决了,谢谢 zhihuiscau 发表于 2022-4-17 12:06
可以看到设备的AP.但是无法搜索设备
设备AP截图下 联网成功后出现这问题
zhihuiscau 发表于 2022-4-17 15:16
联网成功后出现这问题
后台看了下,你typekey输错了
页:
[1]
2