|
Wi-Fi Module SPEC特性
- 802.11b Wi-Fi certified
- 1Mbps and 2Mbps throughput speeds(只有支援到B)
- 支援BSS和IBSS(獨立BSS,俗稱Ad Hoc)網路拓譜(見附註)
- 支援加密及未加密網路
- WEP (64-bit and 128-bit)
- WPA/WPA2 (TKIP and AES) PSK(WEP與WPA加密經站長測試皆正常)
- Pin Usage( JP2定義使用的腳位13SCK, 12SDO, 11SDI, 10SSN, (2 或8,by JP2) )and pin9(LDE)
- SPI
- Slave select (SS) : Arduino pin 10 (port B, pin 2)
- Clock (SCK) : Arduino pin 13 (port B, pin 5)
- Master in, slave out (MISO) : Arduino pin 12 (port B, pin 4)
- Master out, slave in (MOSI) : Arduino pin 11 (port B, pin 3)
- [跳線]Interrupt (JP2,擇一使用)
- INT0 : Arduino pin 2 (port D, pin 2)
- DIG8 : Arduino pin 8 (port B, pin 0)
- [跳線]LED : Arduino pin 9 (port B, pin 1)
- To regain use of this pin, remove the LED jumper cap
- 損耗電
- 睡眠: 250μA(別搞錯囉!!是uA也就是0.25mA)
- 傳輸: 230mA
- 接收: 85mA
- 相關的網站如下
- http://www.asynclabs.com/index.php?option=com_virtuemart&page=shop.browse&category_id=6&Itemid=57&TreeId=1
- http://github.com/asynclabs/WiShield
- http://asynclabs.com/wiki/index.php?title=AsyncLabsWiki
自行安裝套件LIB請到以下兩個網址抓取.H檔以及套件檔。第一次編譯會顯示缺少g2100.h也請一併丟入資料夾中再置放於\arduino-0017\hardware\libraries\asynclabs_WiShield_91052e2之下。或者直接下載站長整理好的整合檔案(含原廠範例)。
另外模板上的一顆紅色LED燈,試辦別有無連上基地台的指示燈,燈亮表示您的AP設定以及登入密碼都正常,可以開始使用。

P.S.常見的組網拓撲主要有三種:BSS、IBSS、ESS。BSS是802.11的基本架構(也被稱為infrastructure
模式),在無線通信部分主要由無線網卡與AP(Access Point)兩種STA(無線網絡中接點的基本單位---「站
」)組成;IBSS(獨立BSS)是一種沒有規劃好的網絡架構(因此也被稱為Ad Hoc模式),無線通信部分主要由
兩個或以上的無線網卡STA通過「點對點」的方式對等相聯而組成的;ESS(擴展BSS)是BSS的『延伸』,是以
二層橋接/交換的方式連接多個BSS的無線網絡架構。
跳轉閱讀全文附程式碼及LIB檔案。
#include <WiShield.h>
#define WIRELESS_MODE_INFRA 1
#define WIRELESS_MODE_ADHOC 2
// Wireless configuration parameters ----------------------------------------
unsigned char local_ip[] = {192,168,168,222}; // IP address of WiShield
unsigned char gateway_ip[] = {192,168,168,1}; // router or gateway IP address
unsigned char subnet_mask[] = {255,255,255,0}; // subnet mask for the local network
const prog_char ssid[] PROGMEM = {"x"}; // max 32 bytes
unsigned char security_type = 3; // 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2
// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {"1313131313"}; // max 64 characters
// WEP 128-bit keys
// sample HEX keys
prog_uchar wep_keys[] PROGMEM = { 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, // Key 0
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 1
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 2
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Key 3
};
// setup the wireless mode
// infrastructure - connect to AP
// adhoc - connect to another WiFi device
unsigned char wireless_mode = WIRELESS_MODE_INFRA;
unsigned char ssid_len;
unsigned char security_passphrase_len;
//---------------------------------------------------------------------------
void setup()
{
WiFi.init();
}
// This is the webpage that is served up by the webserver
const prog_char webpage[] PROGMEM = {"HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<center><h1>Hello World Arduino.TW!! I am WiShield</h1><form method=\"get\" action=\"0\">Toggle LED:<input type=\"submit\" name=\"0\" value=\"LED1\"></input></form></center>"};
void loop()
{
WiFi.run();
}
|