Tag: web server command file

1 articles found.

Getting Data From Webserver using Arduino Wifi

Arduino UNO and original WiFi Shield for web control, Arduino UNO, WiFi Shield, web controlled LEDs

Hello friends! In this tutorial, we will learn how to get data from a web server using an Arduino UNO and the original Arduino WiFi Shield. We will use that data to switch two LEDs, so you can see how a command stored on a server becomes an action on a microcontroller. There are two parts to this project: a web page that changes a command file, and an Arduino client that reads the file periodically. We will discuss both parts in the same order as the original project, with clearer wiring, a defined response format and checks that prevent an incomplete response from becoming an LED command. This is a legacy-shield tutorial. The WiFi library and pin assignments described here belong to the original shield, not every board with WiFi in its name. We will first run the demonstration on a trusted local network; using it across the public internet requires a secure gateway or a suitable modern networking implementation. The Arduino acts as a client. It opens a connection to a server, requests a small resource and reads the response. The server does not need a direct incoming connection to the Arduino. This polling arrangement is useful when the board is behind a home router, although it introduces a delay between clicking a button and seeing the result. Our original interface had four buttons: LED 1 ON, LED 1 OFF, LED 2 ON and LED 2 OFF. Each button saved a command in a text file. The Arduino then translated that command into a digital output. We will preserve this simple command ...