Using WiFi Communication (UDP protocol) – Example 2

Introduction

Communication plays an important role in distributed applications. It allows devices in a system to communicate with each other in order to exchange information or coordinate to perform some tasks. Depending on the communication requirements of the application such as wired / wireless, short distances / long distances, data transfer rates, security etc., suitable communication methods can be selected. In this work, WiFi communication (UDP protocol) is chosen to demonstrate its application through the following examples. (The examples are broken down into their own links for easy access)using wifi communication udp protocol example 2

EXAMPLE 1 demonstrates application of using WiFi communication for exchanging data between DragonBoard and Raspberry Pi 3 over a WiFi network. The DragonBoard is responsible for requesting measurements from the MPU-9255 and LIDAR Lite v2 sensors and packing the measurement data into packages before sending to the Raspberry Pi 3. A Producer/ Consumer pattern using a BufferBlock concurrent collection is implemented for the sending and receiving data.

EXAMPLE 2 demonstrates another application of using WiFi communication in transferring data between a DragonBoard (or Raspberry Pi 3) and a computer via a local WiFi network. In this example, the DragonBoard requests measurements of temperature and humidity from a SHT21 sensor. These measurements are also packed into data packages and then sent to the computer. A LabVIEW application in the computer is designed to receive these data packages and plot the temperature and humidity measurements on the monitor.

WiFi communication using UDP Protocol

WiFi communication is wireless connections that enable devices to communicate over radio signal. UDP and TCP are two primary protocols using in WiFi communication. TCP stands for Transmission Control Protocol and UDP stands for User Datagram Protocol. TCP is a connection-oriented protocol. It is suited for applications that require high reliability, and transmission time is relatively less critical. In contrast, UDP is a connectionless protocol. It is preferred for applications that need fast, efficient transmission. The selection of the protocols depends on an application. [1]

To be able to use WiFi communication, a WiFi network must be established. In addition, the devices in the network must be equipped with WiFi hardware. DragonBoard 410c and Raspberry Pi 3 already have built-in WiFi hardware so there is no need for any external WiFi adapter. A WiFi network can be formed easily by an Access Point. However, what if an Access Point is not available or the WiFi network is restricted to access? In this case, a Virtual WiFi network can be created by a software solution with a laptop integrated with a WiFi NIC card or a computer equipped with a Wireless USB Adapter.using wifi communication udp protocol example 2

If a Virtual WiFi network is needed, the following commands can be executed in the “Command Prompt” (Run as Administrator) to create a Microsoft Virtual Network.

For more detail: Using WiFi Communication (UDP protocol) – Example 2

Scroll to Top