ronanguilloux / php-gpio Goto Github PK
View Code? Open in Web Editor NEWThis project forked from ben-duffin/php-gpio
A PHP library to play with the Raspberry PI's GPIO pins
License: MIT License
This project forked from ben-duffin/php-gpio
A PHP library to play with the Raspberry PI's GPIO pins
License: MIT License
For my Raspberry Pi 3 it doesn't detect the right version number in Pi->getVersion(). It returns 0 instead of 4. Therefore I can't use certain pins without it complaining. I would have made a pull request if I could but I don't know how to convert the revision numbers (http://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/)
(received from David P., I write it back here in case it serves to others users )
I have tried to install the php gpio library and I seem to be running into a problem. Please forgive me, I am a beginner. I'm sure I'm missing something very fundamental :)
Following instructions at https://github.com/ronanguilloux/php-gpio
When I try to execute
php composer.phar create-project --stability='dev' ronanguilloux/php-gpio intoYourPath
I get an error
[RuntimeException]
Failed to clone http://github.com/ronanguilloux/php-gpio.git, git was not found, check that it
is installed and in your PATH env.
sh: 1: git: not found
I also get errors in my PHP when I try to
& this :
The return type of return false; (false) is incompatible with the return type declared by the interface PhpGpio\Sensors\SensorInterface::write of type PhpGpio\Sensors\SensorInterface.
Hi there, i'm using your package with Laravel 5.5 and Nginx+Php-fpm
I had a problem:
file_put_contents(/sys/class/gpio/gpio23/direction): failed to open stream: Permission denied
Any idea?
This line is not working with B+ version (revision 0010).
https://github.com/ronanguilloux/php-gpio/blob/master/src/PhpGpio/Pi.php#L12
Looking in revision tables, maybe just with a return hexdec($matches[1]) gone work.
Hi,
I have been dealing with the Exec command, and the only way that worked for me was exec('sudo php blinker 17 20000');
It needed the php command, is this a permissions issue? It works fine localy, but through the network it doesn't.
Hi There.
I am sorry to bring this up, but could the permissions settings also be addressed here more, because this does not work without them, using Raspberry Pi2 and Jessie 2017 image.
When user starts this from the pure clean jessie image and installs apache2 with php5 pi user loggind in, , GPIO permissions are not right and this does not work. Sudo php index.php does the trick.
I would ask for clean commands on how to make this work.
After Apache2 & PHP installations, I use "sudo chown pi.pi /var/www/html -R" so that I can SFTP stuff in.
Thank you for your considerations.
I'm putting here an email from Jack **** about Raspebrry Pi A+ & version 2 support:
Dear Ronan Guilloux
At First Thanks For make the Project php-gpio and share with us.
I have a Question may i know is this Project Support the Raspberry-Pi A+ or Raspberry-Pi 2 ?
I have Test this in My Raspberry Pi A+ with a simple LED blink but fail.
So just want to make sure for this.
Thanks
My (typo fixed) answer, and the things to do are:
Hello Jack ****!
AFAIK, A+ & 2 versions are not supported yet, but it wouldn't be a big deal to add such support, since you just have to find the right list of GPIO pins to add in the Gpio class constructor.
These GPIO pins lists for both A+ & Raspi 2 may probably be found in the Raspberry Pi public specifications. Other (unofficial) specs are already online, but a deeper check on that, from you or someone else would be nice.
So, do not hesitate to contribute & to enhance our GPIO pins list, in order to support these new Raspi models !
Im trying to convert this python https://gist.github.com/gsdevme/3ac674eb105b13d0139d
I have repo setup here https://github.com/gsdevme/energenie-pi-remote-control however running it on the Pi I get pin number 16 invalid
https://github.com/gsdevme/energenie-pi-remote-control/blob/master/test.php
# set the pins numbering mode
GPIO.setmode(GPIO.BOARD)
The python has this call unsure if its a problem, any ideas exactly?
Hey,
Can we update the URL from https://github.com/pickley/PHP-GPIO to https://github.com/aaronpearce/PHP-GPIO.
Just changed my Github name so the link will 404 :)
Could it be possible to support PWM (Pulse Width Modulation)?
in a Raspi B+ case, getHackablePins() returns an empty array.
I seem to be having a problem controlling the GPIO pins using this script.
It seems to stem from the fact that the directories in
/sys/class/gpio
and their symlinked companion
/sys/devices/virtual/gpio
keep reverting back to being root:root.
Additionally, if I set the ownership to pi:pi and add read/write to group permissions the directory for the pin I'm accessing empties itself.
I feel like I'm missing something really obvious. At the moment my Apache server is running as pi:pi. What permissions and ownership do I need to set to make this work?
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
Hi
I am trying to simulate PWM by writing this code to run a servomotor
#!/usr/bin/env php
<?php
require 'vendor/autoload.php';
use PhpGpio\Gpio;
$gpio = new GPIO();
$gpio->output(18,0);
while(true)
{
$gpio->output(18,1);
usleep(1500);
$gpio->output(18,0);
usleep(2000000);
}
but the servo is not working, a similar code is written in python on this video and it is working: http://www.youtube.com/watch?v=ddlDgUymbxc&feature=youtu.be
any ideas?
Add the camera driver to master repo.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.