主要内容

Wi-Fi

使用 Wi-Fi 通信

Wi-Fi® 允许设备以无线方式连接到局域网。基于 IEEE® 802.11 标准,Wi-Fi 通常用于提供 Internet 访问并支持设备间无需物理电缆的通信。

使用 Wi-Fi 扩展板作为 Arduino® 板的附加功能以扩展其 Wi-Fi 功能。这些扩展板使板能够连接到无线网络,从而允许它们通过 Internet 或本地网络发送和接收数据。

模块

WiFi TCP/IP ReceiveReceive data over TCP/IP network from remote host on wireless network
WiFi TCP/IP SendSend data over TCP/IP network to remote host over wireless network
WiFi UDP ReceiveReceive data from UDP host on wireless network
WiFi UDP SendSend data to UDP host on wireless network
WiFi ThingSpeak ReadRead data stored in a ThingSpeak channel on wireless network
WiFi ThingSpeak WritePublish data to Internet of Things using ThingSpeak on wireless network
WebSocket SubscribeSubscribe to the JSON data received by a WebSocket server
WebSocket PublishPublish data to WebSocket server in JSON format
WiFi MQTT PublishPublish messages to message queuing telemetry transport (MQTT) broker (自 R2022b 起)
WiFi MQTT SubscribeReceive messages from message queuing telemetry transport (MQTT) broker (自 R2022b 起)
WiFi HTTP ClientSend and receive data from HTTP server over URL connection (自 R2023a 起)

模型设置

全部展开

WiFi 硬件Hardware used for Wi-Fi connectivity
使用静态 IP 地址并禁用 DHCPOption to disable the DHCP
IP 地址IP address of Arduino WiFi hardware
服务集标识符(SSID)SSID of network
WiFi 加密WiFi encryption of network
WPA 密码WPA password of network
硬件串行端口Port on the Arduino board that is connected to ESP8266
用户名Username of the WPA2 Enterprise credential (自 R2022a 起)
密码Password of WPA2 Enterprise credential (自 R2022a 起)
IP 地址分配Method to assign IP address (自 R2024a 起)
DNS 服务器地址IP address for domain name system (DNS) server (自 R2024a 起)
网关地址IP address of default gateway (自 R2024a 起)
子网掩码Subnet mask of network (自 R2024a 起)
代理服务MQTT broker service provider that receives, filters, and sends messages to clients (自 R2022b 起)
代理地址Web address associated with MQTT broker (自 R2022b 起)
端口Port number associated with MQTT broker (自 R2022b 起)
用户名User name of the MQTT client (自 R2022b 起)
密码Password of the MQTT client (自 R2022b 起)
客户端 IDIdentification number of MQTT client (自 R2022b 起)
连接到自定义 ThingSpeak 服务器Option to connect to custom ThingSpeak server
服务器 IP 地址IP address of custom ThingSpeak server
端口Port number through which the ThingSpeak block connects to ThingSpeak server

主题

疑难解答

Unable to Deploy Code on an Arduino Board Connected to an ESP8266

No separate serial port is available on Arduino Uno board to deploy code.

Unable to Connect ESP8266 to Wi-Fi Network

Connection between ESP8266 and Wi-Fi network failed.

Unable to Assign IP Address to an Arduino Board Connected to ESP8266

Failed to assign IP address to Arduino board connected to ESP8266.

Unable to Assign IP Address to an Arduino MKR1000 Board

Failed to assign IP address to Arduino MKR WIFI 1010 board.

Unable to Assign IP Address to an Arduino MKR WIFI 1010 Board

Failed to assign IP address to Arduino MKR WIFI 1010 board.

Unable to Assign IP Address to an Arduino Board Connected to WiFi Shield

Failed to assign IP address to Arduino board connected to WiFi shield.

Expected Data Not Received on WiFi TCP or UDP Receive Block

Data received on the WiFi TCP Receive block or WiFi UDP Receive block is incorrect.

WiFi TCP/IP Send or Receive Server Block Is Unable to Communicate to TCP/IP Client

In server mode, the WiFi TCP/IP block is unable to communicate with TCP/IP client.

WiFi TCP/IP Send or Receive Client Block Is Unable to Communicate to TCP/IP Server

In client mode, the WiFi TCP/IP block is unable to communicate with TCP/IP server.

WiFi ThingSpeak Write Block Unable to Upload Data to a ThingSpeak Channel

Data is not uploaded on ThingSpeak channel.

精选示例