iT邦幫忙

0

Arduino esp8266晶片 to station err 但 Join AP success

  • 分享至 

  • xImage

我用的是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)
{
}
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答