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 .
Revision 17:a344f80b4f19, committed 2020-07-23
- Comitter:
- hudakz
- Date:
- Thu Jul 23 15:32:33 2020 +0000
- Parent:
- 16:f348413be13e
- Commit message:
- HTTP Server serving a simple webpage which enables to remotely turn a digital ouput on/off.
Changed in this revision
UIPEthernet.lib | Show annotated file Show diff for this revision Revisions of this file |
mbed-os.lib | Show annotated file Show diff for this revision Revisions of this file |
diff -r f348413be13e -r a344f80b4f19 UIPEthernet.lib --- a/UIPEthernet.lib Fri Jun 05 15:23:09 2020 +0000 +++ b/UIPEthernet.lib Thu Jul 23 15:32:33 2020 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/users/hudakz/code/UIPEthernet/#1123c3fe86ca +https://os.mbed.com/users/hudakz/code/UIPEthernet/#8d5738a6646e
diff -r f348413be13e -r a344f80b4f19 mbed-os.lib --- a/mbed-os.lib Fri Jun 05 15:23:09 2020 +0000 +++ b/mbed-os.lib Thu Jul 23 15:32:33 2020 +0000 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-os/#8b0956030a291ba140891899a87a179f337a7062 +https://github.com/ARMmbed/mbed-os/#a2ada74770f043aff3e61e29d164a8e78274fcd4