Monday, January 14, 2013

Projects I'm working on...

Hey everyone, sorry I haven't posted much at all, but finals this week have been a pain. However, I thought I'd take a quick break to explain what I've been working on for the past few weeks.

SiriProxy on the RaspberryPi

After reading on article on one of my favorite blog sites about a chap in Europe who got his garage door to open by speaking a command through siri, I knew I wanted to try it out. (Original article here: http://www.idownloadblog.com/2012/12/17/open-garage-door-with-siri/)

RaspberryPi:
The RaspberryPi is essentially a miniature computer designed by a teacher with the goal "to see cheap, accessible, programmable computers everywhere", and to allow "the board [to be] desirable to kids who wouldn't initially be interested in a purely programming-oriented device." And at only a mere $35, with half a gig of RAM, a (somewhat) adequate GPU and CPU, and a GUI similar to a simplified version of windows XP, this thing was a steal.

So I bought two.


Now of course there are other small computers out there, such as the Arduino, though the RaspberryPi (in my opinion) is an easier board to get started with.

SiriProxy:
SiriProxy is a Linux-based Ruby script developed by plamoni to allow iPhone users using Siri to connect to Apple's server's through a proxy, effectively giving them the power to execute ruby code upon the event of specified dialogue.

Basically, it send the voice packets you speak to Apple's (Nuance's?) servers and returns a string matching what you just said. The string is thing passed into SiriProxy where it will match it to a pre-determined function, and if it finds a match, it will run the code inside the function. If it doesn't find a match, then it just says what Apple's Server's would normally say to the user (Ex. User: "Open the Garage door." Siri: "You don't have an app named Garage Door! :D).

Installing SiriProxy on the RaspberryPi:
This. Took. A while.
Not only did it take over two hours to install completely (Installing RVM takes an hour and a half on the pi), but I (thought I) messed up half a dozen times. Once I had finished the install, some bug would arise where either the phone would not connect to the proxy, or one of the plugins would fail, or apt-get wasn't updated and updating it seemed to make something crash.

I ended up posting on Stack Overflow for an answer (See the Conversation here). Throughout it one of the responders posted his working SiriProxy disk image(the RPi runs off an SD Card) and testing the device was now much quicker (A quick disk wipe and install versus another 2 hour install from scratch). I eventually found that my DNSMASQ settings were off, and experimenting finally resolved in success.

The iPhone is able to connect and the proxy does respond with the correct responses(Ex. "Test Siri Proxy" "SiriProxy is up and running!"). However, upon editing the default plugin and rebundling the software, my changes don't seem to save.

I'll start working on it again next week. This week is saved for this another project.


No comments:

Post a Comment