Skip to content

Instantly share code, notes, and snippets.

@elvisimprsntr
Last active January 4, 2019 00:45
Show Gist options
  • Save elvisimprsntr/4409751 to your computer and use it in GitHub Desktop.
Save elvisimprsntr/4409751 to your computer and use it in GitHub Desktop.
SiriProxy running on a Raspberry Pi computer.
# $Header: /root/RCS/siriproxy-raspberrypi.txt,v 1.9 2013/11/09 08:11:00 root Exp $
# $Log: siriproxy-raspberrypi.txt,v $
# Revision 1.9 2013/11/09 08:11:00 root
# updated for latest RVM which installs dependencies and Ruby by default
#
# Revision 1.8 2013/03/22 20:41:20 root
# updated for Ruby 2.0.0 and SiriProxy 0.5.2
#
# Revision 1.7 2012/12/31 04:42:57 root
# shorter URL for newark and typos
#
# Revision 1.6 2012/12/30 05:33:40 root
# typo
#
# Revision 1.5 2012/12/30 04:29:45 root
# removed ruby p286 in rvm commands
#
# Revision 1.4 2012/12/30 01:39:53 root
# added resolv.conf edit steps
#
# Revision 1.3 2012/12/30 00:22:56 root
# typo
#
# Revision 1.2 2012/12/30 00:11:17 root
# typo
#
# Revision 1.1 2012/12/29 22:28:39 root
# Initial revision
#
# DESCRIPTION: SiriProxy running on a Raspberry Pi computer.
# AUTHOR: elvisimprsntr
# CREDITS: This file is derived from plamoni's instructions for getting SiriProxy running on a Ubuntu 11 VM: https://gist.github.com/1428474
# PREREQUISITES: A Raspberry Pi computer or equivalent device, and a router running www.dd-wrt.com open source firmware.
# ASSUMPTIONS: This instruction assumes the reader already has some basic *NIX command line and editor experience and are remotely logging in to the RPi from a *NIX based computer. It is not a BASH script, but the commands and configuration file syntax are formatted to allow one to cut and paste into a terminal window or editor.
# DISCLAIMER: This was written from notes and memory recall.
# Purchase a Raspberry Pi, optionally a pre-configured SDC, and what ever other accessories you need to provide power at: www.newark.com/Raspberry-PI
# Follow the instructions for creating an bootable SDC and booting up for the first time at: http://www.raspberrypi.org/quick-start-guide
# NOTE: Enable SSH server if you intend to run as a headless system.
# Since I am running SiriProxy on a dedicated RPi I am not concerned about installing and running everything as ROOT.
# Set the ROOT password from the user account
sudo passwd
# Log out and log back in as ROOT
# Remove the original user account if you wish
deluser
# Update the system
apt-get update
apt-get dist-upgrade
apt-get autoremove
# Install some basics:
apt-get install samba samba-common-bin ssh vim rcs unzip -y
# If you want to add or create SiriPorxy plugins that push custom pictures to Siri, then install APACHE
# NOTE: The defaults are fine. Your custom images need to reside in /var/www/
apt-get install apache2 -y
# If you use your router to reserve a static IP, add the following line to /etc/dhcp/dhclient.conf file.
supersede domain-name-servers 8.8.8.8, 8.8.4.4;
# Reboot the RPi
reboot
# If you want to define a static IP on the RPi, find out what address your router assigned to your RPi.
ifconfig
# Edit the network settings to use a STATIC IP address.
# NOTE: To make it easy use the same settings your router assigned to your RPi.
vim /etc/network/interfaces
# Comment out the DHCP entry. Make the STATIC entry look something like this:
# NOTE: Tweak the address for your STATIC IP address.
auto eth0
iface eth0 inet static
address 192.168.69.97
netmask 255.255.255.0
broadcast 192.168.69.255
network 192.168.69.0
gateway 192.168.69.1
dns-nameservers 8.8.8.8 8.8.4.4
# Reboot the RPi
reboot
# Enable SAMBA support. Tweak the Share Definition section in the /etc/samba/smb.conf file.
# TIP: If you enable RW access you will be able to create folders and write to the RPi from any client. Also make sure to disable GUEST access.
vim /etc/samba/smb.conf
# Add ROOT as a remote user.
# TIP: Use the same password as the root login to eliminate the need to remember another password.
smbpasswd –a root
# Restart SAMBA daemon:
sh /etc/init.d/samba stop
sh /etc/init.d/samba start
# You should now be able to access the RPi file system from any client.
# In lieu of running DNSMASQ or RubyDNS on the RPi, I opted to use my router to perform a transparent DNS redirect.
# On a router running www.dd-wrt.com open source firmware, configure a DNS redirect from Apple Siri servers to the STATIC IP address of the RPi.
# NOTE: Tweak the address for your RPi STATIC IP address.
# Services -> Additional DNSMasq Options
# iOS production Siri server
address=/guzzoni.apple.com/192.168.69.97
# Here are the prerequisite dependancies that need to be installed.
# RVM installs dependencies and latest Ruby by default.
# Install RVM - This will take awhile.
curl -L https://get.rvm.io | bash -s stable --ruby
# Set RVM path
[[ -s "/etc/profile.d/rvm.sh" ]] && . "/etc/profile.d/rvm.sh"
# Set the RVM path to be set up every time I log in
echo '[[ -s "/etc/profile.d/rvm.sh" ]] && . "/etc/profile.d/rvm.sh" # Load RVM function' >> ~/.bash_profile
# Use RUBY 2.0.0 as the default (and current) version of ruby
rvm use 2.0.0 --default
# Install SiriProxy gem
gem install siriproxy
# Make the .siriproxy directory in my home directory
mkdir ~/.siriproxy
# Generate the certificates
siriproxy gencerts
# Install the certificate on the iPhone.
# On your *NIX machine use SCP to copy the certificate from the RPi.
# Open a terminal window and use the following commands.
# NOTE: Tweak the address for your RPi STATIC IP address.
cd ~/Downloads
scp [email protected]:/root/.siriproxy/ca.pem .
# Attach this file to an email account you have access to on your iPhone.
# On the iPhone simply tap the file and follow the prompts to install.
# Bundle
siriproxy bundle
# Start the server
siriproxy server
@BA-Baracus
Copy link

Hi.
I downloaded the SD image and managed to get SP up and running but have problems to bundle plugins.
I get NoMethodError with ostruct.rb :
/usr/local/rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/ostruct.rb:90:in initialize': undefined methodeach_pair' for #Array:0x1e090f0 (NoMethodError)
from /usr/local/rvm/gems/ruby-2.0.0-p195/gems/siriproxy-0.5.4/lib/siriproxy/command_line.rb:167:in new' from /usr/local/rvm/gems/ruby-2.0.0-p195/gems/siriproxy-0.5.4/lib/siriproxy/command_line.rb:167:inparse_options'
...

I have no idea where to fix this.
HELP!

@elvisimprsntr
Copy link
Author

@BA-Baracus That's not a problem with siriproxy or the SD card image. It's likely a problem with your plugins.

@C4Wiz
Copy link

C4Wiz commented Jul 29, 2013

how do you autologin and startx as root?

@shane11
Copy link

shane11 commented Dec 28, 2014

I've followed all these instructions - siriproxy is running, but can't get it to respond to my phone. Any ideas?

@elljun
Copy link

elljun commented Jan 27, 2015

hi.. @elvisimprsntr
please help make make a code on a Lights that i can control.. with the siri proxy running on my raspberry pi. i have a project that would set a scheduled or timed lighting system.. for example i would say to Siri "Set room light from 6pm to 6am."

@jamieburchell
Copy link

Just for anyone else coming here and spending hours going through it all - SiriProxy is dead as of iOS 7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment