我用的是Arduino UNO和ESP8266晶片
序列阜一直顯示:
setup begin
FW Version:
to station err
Join AP success
IP:
setup end
看到後,我心裡一整個wtf
為什麼to station err 但Join AP會是success的
對了,上傳完後,我有看到esp8266模組有閃藍燈
#include <SoftwareSerial.h>
#include "ESP8266.h"
#define SSID "*"
#define PASSWORD "*"
SoftwareSerial esp(3,2);
ESP8266 wifi(esp);
void setup(void)
{
esp.begin(115200);
Serial.begin(9600);
Serial.print("setup begin\r\n");
Serial.print("FW Version: ");
Serial.println(wifi.getVersion().c_str());
if (wifi.setOprToStation()) {
Serial.print("to station ok\r\n");
} else {
Serial.print("to station err\r\n");
}
if (wifi.joinAP(SSID, PASSWORD)) {
Serial.print("Join AP success\r\n");
Serial.print("IP: ");
Serial.println(wifi.getLocalIP().c_str());
} else {
Serial.print("Join AP failure\r\n");
}
Serial.print("setup end\r\n");
}
void loop(void)
{
}