Make Siri Do What You Want With SiriProxy On Mac OS X And iPad 3

siri   Make Siri Do What You Want With SiriProxy On Mac OS X And iPad 3I’ve been wanting to try out SiriProxy¬†for some¬†Arduino home automation projects, but I refuse to buy a new phone when my iPhone 4 is still working just fine (yes, I stopped using my HTC One X; 6 months with Android is more than enough for me). But then I realized; I have Siri already, on my iPad 3. Surely I could use that? Indeed you can. So in this tutorial I’ll walk you through getting SiriProxy working with your iPad 3 and Mac OS X – much of this will be relevant to Mountain Lion only though.

I also warn you in advance, this is pretty difficult stuff and almost all done on the command line, and while I’ve tried to break it down step by step in the exact manner that worked for me, you may need to Google some errors yourself as and when they arise.

Requirements

  • iPad or iPhone with Siri capabilities. I won’t be showing how to hack Siri onto older devices using fake servers, so don’t ask.
  • Mac OS X. You can install SiriProxy on Linux too but I won’t be trying that today.
  • iOS6.1

Preparing

Download the pkg installer for your OS X version from MacPorts.org. MacPorts allows us to install a variety of UNIX utilities that have been ported to Mac. You also need to have XCode installed, which can be downloaded for free from the Mac App Store, but it’s a hefty download so get started now.

macports   Make Siri Do What You Want With SiriProxy On Mac OS X And iPad 3

MacPorts adds some new path entries to your system, but doesn’t update correctly. To avoid port command not found errors later, run

source .profile

At this point, you’ll need to install XCode too, from the app store. When installed run this command to tell your system where the compiler is:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

Next, install DNSMasq; a simple DNS forwarder that let’s us intercept requests to a certain IP.

sudo port install dnsmasq

Install Ruby and RVM

Download and install RVM package manager with this command:

bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

Then run this to correctly add it to your system:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

Install Ruby using the following command; this will use the latest version 1.9.3 at the time of writing, and I suggest you do the same or the rest of this guide probably won’t work.

rvm install 1.9.3

ruby install success   Make Siri Do What You Want With SiriProxy On Mac OS X And iPad 3

If you get a bunch of random red text with an error, run this instead:

rvm install 1.9.3 ‚Äďwith-gcc=clang

then do

rvm use 1.9.3 default

to set the default ruby environment version. Congratulations, you now have Ruby on your system!

Download SiriProxy

Begin by using Git to clone the SiriProxy project to your machine.

git clone git://github.com/plamoni/SiriProxy.git
cd /SiriProxy

When you first do this, you may get a security warning about script files detected. Go ahead and trust this if you’ve download from the github source.

cd error   Make Siri Do What You Want With SiriProxy On Mac OS X And iPad 3

Next we’re going to copy across the config file.

mkdir ~/.siriproxy
cp ./config.example.yml ~/.siriproxy/config.yml

Open up that config file using your favorite text editor, and change the IP at the top of the file from 0.0.0.0 to your Mac’s local IP. Moving on:

rvmsudo gem install rake bundler
rvmsudo rake install

This should install SiriProxy for you, but we’ll need to repeat this later on to deal with errors. For now, let’s continue and make some certificates.

We’ll need OpenSSL installed first.

sudo port install openssl

The first time I ran this, it failed with numerous zlib errors; to fix this I needed to run

sudo port -f activate zlib

Next, we’ll generate certificates:

siriproxy gencerts

If all goes well, you should see a message similar to this.

cert file   Make Siri Do What You Want With SiriProxy On Mac OS X And iPad 3

Use the Finder->Go to Folder menu option to enter the path listed in the output; you should find a ca.pem file there. Email that to yourself, and then open it on your Siri capable device. This will jump over to settings, and give you the option to install it as a new certificate. Not, yours will say it’s untrusted (in red) the first time around – I took this screenshot after installing, so it says trusted.

cert install   Make Siri Do What You Want With SiriProxy On Mac OS X And iPad 3

Back on your Mac, run the following command to update some random files that are needed.

bundle install

Setup DNS forwarding

The final step is to make your Mac into a DNS server that can intercept calls to Apple’s servers and route them via SiriProxy instead. Again, using Finder->Go To Folder, open up /opt/local/etc, and edit dnsmsq.conf. Add the following line, replacing 192.168.0.6 with the local IP address of your Mac.

address=/guzzoni.apple.com/192.168.0.6

guzzoni dnsmasq   Make Siri Do What You Want With SiriProxy On Mac OS X And iPad 3

To activate DNSMasq service, run the following. You’ll need to do this upon every restart (along with launching SiriProxy as we describe later).

sudo /opt/local/sbin/dnsmasq

On your iPad, or iPhone, open your network settings and change the DNS server of the WiFi to your Mac IP address. Yes, SiriProxy will only work over your home WiFi, but you can theoretically VPN into your home router if you wish to use it while out and about. We won’t cover that today.

I also needed to set a new port forwarding rule on my router; port 53 should be forwarded to your Mac IP. (This is the port used by DNS)

Start SiriProxy

The final step is to start the SiriProxy server and test. Do this using:

export rvmsudo_secure_path=1

If at this point, you are getting a screen full of errors like “invalid symbol” as soon you press the home button, continue on with this bit. You’re getting errors due to an older version of CFPropertyList included with the SiriProxy package. Hopefully this will be fixed soon, so you may not need this, but just in case‚Ķ

Download the newest version of CFPropertyList like this:

sudo gem install CFPropertyList -v 2.1.2

Now, use Finder to Go To Folder ~/.rvm/gems/ . Navigate inside the lastest Ruby – in my case ruby-1.9.3-p385/ and copy the gems/CFPropertyList-2.1.2/lib folder over to ruby-1.9.3-p385@SiriProxy/gems/CFPropertyList 2.2.0 . Yes, authenticate and overwrite the older version lib with the lib from the newer version; a horrible hack, but the only way I could get it working. The final fix needed is to manually edit the gemspec file. Do this by changing to the SiriProxy directory, and opening up siriproxy.gemspec. Do this from the command line with VI or Nano using:

sudo vi siriproxy.gemspec

Or just use a text editor. Replace the line which is about 4 lines from bottom containing “CFPropertyList” with the following:

s.add_runtime_dependency('CFPropertyList', '2.1.2')

Now run

rvmsudo siriproxy update

And all should be good with the world. Start the server again and retest.

rvmsudo siriproxy server

 

server working   Make Siri Do What You Want With SiriProxy On Mac OS X And iPad 3

Test it by asking Siri to “test siri proxy” and you should get a response that it’s up and running. View more test commands here.

ipad success   Make Siri Do What You Want With SiriProxy On Mac OS X And iPad 3

Next time, we’ll look at some SiriProxy plugins you can run and actually start making use of this thing.

To be honest, that whole process was more immensely complicated than I hoped, but I hope this guide turns out useful for some of you, since it literally took me all day to get right. Do you have any recommendations for SiriProxy plugins that I should check out? Did this process work for you? Let us know in the comments, and I’ll try to help you out, but the project GitHub page is full of far more knowledgeable folks.

The comments were closed because the article is more than 180 days old.

If you have any questions related to what's mentioned in the article or need help with any computer issue, ask it on MakeUseOf Answers—We and our community will be more than happy to help.

11 Comments -

Rehab Engineering

Wow. That is a stunning bunch of hoops to jump through. Myself, I would have just bought a Windows Pro tablet and installed Dragon Naturally speaking. At least it has access to any sort of applications and scripting, not just “native’ ones, and doesn’t need internet connectivity. I do appreciate the ipad based effort and smarts used to execute this….but I’d hope consumers would really shop for what they need. Often it seems like people buy an ipad then someone very “techy” cobbles things together to try and make it useful, whereas if they had just bought a suitable “other” device, they could have had a better solution with less hassle.

Muo TechGuy

If your main aim is to get customized speech recognition, then I would agree – there are better devices than an iPad for that, at least until Apple opens up the SDK for developers to integrate with Siri.

But there is no comparison otherwise between an iPad and a windows/android tablet, so I’m not sure that’s a valid argument. Saying you need some cobbled together techy solution to make an iPad “useful” seems to be missing the point. People will always push the boundaries of what is possible on any device, and certainly that’s more difficult on Apple products, but that doesn’t negate the fact that the iPad is the best tablet out there for general use, bar none.

Hank

Thanks a lot–it works for me! I’ve been searching for a step-by-step setup for Mac for a very long time. You should try FindMyIPhone plugin.

I’d like to jump the gun a bit and understand how to get this setup working over the Internet via 3G. The best I’ve found is the following steps:

For iPhone without Jailbreak
I must create a network VPN solution with dyndns.org or other personal domain

For iPhone with Jailbreak
1) Edit the etc/hosts and add
example.dyndns.org guzzoni.apple.com
2) Edit the com.apple.assistant the file and add
Hostname
http://example.dyndns.org

3) Edit the ~/.siriproxy/config.yml with the updated IP
4) Re-generate the certification and send it to the iPhone again

I haven’t tried it yet and would like your input before I mess things up.

Ihf

Will Siriproxy work remotely if the server has a fixed IP address or is there something inherent in how this is done that precludes remote use except via the process described here?

roger Rvel

Im getting Command Not Found when I try to do siriproxy gencerts . Can Anyone help me ?

MakeUseOf TechGuy

You havent installed SiriProxy correctly. Go back tot he start, follow the steps again, and see where you’re getting the errors – probably when you get to the step that involves “rake”.

Shootdark

Hello,
I’m getting a error when I try “rvmsudo rake install”.

I have trial to install 2.0.0 Ruby but, not work.

He say : “Couldn’t install gem, run ‘gem install /SiriProxy/pkg/siriproxy-0.5.4.gem”.

So I use this command, installing, and all is done.
Now I use “siriproxy gencerts” and not work.

I have seek for a lot of solutions, but not found at this time. Do you have a idea of this problem ? Thank you !

MakeUseOf TechGuy

Does it give any more error details other than “couldnt install”? That’s a bit vague I’m afraid.

Maxence

This is all I have :
new-host:SiriProxy Maxence$ rvmsudo rake install
Warning: can not check `/etc/sudoers` for `secure_path`, falling back to call via `/usr/bin/env`, this breaks rules from `/etc/sudoers`. export rvmsudo_secure_path=1 to avoid the warning.[Info - Configuration] Loading plugins — If any fail to load, run `siriproxy bundle` (not `bundle install`) to resolve.
siriproxy 0.5.4 built to pkg/siriproxy-0.5.4.gem.
rake aborted!
Couldn’t install gem, run `gem install /SiriProxy/pkg/siriproxy-0.5.4.gem’ for more detailed output
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/gem_helper.rb:70:in `install_gem’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/bundler-1.3.5/lib/bundler/gem_helper.rb:45:in `block in install’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.0.4/lib/rake/task.rb:246:in `call’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.0.4/lib/rake/task.rb:241:in `each’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.0.4/lib/rake/application.rb:101:in `each’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.0.4/lib/rake/application.rb:70:in `run’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `eval’
/Users/Maxence/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `’
Tasks: TOP => install
(See full trace by running task with –trace)

MakeUseOf TechGuy

Sounds like it should be installed fine using that command. What happens when you try siriproxy gencerts? What error does it give?

To be honest, it’s a long time since I wrote this, so you’re better off posting specific errors in the github issues page.

Jesse Wallace

When i did rvm install 1.9.3 I got this:

Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.6/i386/ruby-1.9.3-p429.
Continuing with compilation. Please read ‘rvm help mount’ to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Warning: No index(es) found! Have you synced your source indexes?
Password:
Warning: No index(es) found! Have you synced your source indexes?
—> Updating the ports tree
DEBUG: Synchronizing ports tree(s)
Synchronizing local ports tree from rsync://rsync.macports.org/release/tarballs/ports.tar
DEBUG: /usr/bin/rsync -rtzv –delete-after rsync://rsync.macports.org/release/tarballs/ports.tar/ /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
receiving file list … rsync: change_dir “tarballs/ports.tar” (in release) failed: Not a directory (20)
done

sent 4 bytes received 9 bytes 26.00 bytes/sec
total size is 0 speedup is 0.00
rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-40/rsync/main.c(1400) [receiver=2.6.9]
Error: Synchronization of the local ports tree failed doing rsync
DEBUG: Couldn’t sync the ports tree: Synchronization of 1 source(s) failed
while executing
“macports::selfupdate [array get global_options]”
Error: /opt/local/bin/port: port selfupdate failed: Couldn’t sync the ports tree: Synchronization of 1 source(s) failed