necc
Posts: 25
Joined: Thu Aug 30, 2012 10:55 pm

Re: Siri Proxy

Wed Jan 16, 2013 5:01 pm

(cd /path/to/your/script && yourscript)

edrose
Posts: 13
Joined: Fri Dec 28, 2012 3:35 pm

Re: Siri Proxy

Thu Jan 17, 2013 3:35 pm

Great! I now have my raspberry Pi running Siri Proxy on boot, and restarting it whenever it crashes. Using the disk image shown in the posts, I got it running initially. Then I put this script https://gist.github.com/1566193 in my /root/SiriProxy directory and called it service.sh. I then edited the /etc/rc.local script and added these lines to it:

Code: Select all

#Start Siri Proxy
echo "Starting Siri Proxy..."
su - root -c "(cd /root/SiriProxy && ./service.sh keepalive)" &
That worked to start the proxy on boot and loads all plugins :D

I run the raspbery pi headless, so i'm not sure whether you reach a login screen using this, but i'm sure adding > /dev/null to the end of the command would fix this.

elvisimprsntr
Posts: 131
Joined: Sat Dec 29, 2012 11:36 pm
Contact: Website

Re: Siri Proxy

Sat Jan 19, 2013 10:26 am

edrose wrote:Your .img file works great! However, how can i get it to start automatically. I've edited the siriproxy-example plugin, but when it's started by an init.d script or the rc.local script it doesn't load any changes to my plugins. It needs to be run from the SiriProxy directory. Anyone know how this can be done?
I haven't had any luck getting SiriProxy to reliably start upon boot, which is why I didn't include it in the image.

When you make changes to the example or add new plugins you need to do the following

Code: Select all

1. cd ~/SiriProxy
2. siriproxy bundle
3. bundle install
4. siriproxy server
http://www.youtube.com/user/TheElvisImprsntr

johnsonld123
Posts: 14
Joined: Thu Feb 23, 2012 5:03 am

Re: Siri Proxy

Sun Mar 10, 2013 10:05 pm

Can anyone point or explain step by step of how to install the plugins?(Directtv plugin https://github.com/JoshuaCarroll/SiriProxy-DirectRemote) I've followed the twitter example but all the other plugins I've found reference the gem file. How and where do I install the gem file? Thanks in advance.
RPi-Debian-SiriProxy-2013-02-16

elvisimprsntr
Posts: 131
Joined: Sat Dec 29, 2012 11:36 pm
Contact: Website

Re: Siri Proxy

Thu Mar 14, 2013 10:17 pm

Depends on which version of SiriProxy you are running, if you have siriproxy installed as root or as a user, or you have siriproxy installed as a gem or you cloned the siriproxy repo. But, basically you need to copy all the files for the plugin in question to the plugins directory siriproxy is running out of.
http://www.youtube.com/user/TheElvisImprsntr

johnsonld123
Posts: 14
Joined: Thu Feb 23, 2012 5:03 am

Re: Siri Proxy

Thu Mar 14, 2013 11:20 pm

Ok...currently running your last RPi-Debian-SiriProxy-2013-02-16.img. This is where I'm at. I download the zip and extract it in my plugins folder...and lost. I am not sure if I should amend the config.yml file (especially the plugins without the .yml file). I tried with Chuck Norris by adding the zip and adding the path in the config but still receive errors.Sure it's me just need to figure out where I'm going wrong. Is it possible to post your config file to make sure I have everything set correctly? I think this will also help other members (newbs) that are running into the same issue.

Thanks again ;)

Crap...just seen you updated the image and plugins instructions ( will try and report back) Keep up the good work.
RPi-Debian-SiriProxy-2013-02-16

lsamamig
Posts: 12
Joined: Wed Mar 20, 2013 9:47 am

Re: Siri Proxy

Wed Mar 20, 2013 10:05 am

elvisimprsntr wrote:To make it easier for people to get started i posted a SD card image on SF

http://sourceforge.net/projects/siriproxyrpi/

Elvis
hi there..

i´ve spent the whole weekend but no luck!! it doesnt boot up and thats exactly what i need!! help me..
the cables, sd (8gb and its on the known list), etc.. work perfectly!! because with OpenELEC, xmbc everything is fine!! i followed all the instructions but nothing goes on.. only the red light comes up!! obv its not a valid image :( i downloaded, unziped, opened the "win32diskimager-v0.7-binary" admin mode, succesfully wrote the image file on the sd card and then properly pluged it into the raspi but nothing!!! what am i doing wrong??

as i can see im not the only one having problems with this.. apparently its coz of the sd card, memory size, class and so on... i have a transcend 8gb class 6!! which one should i get to make it work? which one do you have guys?? thanks

elvisimprsntr
Posts: 131
Joined: Sat Dec 29, 2012 11:36 pm
Contact: Website

Re: Siri Proxy

Fri Mar 22, 2013 11:29 am

http://www.youtube.com/user/TheElvisImprsntr

lsamamig
Posts: 12
Joined: Wed Mar 20, 2013 9:47 am

Re: Siri Proxy

Sat Mar 23, 2013 11:27 am

thanks for the quick reply!!!
i have one of the new RPis with Hynix RAM chip so im already donwloading your new file based on raspbian and ill tell you asap if it works or not!!! thanks anyway.. :D
ps: already 19% downloaded cant wait!!!!

IT WORKS... you are the best!!!! now i just need to learn how to make it work.. but first step doneee :) it booted perfectly and still running..

DVM
Posts: 9
Joined: Tue Jul 09, 2013 9:09 am

Re: Siri Proxy

Tue Jul 09, 2013 9:22 am

Hi guys,i hope all is well,i am a new member,i would some help how would you get siri to turn an output high on a I2C device? :? thanks in advance

edrose
Posts: 13
Joined: Fri Dec 28, 2012 3:35 pm

Re: Siri Proxy

Tue Jul 09, 2013 2:33 pm

DVM wrote:Hi guys,i hope all is well,i am a new member,i would some help how would you get siri to turn an output high on a I2C device? :? thanks in advance
I don't know much about ruby, but this looks promising.
http://rubygems.org/gems/i2c
It looks like a simple case of installing a gem, and then sending the commands to the device using commands. How much programming experience and siriproxy knowledge do you have? Tell us how far you have got so far and we can help you with the next step.

DVM
Posts: 9
Joined: Tue Jul 09, 2013 9:09 am

Re: Siri Proxy

Tue Jul 09, 2013 6:18 pm

edrose wrote:
DVM wrote:Hi guys,i hope all is well,i am a new member,i would some help how would you get siri to turn an output high on a I2C device? :? thanks in advance
I don't know much about ruby, but this looks promising.
http://rubygems.org/gems/i2c
It looks like a simple case of installing a gem, and then sending the commands to the device using commands. How much programming experience and siriproxy knowledge do you have? Tell us how far you have got so far and we can help you with the next step.

Thanks so much,Ok,not much experience ,have a better understanding with vba ,arduino.i downloaded an image ok raspbian and siri,I just need to make a static IP address and install the certificates on my iPhone. Ok from here on I need help I'm guessing I need to install wiringpi inorder access the gpio's?but since there is so much ok things I would like to control hence my question about siri turning on an output of i2c device

edrose
Posts: 13
Joined: Fri Dec 28, 2012 3:35 pm

Re: Siri Proxy

Wed Jul 10, 2013 11:43 am

DVM wrote:
edrose wrote:
DVM wrote:Hi guys,i hope all is well,i am a new member,i would some help how would you get siri to turn an output high on a I2C device? :? thanks in advance
I don't know much about ruby, but this looks promising.
http://rubygems.org/gems/i2c
It looks like a simple case of installing a gem, and then sending the commands to the device using commands. How much programming experience and siriproxy knowledge do you have? Tell us how far you have got so far and we can help you with the next step.

Thanks so much,Ok,not much experience ,have a better understanding with vba ,arduino.i downloaded an image ok raspbian and siri,I just need to make a static IP address and install the certificates on my iPhone. Ok from here on I need help I'm guessing I need to install wiringpi inorder access the gpio's?but since there is so much ok things I would like to control hence my question about siri turning on an output of i2c device
Look at this post: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=25118
Here the guy goes through the basics of turning an output on the GPIO on with Siri (in his case flicking a relay). It shows what to put in the siriproxy-example.rb file to make this happen. If you would like to turn on an I2C output you will need to do some research on the specific gem you would like to use, and just put the command for I2C in the place of the GPIO command. You will also need to know what you need to send/write (whatever it is on I2C!) to the device on the other end of the I2C bus to turn outputs on.

DVM
Posts: 9
Joined: Tue Jul 09, 2013 9:09 am

Re: Siri Proxy

Wed Jul 10, 2013 12:02 pm

Look at this post: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=25118
Here the guy goes through the basics of turning an output on the GPIO on with Siri (in his case flicking a relay). It shows what to put in the siriproxy-example.rb file to make this happen. If you would like to turn on an I2C output you will need to do some research on the specific gem you would like to use, and just put the command for I2C in the place of the GPIO command. You will also need to know what you need to send/write (whatever it is on I2C!) to the device on the other end of the I2C bus to turn outputs on.[/quote]

Thanks,i have come across that example before and most of the examples that i have read are using wiringpi,i am just unsure about the i2c command.

edrose
Posts: 13
Joined: Fri Dec 28, 2012 3:35 pm

Re: Siri Proxy

Wed Jul 10, 2013 12:46 pm

I'm a strong believer that going through other people's code is one of the best ways to learn, so I'm going to point you to a tutorial that uses I2C in a python script for a different useage. If you use the first setup page to set your rpi up for i2c, then go through the script to work out what commands need to be used and just copy & paste the bits of code, tweaking where necessary. Then all you need to do is change the GPIO lines in the garage door post to

Code: Select all

system("path/to/python/script.py")
and it will execute it. If you get a bit of code that you have copied and tweaked that still doesn't work then post it and we can look at it and help you.

DVM
Posts: 9
Joined: Tue Jul 09, 2013 9:09 am

Re: Siri Proxy

Wed Jul 10, 2013 1:03 pm

Thanks alot,i will look at that,you have been helpful hope it works out :)

DVM
Posts: 9
Joined: Tue Jul 09, 2013 9:09 am

Re: Siri Proxy

Mon Jul 15, 2013 12:15 pm

@edrose I have my "Siri Proxy Up and Running" :) thanks for your help, please can you help me with starting the siri proxy on boot up or on crashes and to make it run on the background?

Thanks
DVM

edrose
Posts: 13
Joined: Fri Dec 28, 2012 3:35 pm

Re: Siri Proxy

Mon Jul 15, 2013 5:38 pm

DVM wrote:@edrose I have my "Siri Proxy Up and Running" :) thanks for your help, please can you help me with starting the siri proxy on boot up or on crashes and to make it run on the background?

Thanks
DVM
Getting siriproxy running automatically isn't easy at all, and took me ages to figure out. However, eventually, i got it working. I downloaded this keep alive script from the internet:

Code: Select all

# keepalive checks once an hour to see if the server
# is up, and if not, restarts it, then confirms it
# is indeed back up and running.
#
# keep alive *should* go to background as well if you run as
# rvmsudo nohup sh run.sh "keepalive" 2>&1> keepalive.log < /dev/null &
#
# if you need stop explained, get away from the keyboard and take
# cover under an interior doorway, quick.
#
# all logs are in ~/SiriProxy, check keepalive.log for server status
# and proxy.out & proxy.err for SiriProxy output.
#################################################################
 
START="rvmsudo nohup siriproxy server > proxy.out 2> proxy.err < /dev/null &"
TODAY=$(date)
 
case $1 in
start)
$START
exit 0
;;
stop)
echo "Stopping..."
rvmsudo killall -e "ruby $HOME/.rvm/gems/[email protected]/bin/siriproxy server" > /dev/null
rvmsudo killall sleep > /dev/null
echo "Done."
exit 0
;;
# all code by methoddk
keepalive)
while true; do
	if ps ax | grep -v grep | grep "$HOME/.rvm/gems/[email protected]/bin/" > /dev/null
	then
		echo $TODAY "SiriProxy is running!"
	else
		echo $TODAY "SiriProxy is not running. Restarting..."
		${START}
		sleep 5
		if ps ax | grep -v grep | grep "$HOME/.rvm/gems/[email protected]/bin/" > /dev/null
			then
				echo $TODAY "SiriProxy is running!"
			else
				echo $TODAY "Something is wrong."
		fi
	fi
	sleep 300
done
;;
*)
echo "Usage: rvmsudo sh $0 {start|keepalive|stop}"
exit 0
;;
esac
It's by someone else so I can't take any responsibility for it. That script goes in the '~/SiriProxy/' directory. The script does exactly what it says on the tin - keeps siriproxy alive! It simply checks to see whether it's crashed and if it has, it restarts it. However, we still need to start the keepalive script. This is done using an init.d script. Init.d scripts automatically run when you specify them to, like at startup or shutdown (technically it's boot levels, but if you're interested in that then google it!). I got another script from the internet which was actually about starting a python script automatically, but I modified it to suit my needs.

Code: Select all

#!/bin/bash

case "$1" in
  start)
    echo "Starting Siri Proxy..."
    su - root -c "(cd /root/SiriProxy && ./service.sh keepalive)" &
    sleep 10
    exit 0
    ;;
  stop)
    #Kill the keepalive script
    killall /usr/local/rvm/rubies/ruby-1.9.3-p362/bin/ruby
    #Kill SiriProxy
    pkill -9 -f "su - root -c (cd /root/SiriProxy && ./service.sh keepalive)"
    echo "SiriProxy stopped successfully..."
    exit 0
    ;;
  restart)
   service siriproxy stop
   service siriproxy start
   exit 0
   ;;
  *)
    echo "Usage: siriproxy {start|stop}"
    exit 1
    ;;
esac

exit 0
That needs to be put in '/etc/init.d'.
Finally, it needs to be activated with

Code: Select all

update-rc.d siriproxy defaults
Of course, that needs to be done as root.
If i'm honest, i'm not even sure whether the stop or restart functions work on that script, but I never use them and it starts siriproxy up by itself so i'm not complaining!

If theres a mistake let me know because i'm writing the commands off the top of my head and may have made a mistake!

Ed

elvisimprsntr
Posts: 131
Joined: Sat Dec 29, 2012 11:36 pm
Contact: Website

Re: Siri Proxy

Wed Jul 17, 2013 10:26 am

It's actually fairly easy to get SiriProxy to run at boot

My init.d script assumes SiriProxy is installed as root, but you can give it a try.

http://youtu.be/0z6uKw8Zaas.
http://www.youtube.com/user/TheElvisImprsntr

DVM
Posts: 9
Joined: Tue Jul 09, 2013 9:09 am

Re: Siri Proxy

Wed Jul 17, 2013 10:44 am

Thanks ed & elvis, i never give it a try yet

elvisimprsntr
Posts: 131
Joined: Sat Dec 29, 2012 11:36 pm
Contact: Website

Re: Siri Proxy

Wed Jul 17, 2013 1:57 pm

added note: you really don't need the keepalave function as suggested by others. if siriproxy is crashing then your plugings are causing it and you need to do more testing before running as a daemon
http://www.youtube.com/user/TheElvisImprsntr

DVM
Posts: 9
Joined: Tue Jul 09, 2013 9:09 am

Re: Siri Proxy

Wed Jul 17, 2013 3:34 pm

Ok,I have another problem and this might be silly but in new to this,how come I can only start my siri proxy from the login screen? If I go the raspbian desktop and try from Lxterminal or root terminal it doesn't start

elvisimprsntr
Posts: 131
Joined: Sat Dec 29, 2012 11:36 pm
Contact: Website

Re: Siri Proxy

Thu Jul 18, 2013 12:39 am

DVM wrote:Ok,I have another problem and this might be silly but in new to this,how come I can only start my siri proxy from the login screen? If I go the raspbian desktop and try from Lxterminal or root terminal it doesn't start
My guess is because the file to added the RVM paths to does not get sourced when you log in at a console terminal, only when you log into a terminal window. If you enable SSH, you can remote in to the RPi via SSH from a *NIX client or using putty on a Window client, which will call those files when you log in. Or you can manually source those files after you login via the console terminal.
http://www.youtube.com/user/TheElvisImprsntr

DVM
Posts: 9
Joined: Tue Jul 09, 2013 9:09 am

Re: Siri Proxy

Fri Jul 19, 2013 12:59 pm

elvisimprsntr wrote:
DVM wrote:Ok,I have another problem and this might be silly but in new to this,how come I can only start my siri proxy from the login screen? If I go the raspbian desktop and try from Lxterminal or root terminal it doesn't start
My guess is because the file to added the RVM paths to does not get sourced when you log in at a console terminal, only when you log into a terminal window. If you enable SSH, you can remote in to the RPi via SSH from a *NIX client or using putty on a Window client, which will call those files when you log in. Or you can manually source those files after you login via the console terminal.
when i remote into my rpi its the same story,i used the image from http://www.hometoys.com/emagazine.php?a ... #downloads
what do u mean by manually sourcing the files?

elvisimprsntr
Posts: 131
Joined: Sat Dec 29, 2012 11:36 pm
Contact: Website

Re: Siri Proxy

Fri Jul 19, 2013 1:59 pm

The instructions and image from that site are seriously out of date. Nonetheless, try performing the second two commands in step `3. Install RVM`

Or try my image: http://sourceforge.net/p/siriproxyrpi/wiki/Home/
http://www.youtube.com/user/TheElvisImprsntr

Return to “Troubleshooting”

Who is online

Users browsing this forum: DarkPlatinum, Google [Bot], smumpy and 50 guests