ต่อ esp8266 ได้แล้วครับ แต่เหมือนมีปัญหาเกี่ยวกับ BUFFER_SIZE
In file included from C:\Users\mycom\AppData\Local\Temp\arduino_modified_sketch_239305\wifiTest.ino:54:0:
C:\Users\mycom\Documents\Arduino\libraries\ESP8266/uartWIFI.h:66:0: warning: "OPEN" redefined [enabled by default]
#define OPEN 1
^
C:\Users\mycom\Documents\Arduino\libraries\ESP8266/uartWIFI.h:54:0: note: this is the location of the previous definition
#define OPEN 0
^
C:\Users\mycom\Documents\Arduino\libraries\ESP8266/uartWIFI.h:74:0: warning: "SERIAL_TX_BUFFER_SIZE" redefined [enabled by default]
#define SERIAL_TX_BUFFER_SIZE 128
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:224:0,
from sketch\wifiTest.ino.cpp:1:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:46:0: note: this is the location of the previous definition
#define SERIAL_TX_BUFFER_SIZE 64
^
In file included from C:\Users\mycom\AppData\Local\Temp\arduino_modified_sketch_239305\wifiTest.ino:54:0:
C:\Users\mycom\Documents\Arduino\libraries\ESP8266/uartWIFI.h:75:0: warning: "SERIAL_RX_BUFFER_SIZE" redefined [enabled by default]
#define SERIAL_RX_BUFFER_SIZE 512
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:224:0,
from sketch\wifiTest.ino.cpp:1:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:53:0: note: this is the location of the previous definition
#define SERIAL_RX_BUFFER_SIZE 64
^
โค้ด Arduino
#define SSID "Itead_1(Public)"
#define PASSWORD "27955416"
#include "uartWIFI.h"
#include <SoftwareSerial.h>
WIFI wifi;
void setup()
{
wifi.begin();
bool b = wifi.Initialize(STA, SSID, PASSWORD);
if(!b)
{
DebugSerial.println("Init error");
}
delay(8000); //make sure the module can have enough time to get an IP address
String ipstring = wifi.showIP();
DebugSerial.println("My IP address:");
DebugSerial.println(ipstring);//show the ip address of module
String wifistring = wifi.showJAP();
DebugSerial.println(wifistring); //show the name of current wifi access port
}
void loop()
{
}
ถ้าต่อได้แล้ว เห็น wifi แสดงว่าอุปกรณ์ทำงานได้ถูกต้อง ที่เห็นเป็น warning
เช็คที่ไลบารี หรือลองเปลี่ยนไลบารีตัวใหม่ครับ