Basic UDP Hello GPIO Example
UDP Client sends GPIO values to a remote server
- SDK directory:
API Features Demonstrated
This app works on:
Requirements and Prerequisites
Requires a Gecko OS evaluation board, such as a WGM160P_eval.
Other Gecko OS hardware can also be used by changing the source of the logged data to suit your device.
This is a basic UDP client application. The app:
- Connect as a UDP client to the remote UDP server
- Reads the current state of all GPIOs
- Writes the GPIO values into a buffer
- Sends the buffer to the remote server in a UDP packet
Open a Gecko OS serial terminal to the device. See Getting Started, Opening a Gecko OS Terminal.
This app assumes your Gecko OS device is set up with the credentials to join your local network. If you have not already set up network credentials, on the Gecko OS terminal, run the commands:
network_up -s save
See the Wi-Fi Command API documentation for network_up and save.
After building, downloading and running the app, it joins the network and connects to the test server.
Output on the Gecko OS terminal is as follows:
> Connecting to remote UDP server test.zentri.com:50007 Sending data Finished