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.
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.
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:
- For a Web Switch using a WIZ550io or W5500 Ethernet module see WebSwitch_Wiz550io.
- For a Web Switch using mbed's built in Ethernet PHY see WebSwitch_mbed-dev or WebSwitch_mbed-os .
Revisions of UIPEthernet.lib
Revision | Date | Message | Actions |
---|---|---|---|
16:f348413be13e | 2020-06-05 | Tiny HTTP server to remotely turn a DigitalOut on/off. | File Diff Annotate |
15:9beb9b99695d | 2020-06-05 | Tiny HTTP server to remotely turn a DigitalOut on/off. | File Diff Annotate |
14:810ac368dd6e | 2019-09-07 | Updated. | File Diff Annotate |
13:47cb5f3e3ecf | 2019-09-03 | Updated to use the latest version of UIPEthernet library. | File Diff Annotate |
12:7c46dcf6f7e2 | 2019-08-30 | Updated. | File Diff Annotate |
11:6c0b20227ca2 | 2019-08-27 | Updated to use the latest UIPEthernet library. | File Diff Annotate |
10:b47c7921346f | 2019-08-27 | Mbed OS 5 enabled. | File Diff Annotate |
8:3bd85b731cca | 2017-06-30 | Updated. | File Diff Annotate |
6:b38a3b476a45 | 2016-08-28 | Wrong SPI pin assignment fixed. Added support for STM32F103C8T6 boards. | File Diff Annotate |
5:0ab8292e37da | 2015-03-16 | Updated | File Diff Annotate |
3:0133517ba02d | 2014-12-20 | Updated to work with the UIPEthernet library rev. 02. | File Diff Annotate |
0:68a0003c4cb8 | 2014-09-15 | rev. 00 | File Diff Annotate |