How to control a BeagleBone's pin remotly using a webserver?


The idea is to be able to control one pin of BeagleBone using a web interface.
Something similar to blink.js but triggered by a user through HTTP.

What is the simplest way to do this?

Thank you

if you google nodejs http server there is plenty of example material out there, a basic nodejs server is just a few lines of code.
There are also lots of examples using to communicate between client and server.

The simplest way would be to use bonescript, take a look at the weatherstation project to see how this can been done.
bonescrcipt also allows you to configure the pins you want to use.

You would simply need to add event emitters to your client side code depending on how you want to control it like so:

socket.emit(‘pinName’, pinValue);

to do this with a button would be:


then to add the event listener to the server side code:

client.on(‘pinName’, function(data){
digitalWrite( pinName, data);
//and any other code you want to execute when the button is pressed

Hope this helps