9 years, 4 months ago.

Control LED over Ethernet

I have an FRDM-K64F and I want to be able to control an LED (turning it on an off) over the Ethernet from a laptop. The way I see it in my head is that my FRDM-K64F is connected with an Ethernet cable to my router. On the controlling end of things, my laptop could be anywhere else in the world that has internet access and I would press a key to turn the LED on and another key to turn the LED off. Or maybe there would be a GUI with buttons to press on the screen. I do not have any experience with Ethernet interfacing. Would it be possible to have my program controlled through Tera Term? Would I have to create an HTTP server (I don't know how to do this yet)? I don't know if I am looking at this the right way. Maybe there is another approach that could help me reach my goal that I am unaware of. Could someone point me in the right direction? Simplicity would be best if possible.

Thanks.

2 Answers

9 years, 4 months ago.

This may be similar to what you are looking for but uses a simple and cheap ESP8266 Wi-Fi module that connects to your router or remotely if you open a port on your router. I haven't tried with wired Ethernet connection so can't help any further.

https://developer.mbed.org/users/star297/code/ESP8266-WEB-Mbed-Controller/

9 years, 4 months ago.

Your best bet is to look at the RPC over HTTP projects (try this one http://developer.mbed.org/users/feb11/code/HTTP-Server/). This will provide you will a HTTP server to serve pages as the UI and the ability to create an RPC object to control your LED (in fact just about any other peripheral as well). You can use the K64F's SD card to store the pages and use jQuery to make the calls to the server to turn off your LED in response to button presses.

Hope this get you going