HTTP Server serving a simple webpage which enables to remotely turn a digital output on/off. Compile, download, run and type 'IP_address/secret/' (don't forget the last '/') into your web browser and hit ENTER.

Dependencies:   UIPEthernet

Turn LED1, or other digital output, on/off using a web browser.

In this example we create a HTTP server that will serve a simple Web page to remotely turn LED1, or other digital output on the mbed board, on/off by using a web browser. An inexpensive ENC28J60 Ethernet module is used to assure connection between the mbed board and the Ethernet network (Internet). The ENC28J60 Ethernet module is driven by the UIPEthernet library.

Needed parts:

  • mbed board
  • ENC28J60 Ethernet module
  • Wires
  • Web browser (Internet Explorer, Safari, Firefox, Chrome ...) running on Windows, Mac, Linux, iPhone or Android device.
/media/uploads/hudakz/webswitch_enc.jpg/media/uploads/hudakz/webswitch_mobile01.jpg

Notice that DHCP is turned on by default. If you prefer to use static IP address then uncomment line 234

The IP address assigned to the WebSwitch server along with an instruction how to use it is printed in the connected PC's serial terminal window during program start up.

Warning

Please notice that the 3.3V power supply chip (RT8183-B) installed on an STM32F103C8T6 board is not rated to power also the ENC28J60 board.


The project was inspired by the Tuxgraphics Web Switch. Thank you Guido!

NOTE:

Revision:
1:3d9c83af7246
Parent:
0:68a0003c4cb8
Child:
2:76f339a1ba9b
--- a/main.cpp	Mon Sep 15 11:17:50 2014 +0000
+++ b/main.cpp	Mon Sep 15 13:35:22 2014 +0000
@@ -1,6 +1,6 @@
 /* In this example LED1 is switched on/off using a web browser connected to this HTTP server.
  * The example is based on the Tuxgraphics Web Switch <tuxgraphics.org>.
- * This HTTP server is built around the UIPEthernet library for the ENC28J60 chip <https://github.com/ntruchsess/arduino_uip>
+ * This HTTP server is built around the the ENC28J60 chip driven by the UIPEthernet library <https://github.com/ntruchsess/arduino_uip>
  * ported to mbed.
  */