NYCPHP Meetup

NYPHP.org

[nycphp-talk] Beagle Bone Black PHP

Gary Mort garyamort at gmail.com
Sun Sep 1 12:12:10 EDT 2013


I am in the process of writing a library for the BeagleBoneBlack and was 
wondering if anyone here is hacking around with it as well and can test 
it out/give me feedback.

http://beagleboard.org/Products/BeagleBone%20Black

My library requires upgrading to a relatively recent kernel.  I'm using 
Robert Nelson's latest Ubuntu kernel, 3.8.13-bone26, 
http://rcn-ee.net/deb/raring-armhf/v3.8.13-bone26/, though any of his 
3.8 versions should provide the necessary functionality.

The main thing for those using it is I am limiting it to a recent kernel 
so I don't have to chase down 2 different ways of handling the pin 
interface.  Everything will depend on the linux device-tree, and all the 
pins are accessed from PHP by reading and writing to the /sys/class file 
structures created for the pins.

Keep in mind this is very much alpha level coding, as I am working 
through each interface one at a time, and will be restructuring it 
later[for example, right now on my local I have standalone classes 
usr-led and gpio-led with methods for configuring/controlling LED's.  
Eventually those should be refactored to move common methods into an led 
super class with subclasses to override them].

Also at the moment I'm using the much maligned singleton class as it 
makes the most sense to me.  IE I can't imagine a situation where a PHP 
script would have more than one system board since that represents the 
entire computer.  I can imagine a possible remote-control option, but I 
think to support that it would make more sense to re-factor the 
singleton Board class into a parent Board class and a couple of 
children, the BBBSystemBoard singleton and a BBBWebsocketRemoteBoard class.

Anyone interested have any thoughts on what sorts of functions they 
would like?







More information about the talk mailing list