Setting Up SiriProxy on RPi

Post to Twitter Post to Delicious Post to Facebook

This entry talks through the steps required to create a SiriProxy on your RPi that will enable you to trap custom Siri commands made on an iPhone and then perform a custom action using the RPi, which I’ll cover in a later entry.

First of all credits, these steps are taken from a few sources so here they are:

This entry assumes that your RPi is setup and instructions are based upon a Occidentalis Distro on the RPi as per the previous RPi posts:

Installing SiriProxy

These steps are a combintaion of the sites credited above, if you require background information please look at the sites, this is a quick set-up post and won;t explain why we do anyof the steps.

  1. you first need to switch to root to ensure this works, I forgot this step and failed the first time. To do this run the following command:
    sudo su -

    Note that from a security perspective this isn’t great practice but for speed we’ll do it. We’ll look at making it more secure in a later post.

  2. download the relevant code
    sudo apt-get install dnsmasq ruby build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

    Select’y’ when prompted

  3. Setup the proxy listener
    sudo nano /etc/dnsmasq.conf

    Find the following line on approximately line 62: #address=/double-click.net/127.0.0.1
    Directly beneath that line type:

    address=/guzzoni.apple.com/(your_machine's_ip_address)

    Replace (your_machine’s_ip_address) with the IP address of your machine as shown in the video.
    Entre Ctrl+x, press y to accept and exit the editor

  4. sudo /etc/init.d/dnsmasq restart
  5. bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
  6. [[ -s "$HOME/.rvm/scripts/rvm"; ]] && . "$HOME/.rvm/scripts/rvm"
  7. echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
  8. rvm install 1.9.3

    This command takes a while so be patient

  9. rvm use 1.9.3 --default
  10. git clone git://github.com/plamoni/SiriProxy.git
  11. cd SiriProxy

    Select y to continue

  12. mkdir ~/.siriproxy
  13. cp ./config.example.yml ~/.siriproxy/config.yml
  14. rake install
  15. Generate the certs for your phone
    siriproxy gencerts
  16. siriproxy bundle
  17. We’ll now copy the certs to your phone, you can either email them to yourself and open them on your phone or alternatively use DropBox as I did
    1. Copy the certificates to the pi users desktop so theyare easily accessible
      cp ~/.siriproxy/ca.pem /home/pi/desktop/ca.pem
    2. Open DropBox in a browser and log in
    3. Upload the ca.pem file fron the desktop
    4. Once synced open the ca.pem file on your phone. If you have the DropBox app it may not work, if this is the case select the option to email the file, then copy the url in the email body and paste into Safari, download the file and then follow the instructions.
    5. The certificate is now installed on your iPhone
  18. Now startup the SiriProxy on your RPi
    rvmsudo siriproxy server

    The terminal should say SiriProxy up and running
    Do not close the terminal window as this is the proxy.
    If you recieve a warning regarding Secure_Path then do as it says and run the following command when SiriProxy is stopped

    export rvmsudo_secure_path=1
  19. On your iPhone we need to tell it to route Siri via your proxy.
    Within settingswifi select the blue arrow to teh right of your wireless network
    Enter the RPi IPAddress into the DNS section (if you don’t know the IP Address open a new LX Terminal on the RPi and enter
    ifconfig
  20. We now need to test SiriProxy
  21. Open Siri on your phone (hold down the home key) then say “Test Siri Proxy”. You should see the commands in the terminal window and should recieve a response stating “Siri Proxy is up and running!”
  22. That’s it!

When I set up SiriProxy using teh above I recieved an error when I tried to use Siri stating there was an InvalidByteSequence look out for this and if it occurs follow the below steps to correct it

  1. Ensure you are in the SiriProxy directory
  2. sudo vi siriproxy.gemspec
  3. Replace the line approx 4 from bottom which contains “CFPropertyList” with the below:
    s.add_runtime_dependency('CFPropertyList', '2.1.2')
  4. siriproxy update
  5. rake install
  6. This fix is from the github issues library
  7. Start the SiriProxy
    rvmsudo siriproxy server
  8. Open Siri on your phone (hold down the home key) then say “Test Siri Proxy”. You should see the commands in the terminal window and should recieve a response stating “Siri Proxy is up and running!”
  9. That’s it!

If you experience any other issues leave a comment or checkout the issues section on Git Hub.

The next post shows how to create custom Siri commands

Now Siri is working the next post will be on using Siri to control devices via RPi.

I am also looking at options to autostartrestart siriproxy, at the moment you have to start it manually.

Post to Twitter Post to Delicious Post to Facebook

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>