My Fusion Brain arrived yesterday so I can give you a head start on #10
Kev's dbus daemon comes with a copy of FB so you just need to download it. I'm sure it will be hosted somewhere at some point but for now you can dig it up from this thread here:
Fusion Brain program for Linux
First you'll need to install some dependencies (again this is on x86 so you may not have all of these in the sheeva repo)
I doubt you have room for this since one of it's dependencies is qt4-doc which takes 51M alone, but you can install qt4-dev-tools in you need/want the qbusviewer. I found it handy but you can do without it.
sudo apt-get install libusb-0.1-4 libusb-dev
Get the tarball on the device and build with
sudo apt-get install qt4-dev-tools #(optional)
Then you need to copy one file to be able to run the daemon
tar xzf fbd.tar.gz
At this point you may need to restart dbus (not sure but it can't hurt)
sudo cp FusionBrain.conf /etc/dbus-1/system.d/
With your Fusion Brain plugged in start fbd as root
sudo /etc/init.d/dbus restart
And you should see something like
If you want to just test from the commandline you can use dbus-send
Fusion Brain V4 found!
Attempting to open interface...
Fusion Brain connected!
Set the first digital output on (you should see the lcd come on)
Turn off the 3rd digital output
dbus-send --system --print-reply --dest="org.openice.fbd" /org/openice/fbd org.openice.fbd.fusionbrain.SetSingleOutput int32:0 boolean:true
And so on. I ran into problems reading analog output and I think the daemon is only partially completed but its a great start!
dbus-send --system --print-reply --dest="org.openice.fbd" /org/openice/fbd org.openice.fbd.fusionbrain.SetSingleOutput int32:2 boolean:false
I also tried a php-dbus package (seems to be anothr one being developed for pecl, but it's not ready yet). It's easy to try.
Download and install:
You'll need to add this to your php configuration and the most maintainable way is to add a file to /etc/php5/apache2/conf.d You need to be root to do this and an easy way is
I also found the default memory settings were too low so you might as well fix that up front. Edit php.ini as root
sudo su -
echo "extension=dbus.so" > /etc/php5/apache2/conf.d/dbus.ini
And change memory_limit = 16M to memory_limit = 32M (although even at 32M i get the occasional memory error with this)
sudo vi /etc/php5/apache2/php.ini
You will need to restart apache for these changes to be picked up
Now you can make a test script - say /var/www/dbus.php and run it as http://PLUGIP/dbus.php
sudo /etc/init.d/apache2 restart
On my system I had to create the file as root and give my non-root user ownership or you can just edit it as root. Here is a little script to turn the digital outputs on/off
# turn digital output 0 on
# turn digital output1 off
and so on.
Oops - looks like I got a little caried away with the code blocks
$do = isset($_GET['do']) ? (int)$_GET['do'] : 0;
$value = isset($_GET['value']) ? (bool)$_GET['value'] : true;
$timeout = 1; # seconds
echo "Setting digital output $do to " . ($value ? "true" : "false" ) . "..</br>";
$dbus = dbus_bus_get(DBUS_BUS_SYSTEM);
if ( $dbus )
$m = new DBusMessage(DBUS_MESSAGE_TYPE_METHOD_CALL);
if ( $m )
$r = $dbus->sendWithReplyAndBlock($m,$timeout);
if ( $r )
$tmp = $r->getArgs();
echo "Got reply:<br/>";