On Saturday, February 8, 2014 8:28:22 AM UTC+11, Jake Swensen wrote: > > OS Image: Ubuntu Precise 12.04.3 LTS > > I'm attempting to control LEDs from a webpage (and eventually other > hardware from the device tree overlay). I've written a C program to toggle > the onboard LED based on the arguments passed to it. This only works if you > run it as root however. I've also installed lighttpd and have a php page > running with a link to toggle the LED based on button press. To work > around running as root, I added a setuid(0) to the C program and changed > the ownership of the gcc output binary to root, then made the binary > readable and executable by any user. The result is that the php page can > control the LED, but I'm uncertain of how safe this set up is. > > Is there a better (safer) way for me to be controlling hardware from a > webpage with C? If not, what are my other options? > > Let me know if I can provide you with any additional details. > > Thanks, > Jake >
Hi Jake, Use Nodejs as there is a lot of examples for similar applications as yours and it is event driven. It is easy to use websockets (socketio) as with php it was not so easy. Jan -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
