emscom > emscom Help Desk > Knowledgebase

Search help:

Arduino WiFiUDP


Arduinp WiFi sheld (official) UDP notes

Arduino introduced UDP support for the WiFi with firmware 1.1.0

WiFi Shield Firmware

The firmware version can be checked by calling WiFi.version() within a sketch.  The version may also be checked directly, using a USB to FTDI cable connected to the 4 pin FTDI header on the shield.  It is also possible to check the version directly, using an Arduino MC (Uno etc) in the role of FTDI converter. 

Firmware versions prior to 1.1.0 reported 1.0.0 regardless of build and must be reflashed to support UDP.

There are two firmware files, which must be flashed separately and in the right order.  The WiFi library code and the WiFi shield firwmare are interdependant.  The firmware version and library must match.  The firmware files are library files and shipped with the Arduino application.  To locate the firmware files;

On Windows. open the folder the Arduino application is installed in (\Program Files) and navigate to .\hardware\arduino\firmwares\wifishield\binary subfodler.

On OSX.  Using Finder, open the \Applications directory and control+click the file, to open the context menu.  Select Show Package Contents, then navigate to, ./Contents/Resources/java/hardware/arduino/firmwares/wifishield/binary   

Firmware re-flashing procedures are beyond the scope of this document, but may be easily found using Google.


Socket use and Limits

The Arduino WiFi shield supports up to 4 simultaneous connections, referred to as sockets.  I have yet to find a way to recycle sockets after they have been consumed.

WiFiUDP.begin(localport) will consume a socket and should only be called once per connection, per sketch.

WiFiUDP.flush(); WiFiUDP.stop(); does not appear to properly free the socket, contrary to the documentation. 

There is a 90 byte limit on the size of UDP payload data.  Attempting to send 91+ bytes will cause the operation to fail silently.  The limit is imposed by the SPI library code.  Increasing the limit will not be straightforward. The operation fails within the spi_drv library, during WiFiUdp.Write(), when command and data are being transferred to the shield, across the SPI interface.


Was this article helpful? yes / no
Related articles Arduino WiFiClient (TCP)
Arduino Wifi Firmare upgrade (win)
ST7920 Graphical LCD SPI Wiring
ESXi 6 Restore configuration across hosts
Article details
Article ID: 49
Category: Arduino
Date added: 23-10-2013 06:33:00
Views: 1199
Rating (Votes): Article rated 2.9/5.0 (15)

« Go back

Powered by Help Desk Software HESK, in partnership with SysAid Technologies