600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > 【程序】Marvell 88W8801 WiFi模块连接路由器 并使用lwip2.0.3建立http服务器(0807版)

【程序】Marvell 88W8801 WiFi模块连接路由器 并使用lwip2.0.3建立http服务器(0807版)

时间:2023-07-22 11:39:28

相关推荐

【程序】Marvell 88W8801 WiFi模块连接路由器 并使用lwip2.0.3建立http服务器(0807版)

该程序是旧版本!最新版本为版:

/ZLK1214/article/details/122915474

本程序所用的单片机型号为:STM32F103ZE

可以用STM32F103RE或STM32F103RD,但是STM32F103RC不行!

PB12端口为复位引脚(PDN),请务必连接!不连接PDN引脚将导致固件无法下载!如果模块上有PDN和RESET两个引脚,只需要连接PDN引脚。因为模块上的RESET引脚是悬空的,根本就没有连到芯片上。

晶振用的是8MHz,请注意检查自己的开发板,看看晶振是不是8MHz。如果是12MHz,请修改system_stm32f10x.c文件,把PLL的倍频系数由9改成6(8×9=12×6),并在工程属性中定义HSE_VALUE=12000000!

程序支持连接无密码的热点以及WEP、WPA-PSK和WPA2-PSK认证类型的热点,加密方式支持TKIP和AES。WEP加密类型仅支持添加一个密钥。

程序暂不支持创建AP热点(路由器热点)。需要创建AP热点代码的读者请私下联系QQ970349094。

88W8801不支持Ad-Hoc点对点模式, 请不要使用程序中与Ad-Hoc有关的函数。

用Keil5编写程序的时候,工程文件夹路径最好不要出现中文哦!不然代码提示可能会有问题

wifi_88w8801是主程序,直接打开下载运行即可。该程序裸机运行,不带操作系统,运行的是lwip-2.0.3协议栈

现在lwip2.1版本已经发布了。该版本的lwip压缩包(lwip-2.1.0.zip)中的src/netif文件夹下没有ethernetif.c了,那个文件是被移动到contrib-2.1.0.zip的examples/ethernetif文件夹下去了。

sd8801_uapsta.c是WiFi模块的固件,上电运行时必须由单片机发送给WiFi模块运行

该固件数据非常大,为了节约程序编译下载的时间,可以运行flash_saver程序将这些数据保存到Flash固定区域(要求芯片为STM32F103xE或以上)

然后根据串口提示,修改WiFi.h中WIFI_FIRMWAREAREA_ADDR的值(取消注释)

这样就可以移除sd8801_uapsta.c文件,大幅度降低程序烧写时间了

移植到STM32F407VE单片机上的程序(1010版):/ZLK1214/article/details/82995164

此版本修复了上一个版本(0729版)存在的一些问题,主要更新如下:

1. 收到命令回应时,如果result字段不为0,则调用回调函数时,传入的参数status为WIFI_STATUS_FAIL或WIFI_STATUS_UNSUPPORTED,不再是WIFI_STATUS_OK

当命令回应或数据帧确认超时时,status为WIFI_STATUS_NORESP(这个没变)

2. 数据帧确认超时时,串口会输出提示(WIFI_DISPLAY_RESPTIME选项启用的情况下)

3. 添加了连接WEP热点的支持(单WEP密钥),并能够显示已添加的密钥(串口发送k)

4. 修复了当关联热点成功但尚未认证成功时,串口发送R可以重连热点导致系统故障的bug

5. 添加了WiFi_EventProcess函数处理WiFi事件,修复了WiFi掉线后WiFi_Deauthenticate仍能执行成功的bug(wifi_ssid_info未清零)

6. 把wifi_test中的IP4_*全部改成了IP_*,如ip4_addr_t改成了ip_addr_t

7. 修复了测速上位机程序中freeaddrinfo释放不了内存的问题

本程序也支持88W8782芯片,但需要将固件sd8801_uapsta.c替换成8782的内容(提取码:rn8h),然后把WiFi.h中的数据发送通道数WIFI_DATAPORTS_TX_NUM由11改为15。

【模块连线】

模块底板的PCB文件(可以自己打一个PCB出来):8782模块资料.zip_免费高速下载|百度网盘-分享无限制

顶层:

上面字都写错了,不是W8287,是W8801才对,自己改过来吧。。。

底层:

其中,7脚RST接的是中间14脚模组的PDN引脚,低电平有效。

【Keil5工程截图】

【笔者所用的开发板和WiFi模块】

【程序运行截图】

1. 串口输出

2. ping IP地址和计算机名

3. IE浏览器通过计算机名访问板上的HTTP服务器

【程序运行结果】

STM32F103ZE SDIO 88W8801RESPCMD63, RESP1_b0ff8000RESPCMD63, RESP1_b0300000Number of I/O Functions: 3Memory Present: 0Relative Card Address: 0x0001Card selected! RESP1_00001e00SDIO Clock: 24MHz[CIS] func=0, ptr=0x00008000Product Information: Marvell 802.11 SDIO ID: 48Manufacturer Code: 0x02dfManufacturer Information: 0x9138Card Function Code: 0x0cSystem Initialization Bit Mask: 0x00Maximum Block Size: 256Maximum Transfer Rate Code: 0x5a[CIS] func=1, ptr=0x00008080Manufacturer Code: 0x02dfManufacturer Information: 0x9139Card Function Code: 0x0cSystem Initialization Bit Mask: 0x00Maximum Block Size: 512[CIS] func=2, ptr=0x00008100[CIS] func=3, ptr=0x00008180Firmware is successfully downloaded!CMDRESP 0x804d at 19msMAC Addr: 08:EA:40:31:21:8BCMDRESP 0x8006 at 441msSSID 'CMCC-EDU', MAC 76:14:4B:57:E0:A8, RSSI 67, Channel 1Capability: 0x0621 (Security: Unsecured, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 18.0Mbps 24.0Mbps 36.0Mbps 54.0MbpsSSID 'CMCC-EDU', MAC 06:14:4B:57:FD:01, RSSI 77, Channel 1Capability: 0x0621 (Security: Unsecured, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 18.0Mbps 24.0Mbps 36.0Mbps 54.0MbpsSSID 'CMCC-EDU', MAC C6:14:4B:57:DA:5D, RSSI 78, Channel 1Capability: 0x0621 (Security: Unsecured, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 18.0Mbps 24.0Mbps 36.0Mbps 54.0MbpsSSID 'Xiaomi', MAC F0:B4:29:23:03:F5, RSSI 72, Channel 1Capability: 0x0c11 (Security: WPA2, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 9.0Mbps 18.0Mbps 36.0Mbps 54.0MbpsSSID 'CMCC-Young', MAC D6:14:4B:57:E8:5F, RSSI 74, Channel 1Capability: 0x0621 (Security: Unsecured, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 18.0Mbps 24.0Mbps 36.0Mbps 54.0MbpsSSID 'CMCC-Young', MAC 66:14:4B:62:E8:88, RSSI 66, Channel 1Capability: 0x0621 (Security: Unsecured, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 18.0Mbps 24.0Mbps 36.0Mbps 54.0MbpsSSID 'CMCC-Young', MAC 16:14:4B:63:0A:33, RSSI 85, Channel 1Capability: 0x0621 (Security: Unsecured, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 18.0Mbps 24.0Mbps 36.0Mbps 54.0MbpsSSID 'CMCC-Young', MAC C6:14:4B:57:DA:5E, RSSI 81, Channel 1Capability: 0x0621 (Security: Unsecured, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 18.0Mbps 24.0Mbps 36.0Mbps 54.0MbpsCMDRESP 0x8006 at 441msSSID 'CMCC-EDU', MAC 66:14:4B:57:FE:57, RSSI 57, Channel 6Capability: 0x0621 (Security: Unsecured, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 18.0Mbps 24.0Mbps 36.0Mbps 54.0MbpsSSID 'Oct1158-2', MAC FC:D7:33:FE:D6:02, RSSI 36, Channel 6Capability: 0x0431 (Security: WPA2, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 6.0Mbps 9.0Mbps 12.0Mbps 18.0MbpsSSID 'CMCC-Young', MAC 66:14:4B:57:FE:58, RSSI 55, Channel 6Capability: 0x0621 (Security: Unsecured, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 18.0Mbps 24.0Mbps 36.0Mbps 54.0MbpsSSID 'CMCC-EDU', MAC C6:14:4B:62:AB:CD, RSSI 64, Channel 6Capability: 0x0621 (Security: Unsecured, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 18.0Mbps 24.0Mbps 36.0Mbps 54.0MbpsSSID 'CMCC-Young', MAC C6:14:4B:62:AB:CE, RSSI 67, Channel 6Capability: 0x0621 (Security: Unsecured, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 18.0Mbps 24.0Mbps 36.0Mbps 54.0MbpsSSID 'CMCC-EDU', MAC 46:14:4B:57:DF:E5, RSSI 75, Channel 6Capability: 0x0621 (Security: Unsecured, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 18.0Mbps 24.0Mbps 36.0Mbps 54.0MbpsSSID 'CMCC-Young', MAC 46:14:4B:57:DF:E6, RSSI 77, Channel 6Capability: 0x0621 (Security: Unsecured, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 18.0Mbps 24.0Mbps 36.0Mbps 54.0MbpsSSID '', MAC 38:91:D5:5D:72:9E, RSSI 59, Channel 8Capability: 0x0401 (Security: Unsecured, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 6.0Mbps 9.0Mbps 12.0Mbps 18.0MbpsSSID 'wifi-for-study-in-485', MAC 38:91:D5:5D:72:9B, RSSI 58, Channel 8Capability: 0x0411 (Security: WPA2, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 6.0Mbps 9.0Mbps 12.0Mbps 18.0MbpsCMDRESP 0x8006 at 443msSSID 'LieBaoWiFi603', MAC 2E:E0:10:4F:A4:78, RSSI 63, Channel 11Capability: 0x0431 (Security: WPA2, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 6.0Mbps 9.0Mbps 12.0Mbps 18.0MbpsSSID 'leibaowife123', MAC D4:83:04:E3:99:9C, RSSI 38, Channel 11Capability: 0x0431 (Security: WPA2, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 6.0Mbps 9.0Mbps 12.0Mbps 18.0MbpsSSID 'cdu??', MAC C8:ED:7D:87:78:E0, RSSI 64, Channel 11Capability: 0x0431 (Security: WPA2, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 6.0Mbps 9.0Mbps 12.0Mbps 18.0MbpsSSID 'MERCURY_B35C', MAC 00:4B:F3:01:B3:5C, RSSI 80, Channel 12Capability: 0x0411 (Security: WPA2, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 9.0Mbps 18.0Mbps 36.0Mbps 54.0MbpsCMDRESP 0x8006 at 224msSSID 'yu', MAC BC:5F:F6:F5:76:79, RSSI 71, Channel 13Capability: 0x0411 (Security: WPA2, Mode: Infrastructure)Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 9.0Mbps 18.0Mbps 36.0Mbps 54.0MbpsScan finished!CMDRESP 0x80c4 at 0msCMDRESP 0x8028 at 0msCMDRESP 0x8006 at 1527msCMDRESP 0x8012 at 10msWaiting for authentication![Event 23] size=77WMM status change event occurred![Event 43] size=10Authenticated![Send] len=350, port=1[Recv] len=590, port=1[Send] len=350, port=2[Recv] len=590, port=2[Send] len=42, port=3[Send] len=42, port=4[Send] len=42, port=5[Send] len=42, port=6DHCP supplied address!IP address: 192.168.1.108Subnet mask: 255.255.255.0Default gateway: 192.168.1.1DNS Server: 183.221.253.100[Send] len=42, port=7Not in cache![Recv] len=42, port=3[Send] len=79, port=8[Recv] len=95, port=4DNS Found IP: 208.118.235.79Connecting to 208.118.235.79...[Send] len=58, port=9[Recv] len=54, port=5[Send] len=54, port=10[Send] len=58, port=11Packet on port 1 ACK at 1284msPacket on port 2 ACK at 1282msPacket on port 3 ACK at 1276msPacket on port 4 ACK at 860msPacket on port 5 ACK at 824msPacket on port 6 ACK at 326msPacket on port 7 ACK at 315msPacket on port 8 ACK at 312msPacket on port 9 ACK at 304msPacket on port 10 ACK at 29ms[Send] len=42, port=1[Recv] len=58, port=6Connected! err=0[Send] len=115, port=2[Recv] len=54, port=7[Recv] len=590, port=8536 bytes received![Send] len=54, port=3[Recv] len=590, port=9536 bytes received![Send] len=54, port=4[Recv] len=590, port=10536 bytes received![Send] len=54, port=5[Recv] len=590, port=11536 bytes received![Send] len=54, port=6[Recv] len=590, port=12536 bytes received![Send] len=54, port=7[Recv] len=590, port=13536 bytes received![Send] len=54, port=8[Recv] len=590, port=14536 bytes received![Send] len=54, port=9[Recv] len=590, port=15536 bytes received![Send] len=54, port=10Packet on port 1 ACK at 700msPacket on port 2 ACK at 599msPacket on port 3 ACK at 312msPacket on port 4 ACK at 308msPacket on port 5 ACK at 305msPacket on port 6 ACK at 302msPacket on port 7 ACK at 37msPacket on port 8 ACK at 34msPacket on port 9 ACK at 30msPacket on port 11 ACK at 907ms[Recv] len=590, port=1536 bytes received![Send] len=54, port=11[Recv] len=590, port=2536 bytes received![Send] len=54, port=1[Recv] len=590, port=3536 bytes received![Send] len=54, port=2[Recv] len=590, port=4536 bytes received![Send] len=54, port=3[Send] len=42, port=4[Recv] len=590, port=5536 bytes received![Send] len=54, port=5[Recv] len=590, port=6536 bytes received![Send] len=54, port=6[Recv] len=590, port=7536 bytes received![Send] len=54, port=7[Recv] len=590, port=8536 bytes received![Send] len=54, port=8[Recv] len=590, port=9536 bytes received![Send] len=54, port=9Packet on port 1 ACK at 571msPacket on port 2 ACK at 565msPacket on port 3 ACK at 562msPacket on port 4 ACK at 548msPacket on port 5 ACK at 301msPacket on port 6 ACK at 297msPacket on port 7 ACK at 293msPacket on port 8 ACK at 290msPacket on port 10 ACK at 866msPacket on port 11 ACK at 601ms[Recv] len=590, port=10536 bytes received![Send] len=54, port=10[Recv] len=590, port=11536 bytes received![Send] len=54, port=11[Recv] len=590, port=12536 bytes received![Send] len=54, port=1[Recv] len=590, port=13536 bytes received![Send] len=54, port=2[Recv] len=590, port=14536 bytes received![Send] len=54, port=3[Recv] len=590, port=15536 bytes received![Send] len=54, port=4[Recv] len=590, port=1536 bytes received![Send] len=54, port=5[Send] len=42, port=6[Recv] len=590, port=2536 bytes received![Send] len=54, port=7[Recv] len=590, port=3536 bytes received![Send] len=54, port=8Packet on port 1 ACK at 561msPacket on port 2 ACK at 297msPacket on port 3 ACK at 294msPacket on port 4 ACK at 287msPacket on port 5 ACK at 284msPacket on port 6 ACK at 157msPacket on port 7 ACK at 25msPacket on port 9 ACK at 626msPacket on port 10 ACK at 595msPacket on port 11 ACK at 592ms[Recv] len=590, port=4536 bytes received![Send] len=54, port=9[Recv] len=590, port=5536 bytes received![Send] len=54, port=10[Recv] len=590, port=6536 bytes received![Send] len=54, port=11[Recv] len=590, port=7536 bytes received![Send] len=54, port=1[Recv] len=590, port=8536 bytes received![Send] len=54, port=2[Recv] len=590, port=9536 bytes received![Send] len=54, port=3[Recv] len=590, port=10536 bytes received![Send] len=54, port=4[Recv] len=590, port=11536 bytes received![Send] len=54, port=5[Recv] len=590, port=12536 bytes received![Send] len=54, port=6[Recv] len=590, port=13536 bytes received![Send] len=54, port=7Packet on port 1 ACK at 335msPacket on port 2 ACK at 305msPacket on port 3 ACK at 302msPacket on port 4 ACK at 65msPacket on port 5 ACK at 60msPacket on port 6 ACK at 22msPacket on port 8 ACK at 638msPacket on port 9 ACK at 606msPacket on port 10 ACK at 603msPacket on port 11 ACK at 367ms[Recv] len=590, port=14536 bytes received![Send] len=54, port=8[Recv] len=590, port=15536 bytes received![Send] len=54, port=9[Recv] len=590, port=1536 bytes received![Send] len=54, port=10[Recv] len=590, port=2536 bytes received![Send] len=54, port=11[Recv] len=590, port=3536 bytes received![Send] len=54, port=1[Recv] len=590, port=4536 bytes received![Send] len=54, port=2[Recv] len=590, port=5536 bytes received![Send] len=54, port=3[Recv] len=590, port=6536 bytes received![Send] len=54, port=4[Recv] len=590, port=7536 bytes received![Send] len=54, port=5[Recv] len=590, port=8536 bytes received![Send] len=54, port=6Packet on port 1 ACK at 294msPacket on port 2 ACK at 291msPacket on port 3 ACK at 251msPacket on port 4 ACK at 248msPacket on port 5 ACK at 19msPacket on port 7 ACK at 826msPacket on port 8 ACK at 596msPacket on port 9 ACK at 593msPacket on port 10 ACK at 554msPacket on port 11 ACK at 551ms[Recv] len=590, port=9536 bytes received![Send] len=54, port=7[Recv] len=590, port=10536 bytes received![Send] len=54, port=8[Recv] len=590, port=11536 bytes received![Send] len=54, port=9[Recv] len=590, port=12536 bytes received![Send] len=54, port=10[Recv] len=590, port=13536 bytes received![Send] len=54, port=11[Recv] len=590, port=14536 bytes received![Send] len=54, port=1[Recv] len=590, port=15536 bytes received![Send] len=54, port=2[Recv] len=590, port=1536 bytes received![Send] len=54, port=3[Recv] len=590, port=2536 bytes received![Send] len=54, port=4[Recv] len=590, port=3536 bytes received![Send] len=54, port=5Packet on port 1 ACK at 288msPacket on port 2 ACK at 60msPacket on port 3 ACK at 56msPacket on port 4 ACK at 16msPacket on port 6 ACK at 637msPacket on port 7 ACK at 598msPacket on port 8 ACK at 594msPacket on port 9 ACK at 365msPacket on port 10 ACK at 362msPacket on port 11 ACK at 319ms[Recv] len=590, port=4536 bytes received![Send] len=54, port=6[Recv] len=590, port=5536 bytes received![Send] len=54, port=7[Recv] len=590, port=6536 bytes received![Send] len=54, port=8[Recv] len=590, port=7536 bytes received![Send] len=54, port=9[Recv] len=196, port=8142 bytes received![Send] len=54, port=10[Recv] len=54, port=9Connection is closed! err=0, count=32302[Send] len=54, port=11[Recv] len=54, port=10[Recv] len=92, port=11[Send] len=42, port=1[Send] len=42, port=2[Recv] len=92, port=12[Send] len=42, port=3[Recv] len=42, port=13[Send] len=104, port=4Packet on port 1 ACK at 1254msPacket on port 2 ACK at 1102msPacket on port 3 ACK at 102msPacket on port 5 ACK at 10917msPacket on port 6 ACK at 10689msPacket on port 7 ACK at 10686msPacket on port 8 ACK at 10646msPacket on port 9 ACK at 10643msPacket on port 10 ACK at 10334msPacket on port 11 ACK at 6986ms[Recv] len=42, port=14[Send] len=42, port=5[Recv] len=74, port=15[Send] len=74, port=6[Recv] len=74, port=1[Send] len=74, port=7[Recv] len=74, port=2[Send] len=74, port=8[Recv] len=74, port=3[Send] len=74, port=9[Recv] len=74, port=4[Send] len=74, port=10[Recv] len=74, port=5[Send] len=74, port=11[Recv] len=74, port=6[Send] len=74, port=1

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。