There are probably other ways to do the same thing, such as running a web server on the Pi and have that access the GPIO's etc but I basically cobbled this together for my own needs - and it works fine.
I am running the Pi as "root" for this whole setup as it just makes things easier for me and I'm using the "wheezy" distro.
Follwing the instructions here: http://www.idownloadblog.com/2011/12/09 ... ial-video/ should get SiriProxy up and running, if you do follow these instructions then swap commands 11, 12 and 13 to 12, 13, 11. Command 7 by the way will take about 90 minutes to compile on the pi!
Then install wiringPi from https://projects.drogon.net/raspberry-p ... d-install/
Once these are installed its just a case of modifying the example ruby script included with siriproxy.
Edit this file: /root/SiriProxy/plugins/siriproxy-example/lib/siriproxy-example.rb
Look for the lines:
Code: Select all
listen_for /test siri proxy/i do
say "Siriproxy is up and running!" #say something to the user!
request_completed #always complete your request! Otherwise the phone will "spin" at the user!
end
Code: Select all
listen_for /open the garage door/i do
say "Opening the garage door.."
request_completed
system("gpio mode 1 out")
system("gpio write 1 1")
system("sleep 0.5")
system("gpio write 1 0")
end
listen_for /close the garage door/i do
say "Closing the garage door.."
request_completed
system("gpio mode 1 out")
system("gpio write 1 1")
system("sleep 0.5")
system("gpio write 1 0")
end
You can have siri to call any command you can type in a terminal window, such as a passwordless SSH login to a remote pc to have it shut down or rebooted.
Code: Select all
listen_for /turn off my laptop/i do
response = ask "Are you sure you want me to shut down your laptop?"
if(response =~ /yes/i)
say "OK, I'll shut it down now.."
system("ssh root@192.168.1.74 shutdown -h now")
else
say "OK, I wont!"
end
request_completed
end
Anyway, here is a video of my setup.
http://youtu.be/NUJ5z76Xv5o