精华内容
下载资源
问答
  • 【程序】Marvell 88W8801 WiFi模块连接路由器,并使用lwip2.0.3建立http服务器(20180807版)-附件资源
  • 【程序】Marvell 88W8801 WiFi模块连接路由器,并使用lwip2.0.3建立http服务器(20180729版)-附件资源
  • 问题一,wifi模块可以连接路由器,是不是就能实现远程控制呢? 回答:wifi模块可以连接路由器,说明实现路由器的局域网控制没有问题。 问题二:在远程控制的过程中,我可以自己在家里面搭建服务器实现吗? ...

    问题一,wifi模块可以连接路由器,是不是就能实现远程控制呢?

    回答:wifi模块可以连接路由器,说明实现路由器的局域网控制没有问题。
    问题二:在远程控制的过程中,我可以自己在家里面搭建服务器实现吗?

    回答:远程控制需要服务器,但是用户通过自己的电脑在家里搭建服务器实现的可能性很小,因为搭建服务器需要公网的Ip还有服务器相关的软件开发,并且维护过程是一个成本较高的开支。
    问题三:现在市面上有哪几种可以实现远程控制的方式呢?
    回答:

    方式一:自己买服务器硬件,搭建在腾讯服务器百度服务器中心等(方便维护),企业自身开发服务器软件等。(超大型企业)

    方式二:通过租用阿里云,自己写服务器的软件实现。(企业用户比较大)

    方式三:通过一些P2P平台,实现穿透。但是国内的这项技术相对不够准确。(小部分企业使用)

    方式四:通过一些第三方平台实现,比如yeelink等。(业余爱好者)

    方式五:通过路由器的花生壳技术解析,实现映射的过程。(业余爱好者)

    关于wifi模块连接路由器远程控制的一些问题

    最后给大家举一个例子吧,比如我们通过手机QQ聊天,其实我们就是就是基于腾讯服务器的数据交换而已。然后wifi模块连接上了路由器,但是在广域网的服务器上面找不到他的映射地址,自然而然,是不可能实现远程控制功能,如果大家还是不了解的话,建议大家去看网络技术相关资料,重要看一下TCP /IP 协议、UDP协议、以及IP地址、网络架构的知识,希望对大家有帮助。


    展开全文
  • 该程序是旧版本!... 本程序所用的单片机型号为:STM32F103ZE 可以用STM32F103RE或STM32F103RD,但是STM32F103RC不行! PB12端口为复位引脚(PDN),请务必连接!不连接PDN引脚将导致固件无法下载...如果模块上有PDN和...

    该程序是旧版本!最新版本为20200208版:
    https://blog.csdn.net/ZLK1214/article/details/104229202

    本程序所用的单片机型号为: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文件,大幅度降低程序烧写时间了

    Keil5工程下载地址:https://pan.baidu.com/s/11LUHTqOFdn0hyKp-lbbKnA
    移植到STM32F407VE单片机上的程序(20181010版):https://blog.csdn.net/ZLK1214/article/details/82995164

    此版本修复了上一个版本(20180729版)存在的一些问题,主要更新如下:
    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出来):https://pan.baidu.com/s/1afb3dmeBSm_LuHIxzgYggA

    顶层:

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

    底层:


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

    【Keil5工程截图】

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

    【程序运行截图】

    1. 串口输出

    2. ping IP地址和计算机名

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

    【程序运行结果】

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

     

    展开全文
  • 该程序是旧版本!... 本程序所用的单片机型号为:STM32F103VE或STM32F407VE 复位引脚(PDN)应连接到STM32F1的PA2引脚或STM32F4的PD14引脚。不连接PDN引脚将导致固件无法下载...如果模块上有PDN和RESET两个引脚,只需要...

    该程序是旧版本!最新版本为20200208版:
    https://blog.csdn.net/ZLK1214/article/details/104229202

    本程序所用的单片机型号为:STM32F103VE或STM32F407VE
    复位引脚(PDN)应连接到STM32F1的PA2引脚或STM32F4的PD14引脚。不连接PDN引脚将导致固件无法下载!如果模块上有PDN和RESET两个引脚,只需要连接PDN引脚。因为模块上的RESET引脚是悬空的,根本就没有连到芯片上
    晶振用的是8MHz,请注意检查自己的开发板,看看晶振是不是8MHz。如果是12MHz,请修改system_stm32f10x.c或system_stm32f4xx.c文件!在F1单片机上是把PLL的倍频系数由9改成6(8×9=12×6),并在工程属性中定义HSE_VALUE=12000000

    程序支持连接无密码的热点以及WEP、WPA-PSK和WPA2-PSK认证类型的热点,加密方式支持TKIP和AES。WEP加密类型仅支持添加一个密钥
    程序暂不支持创建有密码的AP热点(路由器热点)
    88W8801不支持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固定区域(要求芯片Flash容量至少为384KB)
    然后根据串口提示,修改WiFi.h中WIFI_FIRMWAREAREA_ADDR的值(取消注释)
    这样就可以移除sd8801_uapsta.c文件,大幅度降低程序烧写时间了

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

    Keil5工程下载地址:
    【标准库版本】https://pan.baidu.com/s/1HupWIIN_eTU-QvbTbQN66A(提取码:t123)
    【HAL库版本】https://pan.baidu.com/s/1myogwFS687nCnsPEzU9ySQ(2019年12月12日发布)

    HAL库版本的Keil工程不是由STM32CubeMX创建的,而是手工建立的。其代码风格和标准库版本是一致的。
    2019年12月12日发布的程序中还包含了SPI方式驱动88W8801的程序,包括标准库版本和HAL库版本。使用时直接替换WiFi_LowLevel.c即可。

    【勘误】

    2020年1月10日:在某些环境下,扫描热点时会出现Hard Error的错误。这是因为WiFi_Scan_Callback函数里面没有正确处理IEEE TLV导致了缓冲区溢出。解决方法是在如图所示的位置(while (ie_size > 0)下方)添加以下代码:

            if (TLV_STRUCTLEN(*ie_params) > ie_size)
            {
              ie_params->header.length = ie_size - sizeof(IEEEHeader);
              printf("Found incomplete IEEE TLV! type=%#x\n", ie_params->header.type);
            }

    WiFi_ScanSSID_Callback也有同样的问题,可以用同样的方法修复。

    2020年2月3日:STM32F4标准库程序里面WiFi_LowLevel.c的读写函数中,如果开启了标准库的assert_failed检验,则会因为dma.DMA_BufferSize为0而出错。SDIO的DMA用不到这个成员,所以可以填写任何非0值,将0改为1即可解决问题。

    此版本修复了上一个版本(20180807版20181010版)存在的一些问题,主要更新如下: 
    1. 工程改成了使用StandardLIB,不使用MicroLIB
    2. 移除了88W8801不支持的Ad-Hoc模式的代码
    3. 去掉了断开连接的回调函数stop_callback里面status参数的无效判断
    4. 添加了检查PDN引脚是否正确连接的功能
    5. F4单片机上自动开启SDIO所需的PLL倍频器
    6. 可以根据指定的SDIO时钟频率自动计算分频系数
    7. 添加了输出字符串格式的dump函数,并在TCP接收数据的案例中使用
    8. 添加了保存在单片机Flash固定区域中的固件内容已被破坏的详细printf输出
    9. WriteData函数允许禁用缓冲区大小检查
    10. 优化了命令帧缓冲区结构体,合并了WiFi.c中以Ex结尾的扩展函数
    11. 优化了数据帧缓冲区结构体,去掉了数据帧的回调功能
    12. 创建了ethernetif.h,将ethernetif结构体和相关的函数声明在里面
    13. 按端口顺序接收数据帧
    14. 解决了第一次连接热点失败的bug
    15. WiFi_EventHandler中用宏名表示事件号
    16. 把main函数中判断SDIO中断是否发生的代码放到了LowLevel层中
    17. 命令、数据和事件增加了bss字段的支持,给出了创建无密码AP的示例代码
    18. 不再使用dhcp->offered_xxx,改成显示netif里面的IP地址
    19. 修复了WiFi_EventHandler函数中认证失败时无法自动重连的bug
    20. 数据发送速度测速器使用setsockopt设置了recv超时时间,单片机端使用tcp_shutdown函数通知主机停止接收数据
    21. 收发数据时改成等待DATAEND位而不是TXACT或RXACT位, 增加了超时判定
    22. WriteData和ReadData失败时重新读写,增加了固件下载出错时重传的功能,增加了address increment选项,以及是否允许使用多字节(Stream)模式的选项
    23. 将网卡输入函数由ethernet_input改为通用的netif_input
    24. 给头文件加上了#ifndef防重复包含的宏定义
    25. low_level_output发送数据帧前检查网络连接是否是连通的
    26. 添加了显示TCP报文字段详细信息的功能(tcpdump)
    27. wifi_test中添加了错误处理代码

    【模块连线】

    【Keil5工程截图】 

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

    STM32F103VE开发板(外部5V电源供电): 

    STM32F407VE开发板(电脑USB口供电):

    带底板的88W8801 WiFi模块: 

    如果用的开发板上面带有SD卡槽,即使里面不插内存卡,运行程序时,下载固件后或获取MAC地址后一直出现CRC错误和data timeout错误,可以采取下面的措施:

    (1)把SDIO模式由4位数据线模式改为1位模式,只接SDIO_D0(PC8)和SDIO_D1(PC9,作为SDIO中断引脚),不接SDIO_D2~3(PC10~11) 。修改WiFi_LowLevel_SDIOInit函数,将下面两句话注释掉,只保留SDIO_Init

    /* SDIO外设的总线宽度设为4位 */
    //sdio.SDIO_BusWide = SDIO_BusWide_4b;
    SDIO_Init(&sdio);
    //WiFi_LowLevel_WriteReg(0, SDIO_CCCR_BUSIFCTRL, WiFi_LowLevel_ReadReg(0, SDIO_CCCR_BUSIFCTRL) | SDIO_CCCR_BUSIFCTRL_BUSWID_4Bit);

    改为1位数据模式后,笔者上面的黑色带卡槽开发板的问题已经解决(用电脑USB口供电,串口用的是USB转TTL模块)。 

    (2)如果还是不行,就降低SDIO的时钟频率。打开WiFi.h,将WIFI_CLOCK_FREQ改小。如100万(1MHz),50万(500kHz),或者10万(100kHz),可以设为0(使用最低频率,也就是最高分频系数) 

    不过SD卡槽里面不要插内存卡。尽管插了内存卡进去,Wi-Fi模块还是可以照常使用,但是SD卡是没法用的,SD卡正常的初始化命令序列(如CMD2、CMD3)是无法成功执行的。
    虽然SDIO标准规定可以总线上可以接多张SD卡,但STM32单片机的SDIO接口只支持接一张卡,STM32F103的芯片手册Datasheet(不是参考手册)中有声明:
    The current version supports only one SD/SDIO/MMC4.2 card at any one time and a stack of MMC4.1 or previous.
    如果想要同时使用WiFi模块和SD内存卡,建议SD内存卡采用SPI总线通信。 

    【程序运行截图】

    1. 串口输出

    2. ping IP地址和计算机名

     3. 访问http服务器

    4. 将固件烧写到单片机Flash固定区域的程序(用于节约主程序烧写时间) 

    【程序运行结果】

    STM32F103VE SDIO 88W8801
    [Clock] freq=400.0kHz, requested=400.0kHz, divider=178
    RESPCMD63, RESP1_b0ff8000
    RESPCMD63, RESP1_b0300000
    Number of I/O Functions: 3
    Memory Present: 0
    Relative Card Address: 0x0001
    Card selected! RESP1_00001e00
    [Clock] freq=24000.0kHz, requested=25000.0kHz, divider=1
    [CIS] func=0, ptr=0x00008000
    Product Information: Marvell 802.11 SDIO ID: 48
    Manufacturer Code: 0x02df
    Manufacturer Information: 0x9138
    Card Function Code: 0x0c
    System Initialization Bit Mask: 0x00
    Maximum Block Size: 256
    Maximum Transfer Rate Code: 0x5a
    [CIS] func=1, ptr=0x00008080
    Manufacturer Code: 0x02df
    Manufacturer Information: 0x9139
    Card Function Code: 0x0c
    System Initialization Bit Mask: 0x00
    Maximum Block Size: 512
    [CIS] func=2, ptr=0x00008100
    [CIS] func=3, ptr=0x00008180
    Firmware is successfully downloaded!
    CMDRESP 0x804d at 20ms
    MAC Addr: 08:EA:40:31:21:8B
    CMDRESP 0x8006 at 455ms
    SSID 'Oct1158-2', MAC FC:D7:33:FE:D6:02, RSSI 79, Channel 1
      Timestamp 1386915102416, Beacon Interval 100, TSF timestamp: 205116
      Capability: 0x0431 (Security: WPA2, Mode: Infrastructure)
      Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 6.0Mbps 9.0Mbps 12.0Mbps 18.0Mbps
    SSID 'Pantum-AP-F41B72', MAC 10:A4:BE:F4:1B:72, RSSI 82, Channel 2
      Timestamp 485562726975, Beacon Interval 100, TSF timestamp: 312234
      Capability: 0x0431 (Security: WPA2, Mode: Infrastructure)
      Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 6.0Mbps 9.0Mbps 12.0Mbps 18.0Mbps
    CMDRESP 0x8006 at 451ms
    CMDRESP 0x8006 at 455ms
    SSID '@PHICOMM_58', MAC D8:C8:E9:34:C5:60, RSSI 73, Channel 11
      Timestamp 22025573780, Beacon Interval 100, TSF timestamp: 1283045
      Capability: 0x0c11 (Security: WPA2, Mode: Infrastructure)
      Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 9.0Mbps 18.0Mbps 36.0Mbps 54.0Mbps
    SSID 'QYJX', MAC 88:25:93:DC:F9:42, RSSI 82, Channel 12
      Timestamp 6709264125824, Beacon Interval 100, TSF timestamp: 1387281
      Capability: 0x0411 (Security: WPA2, Mode: Infrastructure)
      Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 9.0Mbps 18.0Mbps 36.0Mbps 54.0Mbps
    CMDRESP 0x8006 at 231ms
    SSID 'CMCC-rTT6', MAC C0:98:DA:A4:EC:8E, RSSI 82, Channel 13
      Timestamp 367672153121, Beacon Interval 100, TSF timestamp: 1508867
      Capability: 0x0411 (Security: WPA2, Mode: Infrastructure)
      Rates: 1.0Mbps 2.0Mbps 5.5Mbps 11.0Mbps 9.0Mbps 18.0Mbps 36.0Mbps 54.0Mbps
    Scan finished!
    CMDRESP 0x8028 at 1ms
    CMDRESP 0x8006 at 1559ms
    CMDRESP 0x80c4 at 7981ms
    CMDRESP 0x8012 at 304ms
    capability=0x0431, status_code=0x0000, aid=0xc003
    Waiting for authentication!
    [Event] code=0x0017, size=77, bss=0x00
    WMM status change event occurred!
    [Event] code=0x002b, size=10, bss=0x00
    Authenticated! bss=0x00
    [Send] len=350, bss=0x00, port=1
    [Recv] len=590, bss=0x00, port=1
    [Send] len=350, bss=0x00, port=2
    [Send] len=350, bss=0x00, port=3
    [Send] len=350, bss=0x00, port=4
    [Send] len=350, bss=0x00, port=5
    [Recv] len=590, bss=0x00, port=2
    [Send] len=42, bss=0x00, port=6
    [Send] len=42, bss=0x00, port=7
    [Send] len=42, bss=0x00, port=8
    [Send] len=42, bss=0x00, port=9
    DHCP supplied address!
    IP address: 192.168.2.102
    Subnet mask: 255.255.255.0
    Default gateway: 192.168.2.1
    DNS Server: 192.168.1.1
    [Send] len=42, bss=0x00, port=10
    Not in cache!
    [Recv] len=42, bss=0x00, port=3
    [Send] len=79, bss=0x00, port=11
    Packet port 1 released at 15103ms
    Packet port 2 released at 15009ms
    Packet port 3 released at 13079ms
    Packet port 4 released at 9079ms
    Packet port 5 released at 1079ms
    Packet port 6 released at 1059ms
    Packet port 7 released at 582ms
    Packet port 8 released at 112ms
    Packet port 9 released at 86ms
    Packet port 10 released at 74ms
    [Recv] len=95, bss=0x00, port=4
    DNS Found IP: 209.51.188.79
    TCP socket is connecting to 209.51.188.79...
    [Send] len=58, bss=0x00, port=1
    [Send] len=42, bss=0x00, port=2
    [Send] len=42, bss=0x00, port=3
    [Send] len=58, bss=0x00, port=4
    [Send] len=42, bss=0x00, port=5
    [Recv] len=60, bss=0x00, port=5
    TCP socket is connected! err=0
    [Send] len=115, bss=0x00, port=6
    [Recv] len=60, bss=0x00, port=6
    [Send] len=54, bss=0x00, port=7
    [Send] len=115, bss=0x00, port=8
    [Recv] len=590, bss=0x00, port=7
    536 bytes received!
    [Send] len=54, bss=0x00, port=9
    [Recv] len=590, bss=0x00, port=8
    536 bytes received!
    [Send] len=54, bss=0x00, port=10
    Packet port 1 released at 6738ms
    Packet port 2 released at 5766ms
    Packet port 3 released at 4767ms
    Packet port 4 released at 3997ms
    Packet port 5 released at 3771ms
    Packet port 6 released at 3525ms
    Packet port 7 released at 1298ms
    Packet port 8 released at 1007ms
    Packet port 9 released at 539ms
    Packet port 11 released at 6849ms
    [Recv] len=352, bss=0x00, port=9
    [Recv] len=42, bss=0x00, port=10
    [Recv] len=42, bss=0x00, port=11
    [Recv] len=92, bss=0x00, port=12
    [Recv] len=42, bss=0x00, port=13
    [Recv] len=92, bss=0x00, port=14
    [Recv] len=42, bss=0x00, port=15
    [Recv] len=92, bss=0x00, port=1
    [Recv] len=42, bss=0x00, port=2
    [Recv] len=590, bss=0x00, port=3
    [Send] len=54, bss=0x00, port=11
    [Recv] len=42, bss=0x00, port=4
    [Recv] len=590, bss=0x00, port=5
    [Send] len=54, bss=0x00, port=1
    [Recv] len=590, bss=0x00, port=6
    [Send] len=54, bss=0x00, port=2
    [Recv] len=42, bss=0x00, port=7
    [Recv] len=590, bss=0x00, port=8
    1608 bytes received!
    [Send] len=54, bss=0x00, port=3
    [Recv] len=590, bss=0x00, port=9
    [Send] len=54, bss=0x00, port=4
    [Recv] len=342, bss=0x00, port=10
    [Recv] len=42, bss=0x00, port=11
    [Recv] len=590, bss=0x00, port=12
    536 bytes received!
    [Send] len=54, bss=0x00, port=5
    [Recv] len=590, bss=0x00, port=13
    [Send] len=54, bss=0x00, port=6
    [Recv] len=590, bss=0x00, port=14
    1072 bytes received!
    [Send] len=54, bss=0x00, port=7
    [Recv] len=590, bss=0x00, port=15
    [Send] len=54, bss=0x00, port=8
    [Recv] len=590, bss=0x00, port=1
    1072 bytes received!
    [Send] len=54, bss=0x00, port=9
    [Recv] len=590, bss=0x00, port=2
    536 bytes received!
    -- Packet port 10 released at 24603ms
    [Send] len=54, bss=0x00, port=10
    Packet port 1 released at 13910ms
    Packet port 2 released at 13907ms
    Packet port 3 released at 13495ms
    Packet port 4 released at 13044ms
    Packet port 5 released at 1308ms
    Packet port 6 released at 883ms
    Packet port 7 released at 472ms
    Packet port 8 released at 469ms
    Packet port 11 released at 14389ms
    [Recv] len=590, bss=0x00, port=3
    [Send] len=54, bss=0x00, port=11
    [Recv] len=590, bss=0x00, port=4
    [Send] len=54, bss=0x00, port=1
    [Recv] len=590, bss=0x00, port=5
    [Send] len=54, bss=0x00, port=2
    [Recv] len=590, bss=0x00, port=6
    2144 bytes received!
    [Send] len=54, bss=0x00, port=3
    [Recv] len=590, bss=0x00, port=7
    536 bytes received!
    [Send] len=54, bss=0x00, port=4
    [Recv] len=590, bss=0x00, port=8
    536 bytes received!
    [Send] len=54, bss=0x00, port=5
    [Recv] len=590, bss=0x00, port=9
    536 bytes received!
    [Send] len=54, bss=0x00, port=6
    [Recv] len=590, bss=0x00, port=10
    536 bytes received!
    [Send] len=54, bss=0x00, port=7
    [Recv] len=590, bss=0x00, port=11
    [Send] len=54, bss=0x00, port=8
    Packet port 1 released at 2198ms
    Packet port 2 released at 1785ms
    Packet port 3 released at 1339ms
    Packet port 4 released at 905ms
    Packet port 5 released at 900ms
    Packet port 6 released at 479ms
    Packet port 7 released at 474ms
    Packet port 9 released at 2664ms
    Packet port 10 released at 2655ms
    Packet port 11 released at 2235ms
    [Recv] len=590, bss=0x00, port=12
    [Send] len=54, bss=0x00, port=9
    [Recv] len=590, bss=0x00, port=13
    [Send] len=54, bss=0x00, port=10
    [Recv] len=590, bss=0x00, port=14
    2144 bytes received!
    [Send] len=54, bss=0x00, port=11
    [Recv] len=590, bss=0x00, port=15
    536 bytes received!
    [Send] len=54, bss=0x00, port=1
    [Recv] len=590, bss=0x00, port=1
    536 bytes received!
    [Send] len=54, bss=0x00, port=2
    [Recv] len=253, bss=0x00, port=2
    [Recv] len=590, bss=0x00, port=3
    536 bytes received!
    [Send] len=54, bss=0x00, port=3
    [Recv] len=590, bss=0x00, port=4
    [Send] len=54, bss=0x00, port=4
    [Recv] len=590, bss=0x00, port=5
    [Send] len=54, bss=0x00, port=5
    [Recv] len=42, bss=0x00, port=6
    [Recv] len=42, bss=0x00, port=7
    [Recv] len=590, bss=0x00, port=8
    536 bytes received!
    [Send] len=54, bss=0x00, port=6
    [Recv] len=42, bss=0x00, port=9
    [Recv] len=42, bss=0x00, port=10
    [Recv] len=590, bss=0x00, port=11
    1072 bytes received!
    [Send] len=54, bss=0x00, port=7
    Packet port 1 released at 19064ms
    Packet port 2 released at 19059ms
    Packet port 3 released at 15102ms
    Packet port 4 released at 1345ms
    Packet port 5 released at 901ms
    Packet port 6 released at 457ms
    Packet port 8 released at 20394ms
    Packet port 9 released at 20360ms
    Packet port 10 released at 19968ms
    Packet port 11 released at 19546ms
    [Recv] len=42, bss=0x00, port=12
    [Recv] len=42, bss=0x00, port=13
    [Recv] len=590, bss=0x00, port=14
    536 bytes received!
    [Send] len=54, bss=0x00, port=8
    [Recv] len=590, bss=0x00, port=15
    [Send] len=54, bss=0x00, port=9
    [Recv] len=590, bss=0x00, port=1
    [Send] len=54, bss=0x00, port=10
    [Recv] len=590, bss=0x00, port=2
    536 bytes received!
    [Send] len=54, bss=0x00, port=11
    [Recv] len=590, bss=0x00, port=3
    1608 bytes received!
    [Send] len=54, bss=0x00, port=1
    [Recv] len=590, bss=0x00, port=4
    536 bytes received!
    [Send] len=54, bss=0x00, port=2
    [Recv] len=590, bss=0x00, port=5
    536 bytes received!
    [Send] len=54, bss=0x00, port=3
    [Recv] len=590, bss=0x00, port=6
    536 bytes received!
    [Send] len=54, bss=0x00, port=4
    [Recv] len=590, bss=0x00, port=7
    536 bytes received!
    [Send] len=54, bss=0x00, port=5
    [Recv] len=590, bss=0x00, port=8
    [Send] len=54, bss=0x00, port=6
    Packet port 1 released at 1335ms
    Packet port 2 released at 887ms
    Packet port 3 released at 879ms
    Packet port 4 released at 874ms
    Packet port 5 released at 471ms
    Packet port 7 released at 58068ms
    Packet port 8 released at 2241ms
    Packet port 9 released at 1815ms
    Packet port 10 released at 1812ms
    Packet port 11 released at 1371ms
    [Recv] len=590, bss=0x00, port=9
    [Send] len=54, bss=0x00, port=7
    [Recv] len=590, bss=0x00, port=10
    536 bytes received!
    [Send] len=54, bss=0x00, port=8
    [Recv] len=590, bss=0x00, port=11
    [Send] len=54, bss=0x00, port=9
    [Recv] len=590, bss=0x00, port=12
    [Send] len=54, bss=0x00, port=10
    [Recv] len=590, bss=0x00, port=13
    2144 bytes received!
    [Send] len=54, bss=0x00, port=11
    [Recv] len=590, bss=0x00, port=14
    [Send] len=54, bss=0x00, port=1
    [Recv] len=590, bss=0x00, port=15
    [Send] len=54, bss=0x00, port=2
    [Recv] len=590, bss=0x00, port=1
    [Send] len=54, bss=0x00, port=3
    [Recv] len=590, bss=0x00, port=2
    [Send] len=54, bss=0x00, port=4
    [Recv] len=590, bss=0x00, port=3
    2144 bytes received!
    [Send] len=54, bss=0x00, port=5
    Packet port 1 released at 904ms
    Packet port 2 released at 463ms
    Packet port 3 released at 459ms
    Packet port 4 released at 450ms
    Packet port 6 released at 8389ms
    Packet port 7 released at 7947ms
    Packet port 8 released at 5584ms
    Packet port 9 released at 1815ms
    Packet port 10 released at 1376ms
    Packet port 11 released at 937ms
    [Recv] len=590, bss=0x00, port=4
    536 bytes received!
    [Send] len=54, bss=0x00, port=6
    [Recv] len=590, bss=0x00, port=5
    [Send] len=54, bss=0x00, port=7
    [Recv] len=590, bss=0x00, port=6
    [Send] len=54, bss=0x00, port=8
    [Recv] len=342, bss=0x00, port=7
    [Recv] len=42, bss=0x00, port=8
    [Recv] len=590, bss=0x00, port=9
    1608 bytes received!
    [Send] len=54, bss=0x00, port=9
    [Recv] len=590, bss=0x00, port=10
    536 bytes received!
    [Send] len=54, bss=0x00, port=10
    [Recv] len=590, bss=0x00, port=11
    536 bytes received!
    [Send] len=54, bss=0x00, port=11
    [Recv] len=590, bss=0x00, port=12
    536 bytes received!
    [Send] len=54, bss=0x00, port=1
    [Recv] len=590, bss=0x00, port=13
    536 bytes received!
    [Send] len=54, bss=0x00, port=2
    [Recv] len=590, bss=0x00, port=14
    536 bytes received!
    [Send] len=54, bss=0x00, port=3
    [Recv] len=590, bss=0x00, port=15
    536 bytes received!
    [Send] len=54, bss=0x00, port=4
    Packet port 1 released at 444ms
    Packet port 2 released at 43ms
    Packet port 5 released at 7932ms
    Packet port 6 released at 7483ms
    Packet port 7 released at 7032ms
    Packet port 8 released at 6594ms
    Packet port 9 released at 904ms
    Packet port 10 released at 482ms
    Packet port 11 released at 477ms
    [Recv] len=590, bss=0x00, port=1
    536 bytes received!
    [Send] len=54, bss=0x00, port=5
    [Recv] len=590, bss=0x00, port=2
    536 bytes received!
    [Send] len=54, bss=0x00, port=6
    [Recv] len=590, bss=0x00, port=3
    536 bytes received!
    [Send] len=54, bss=0x00, port=7
    [Recv] len=567, bss=0x00, port=4
    [Send] len=54, bss=0x00, port=8
    [Recv] len=590, bss=0x00, port=5
    1049 bytes received!
    TCP socket is closed! err=0, count=33209
    [Send] len=54, bss=0x00, port=9
    [Recv] len=60, bss=0x00, port=6
    [Recv] len=42, bss=0x00, port=7
    [Recv] len=42, bss=0x00, port=8
    [Recv] len=42, bss=0x00, port=9
    [Recv] len=352, bss=0x00, port=10
    [Recv] len=42, bss=0x00, port=11
    [Recv] len=92, bss=0x00, port=12
    [Recv] len=92, bss=0x00, port=13
    [Recv] len=42, bss=0x00, port=14
    [Recv] len=92, bss=0x00, port=15
    [Recv] len=42, bss=0x00, port=1
    [Recv] len=42, bss=0x00, port=2
    [Recv] len=42, bss=0x00, port=3

     

    展开全文
  • 该程序是旧版本!... 本程序所用的单片机型号为:STM32F103ZE 可以用STM32F103RE或STM32F103RD,但是STM32F103RC不行...PB12端口为复位引脚,请务必连接! 晶振用的是8MHz,请注意检查自己的开发板,看看晶振是不是8MH...

    该程序是旧版本!最新版本为20200208版:
    https://blog.csdn.net/ZLK1214/article/details/104229202

    本程序所用的单片机型号为:STM32F103ZE
    可以用STM32F103RE或STM32F103RD,但是STM32F103RC不行!
    PB12端口为复位引脚,请务必连接!
    晶振用的是8MHz,请注意检查自己的开发板,看看晶振是不是8MHz。如果是12MHz,请修改system_stm32f10x.c文件!

    程序支持连接无密码的热点以及WPA-PSK和WPA2-PSK认证类型的热点,加密方式支持TKIP和AES。
    程序暂不支持WEP加密方式,也不支持Ad-Hoc模式,或创建AP热点(路由器热点)。

    用Keil5编写程序的时候,工程文件夹路径最好不要出现中文哦!不然代码提示可能会有问题
    wifi_88w8801是主程序,直接打开下载运行即可。该程序裸机运行,不带操作系统,运行最新的lwip-2.0.3协议栈

    sd8801_uapsta.c是WiFi模块的固件,上电运行时必须由单片机发送给WiFi模块运行
    该固件数据非常大,为了节约程序编译下载的时间,可以运行flash_saver程序将这些数据保存到Flash固定区域(要求芯片为STM32F103xE或以上)
    然后根据串口提示,修改WiFi.h中WIFI_FIRMWAREAREA_ADDR的值(取消注释)
    这样就可以移除sd8801_uapsta.c文件,大幅度降低程序烧写时间了

    Keil5工程下载地址:https://pan.baidu.com/s/10TUtgyUN1HIJHwOeWUtwow

    本程序由STM32F103RE单片机无操作系统驱动88W8686模块的程序(20180706版)修改而来。主要改动如下:
    1. 修改了寄存器的定义。88W8801的寄存器位置与88W8686不一样
    2. 修改了固件下载函数WiFi_DownloadFirmware。88W8686有两个固件,先下载helper_sd后下载sd8686,但88W8801只有一个固件:sd8801_uapsta
    3. 修改了WiFi_LowLevel_GetBlockNum函数。该函数不再返回0,因为88W8801仅在下载固件时才能使用多字节模式(高速模式下也行)
       提示:从CIS信息中可以看出,88W8801最大允许的块大小为512,所以在下载固件前就用WiFi_LowLevel_SetBlockSize函数把Function 1的块大小设为512,之后保持不动,也是可以的
    4. 修改了WiFi_LowLevel_GPIOInit函数。88W8801模组的复位引脚是PDN,低电平有效,不需要像88W8686那样在电源引脚上外接三极管辅助复位
    5. 88W8686只有一个数据通道,但88W8801有11个数据通道,所以wifi_tx_packet全局变量变成了一个数组,修改了数据帧的发送、接收和确认代码
    6. 88W8801的固件自带EAPOL认证功能,所以程序中去掉了处理EAPOL认证代码。WiFi_KeyMaterial函数也做了修改,仅支持获取密钥,不支持设置密钥
    7. 88W8801的数据帧描述符和88W8686不一样。命令头部的seq_num变成了8字节,多了一个bss字段。事件头部event_id变成了16字节,多了bss_num和bss_type字段。有些事件的结构中不包含mac_address等字段。
    8. 88W8686支持Ad-hoc模式,但88W8801不支持。笔者暂时不确定88W8782是否支持Ad-hoc,所以把Ad-hoc代码保留在了程序中,模块在不支持的情况下会提示Ad-hoc mode is unsupported
    9. 新增事件:Event 23(WWM事件)和Event 43(认证成功事件),WiFi_AuthenticationCompleteHandler函数在43号事件产生时调用

    10. 修改了WiFi_LowLevel_VerifyFirmware函数。函数会检查WIFI_FIRMWARE_SIZE的值是否有效,避免出现Hard Error错误
        flash saver程序也会检查芯片Flash总大小是否合法
    11. 添加了RTC时钟类型检测代码。当当前运行的RTC时钟与宏定义RTC_USELSI不符时自动重置RTC
    12. 把程序中用netif_set_up/down的地方都改成了netif_set_link_up/down。用netif_is_link_up函数可判断WiFi是否已连上网
        在low_level_init函数中去掉了默认的NETIF_FLAG_LINK_UP选项, 因为无线网卡默认是未连接状态
    13. 修改了wifi_test中的测试代码,测试DNS时会检查tcp_connect函数的返回值,连接建立成功后不是立即关闭连接,而是发送一个简单的HTTP请求接收网页数据,最后(被动)等待连接关闭

    【勘误】

    2018年8月1日:测速器上位机程序中,network.c里面的network_find_ip函数中,freeaddrinfo函数调用的位置不对,因为传入的参数info始终为NULL,应该传入的是getaddrinfo从第四个参数返回的值。正确的代码为(https://blog.csdn.net/ZLK1214/article/details/79595245)中的方法二的代码

    【模块连线】

    模块底板的PCB文件(可以自己打一个PCB出来):https://pan.baidu.com/s/1afb3dmeBSm_LuHIxzgYggA

    顶层:

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

    底层:


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

    【Keil5工程截图】

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

    【程序运行截图】

    1. 串口输出

    2. ping IP地址和计算机名

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

    【程序运行结果】

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

     

    展开全文
  • 解决问题:两个模块同时上电,两个手机分别连接两个模块,两个都连不上1.进入后台http://192.168.1.2542.在系统命令行控制台中输入以下命令flash set HW_NIC0_ADDR 00e04c812ec1flash set HW_NIC1_ADDR 00e04c812ec9...
  • <div><p>该提问来源于开源项目:EspressifApp/EsptouchForIOS</p></div>
  • 无线路由器之RM04 WIFI模块资源如下: ATK-RM04模块支持RS232串口和LVTTL串口,支持DC6V~16V宽电压工作范围,支持串口转以太网、串口转WIFI STA、串口转WIFI AP等连接形式,从而快速构建串口-网络数据传输方案,方便...
  • 随之而来的是,智能家居的设备智能化,很多家电设备都安装上了 WiFi 模块, 方便用户通过手机控制和远程查看家里情况,典型的设备如智能插座,智能空调,智能净化器。 转入正题,对于智能设备首次配置,这个过程简单...
  • 1:使用网页设置加入路由器方法链接http://www.gu-wen.com/Faq/304.html。前提是保证设置连接路由器可以上网。...监听本地端口25568.WiFi模块主动向服务器发起链接,可以在连接对象看到模块发起...
  • --D1 wifi模块连接网络

    千次阅读 2020-01-31 10:08:58
    做硬件实验,切记不要奢望一蹴而就。哪怕是对照网络上的文章一步步操作,...本次实验要实现的D1 wifi模块扫描可以发现的所有路由器。 一、实验条件 (一)D1 wifi 模块。 (二)arduino编程环境1.8.9版本 (...
  • 一:WiFi模块端的设备只需要连接可以上网的路由器即可。1:使用网页设置加入路由器方法链接http://www.gu-wen.com/Faq/304.html。前提是保证设置连接路由器可以上网。2:在透传参数设置模块协议为TCP client链接...
  • WIFI模块实现网络连接

    千次阅读 2019-07-28 15:02:14
    WiFi模块连接,通过串口调试助手来配置 STA+连接TCP Server 1,AT+CWMODE_DEF=1 !!工作在单station模组,设置参数保存到flash 2,AT+CWJAP_DEF=“newifi_F8A0”,“anxinke123” !!连接路由器,保存到flash 3,AT+...
  • 它完全符合IEEE 802.11n及IEEE 802.11 b/g标准,提供高标准而功能丰富的无线连接,并可从更远的距离提供可靠稳定、具成本效益的处理能力。优化的射频架构及基频算法带来卓越的效能表现,以及...
  • 1. 设置模块连接路由器,并打印路由器分配的ip:Init.lua文件:tmr.alarm(0,4000,0,function()&nbsp; &nbsp; dofile("tcpclient.lua") end)Init.lua文件结束tcpclient.lua文件:wifi.setmode(wifi...
  • ESP8266 连接路由器后无规律重启 手中两块ESP8266 12F的模块, 烧入Micropython 1.14. 连接到WIFI路由器后却不停重新启动, 同样的程序烧入同期入手的ESP32S模块工作正常, 殊为怪异, 不得其解, 网上检索,也没看到相关...
  • 以开发板fl2440作为一个路由器,并使自己的手机、笔记本电脑连接到这个“路由器”上网。 一、配置内核支持无线网卡softAP模式 [*] Networking support ---> Networking options ---> [*] Network packet ...
  • 物联网wifi模块一键配置

    千次阅读 2017-02-21 00:51:38
    为什么会有一键配置?... 一种办法就是AP配置,即wifi 处于AP 模式, 手机连接wifi 模块,通过TCP/UDP 通信将 将要连接路由器的SSID 和 密码发给wifi 模块,然后wifi 模块切换模式连接该路由器,与AP 模式
  • ESP8266WiFi模块使用(STA+连接TCP Server在单片机上使用) 1.引脚说明 VCC连接正极,GND连接负极 RXD:数据的接收端 TXD:数据的发送端 RST: 复位,低电平有效 IO_0:用于进入固件烧写模式,低电平->烧写,高电平->...
  • 使用M0E1系列AP配网功能连接路由器什么是AP配网M0E1系列模组AP配网实现过程1.设置WIFI模块工作模式2.设置AP的名称3.设置AP的密码4.数据交互4.注意点说明 什么是AP配网 AP配网即是传统配网,是一种配网成功率很高的...
  • 嵌入式串口WIFI模块

    2011-12-05 13:29:47
    支持基于AP的网络(Infrastructure)/对等网络Ad-Hoc (IBSS))/ 虚拟AP 模式 ,IPHONE/ IPAD/Android 设备也能不用AP/路由器而直接连接 支持802.11i加密方式:WEP-64/128, TKIP (WPA-PSK) and AES (WPA2-PSK) ...
  • 03串口Wifi模块是基于Uart接口的符合wifi无线网络标准的嵌入式模块,内置无线网络协议IEEE802.11协议栈以及TCP/IP协议栈,能够实现用户串口数据到无线网络之间的转换。通过Uart-Wifi模块,传统的串口设备也能轻松接...
  • WIFI模块ESP8266

    2021-01-15 01:38:31
    WIFI模块ESP8266 一、工作模式 工作模式一共有三种: Station 模式: 相当于终端,连接其他的路由器,不能被其他的设备连接(相当于没有热点的手机) AP 模式 提供无线接入服务,允许其他无线设备接入,模块自己就...
  • 串口WIFI模块简介彩页

    2011-12-05 13:40:02
    支持基于AP的网络(Infrastructure)/对等网络Ad-Hoc (IBSS))/ 虚拟AP 模式 ,IPHONE/ IPAD/Android 设备也能不用AP/路由器而直接连接 支持802.11i加密方式:WEP-64/128, TKIP (WPA-PSK) and AES (WPA2-PSK) MCU...
  • wifi模块ESP8266

    2019-07-28 15:26:07
    两种模式共存,既可以通过路由器连接到互联网,也可以作为WiFi热点,使其他设备连接到这个模块,实现广域网与局域网的无缝切换。 ESP8266的引脚: VCC连接正极,GND连接负极。 RX:数据的接收端 ,连接单片机或者USB转TTL...

空空如也

空空如也

1 2 3 4 5 ... 14
收藏数 266
精华内容 106
关键字:

wifi模块连接路由器