Linkit one开发分享(四):WIFI NPT

图片说明作者:戴宝明
打开arduino IDE,打开文件->示例->Lwifi->wifiwebclient。
修改wifi参数
#define WIFI_AP "ssid"
#define WIFI_PASSWORD "password"
#define WIFI_AUTH LWIFI_WPA // choose from LWIFI_OPEN, LWIFI_WPA, or LWIFI_WEP.
#define SITE_URL "www.baidu.com"

Ssid改成自己的ap的ssid ,password就是ap的key,AUTH一般用WPA

访问baidu,打开console log 可以看到访问成功

“”

可以看到 www.baidu.com 返回的参数

同样,打开例子WiFiUdpNtpClient,修改参数,执行

“”

Console.log 如下:
setup()
Connected to wifi
SSID:
IP Address: 192.168.0.108
signal strength (RSSI):-47 dBm

Starting connection to server...
setup() done
sendNTPpacket
0
sendNTPpacket
0
sendNTPpacket
48
packet received
2416E30000000041435453DA2CCA7730E322B100000000DA2CCA84DDD36768DA2CCA84DDD46C5
Seconds since Jan 1 1900 = 3660368516
Unix time = 1451379716
The UTC time is 9:01:56
sendNTPpacket
48
packet received
2416E30000000041435453DA2CCA7730E322B100000000DA2CCA8FD664D263DA2CCA8FD6655F3
Seconds since Jan 1 1900 = 3660368527
Unix time = 1451379727
The UTC time is 9:02:07
sendNTPpacket
48
Linklt one 去访问 time.nist.gov NTP server NTP 服务器,取得时间,并显示。
本地ip地址 192.168.0.18, 时间是UTC 9:01:56 换成北京时间utc+8 就是17:01:56