ronanguilloux / php-gpio

A PHP library to play with the Raspberry PI's GPIO pins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clarification on API

alexciarlillo opened this issue · comments

The API can only be used with sudo permissions correct? The blinker file is separate and used for secure cases, but there is no safe/secure way to use the API for a web based application?

Thanks

Hello Alex,
Thank your for your interest in this little project :

You're right : The API cannot be used without sudo permissions. To safely use the API from a web based app, I suggest to create a dedicated GPIO API client in a single PHP file. Such file must contain the particular hardware-related GPIO operation you want to be run : blink a led, read a sensor value, run a servomotor... As far as this file receives sufficient sudo permissions configuration in etc/sudoers, you'll be able run it using exec() within your web-based application.

I augmented the dedicated paragraph in the README to give some more precisions on that point.

Cheers,
Ronan