Siri: Open my garage door..


218 posts   Page 7 of 9   1 ... 4, 5, 6, 7, 8, 9
by RugYG » Sun Jan 13, 2013 7:48 pm
The sensor is used to detect if the door is open or closed. I currently do not have a camera in my garage.

I do have a question. What GPIO pin is used to send the open command? and how can i call upon two pins?

I need to set one as an input to read the signal from the door senor.
Posts: 7
Joined: Wed Jan 09, 2013 5:38 am
by zstryker » Sun Jan 13, 2013 9:33 pm
I got everything working up until command 16 on the iDownloadBlog tutorial. When I type "rvmsudo siriproxy server" in the directory ~/SiriProxy, I get the following error:

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./usr/bin/env: siriproxy: No such file or directory

How do I fix this? I did everything right... I think.....
Warning: Absolute Newbie Approaching
Posts: 19
Joined: Sun Jan 06, 2013 3:15 am
by alankernel » Mon Jan 14, 2013 2:24 am
@zstryker
Please refer to the earlier discussion we had about this topic where I provided a summary of things you need to do, one of which is mentioned in this warning, which is: export rvmsudo_secure_path=1
Also, note that it's best to run all steps as root.

zstryker wrote:I got everything working up until command 16 on the iDownloadBlog tutorial. When I type "rvmsudo siriproxy server" in the directory ~/SiriProxy, I get the following error:

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./usr/bin/env: siriproxy: No such file or directory

How do I fix this? I did everything right... I think.....
Posts: 15
Joined: Mon Dec 24, 2012 7:50 pm
by zstryker » Mon Jan 14, 2013 4:02 am
So, basically, I should re-run the setup, logged in as root, and then run "export rvmsudo_secure_path=1" before starting the server?

alankernel wrote:@zstryker
Please refer to the earlier discussion we had about this topic where I provided a summary of things you need to do, one of which is mentioned in this warning, which is: export rvmsudo_secure_path=1
Also, note that it's best to run all steps as root.

zstryker wrote:I got everything working up until command 16 on the iDownloadBlog tutorial. When I type "rvmsudo siriproxy server" in the directory ~/SiriProxy, I get the following error:

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./usr/bin/env: siriproxy: No such file or directory

How do I fix this? I did everything right... I think.....
Warning: Absolute Newbie Approaching
Posts: 19
Joined: Sun Jan 06, 2013 3:15 am
by alankernel » Mon Jan 14, 2013 5:26 am
Based on my experience, that should do, but I'll defer to DarkTherapy as he's the master in this domain.

zstryker wrote:So, basically, I should re-run the setup, logged in as root, and then run "export rvmsudo_secure_path=1" before starting the server?

alankernel wrote:@zstryker
Please refer to the earlier discussion we had about this topic where I provided a summary of things you need to do, one of which is mentioned in this warning, which is: export rvmsudo_secure_path=1
Also, note that it's best to run all steps as root.

zstryker wrote:I got everything working up until command 16 on the iDownloadBlog tutorial. When I type "rvmsudo siriproxy server" in the directory ~/SiriProxy, I get the following error:

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./usr/bin/env: siriproxy: No such file or directory

How do I fix this? I did everything right... I think.....
Posts: 15
Joined: Mon Dec 24, 2012 7:50 pm
by zstryker » Mon Jan 14, 2013 5:39 am
Found the post by jarrah31, with that I managed to get "Starting SiriProxy on port 443.. Siriproxy up and running!" But, when I connected with my brother's iPad 3 (I've got an ipad 2...), the server crashed, and showed a lot of code that I couldn't understand... I'm going to do a clean install, and then see if it'll work tomorrow. I think I've got a pretty good understanding of how to do it now.

One question- When following the instructions in jarrah31's post, I edited siriproxy.gemspec (sudo nano (siriproxy.gemspec directory)) and there was nothing there... Again, I think a clean install should help, as I had just installed siriproxy as the pi user, and that might have broken it... Can anyone verify that jarrah31's instructions work?
Warning: Absolute Newbie Approaching
Posts: 19
Joined: Sun Jan 06, 2013 3:15 am
by alankernel » Mon Jan 14, 2013 9:23 pm
@RugYG
Thanks or sharing the pictures of your setup. I'm still a bit confused though.
In your wiring diagram:

Left side:
1. Main power goes to Pi's 5v pin
2. Main ground goes to Pi's Gnd pin
3. Relay 1 signal for command to open door (Question: where does that connect on Pi?)

Right side:
1. Black wire goes to "Right Wall Switch Terminal" (Question: is this going into the right button of the garage door wall switch?)
2. Red wire goes to "Left Wall Switch Terminal" (Question: is this going into the left button of the garage door wall switch?)
3. To Main Power (Question: From where? Is this fed from a wall socket?)
4. To Raspberry Pi (Question: I wasn't aware that we needed to connect relay to Pi through a power wire)


RugYG wrote:Alright i just finished wiring everything up. Sorry it took so long. I had to run wire from my office to my garage. I wanted to have the raspberryPi in my office so it can be hard wired in to the network and so i don't have to dedicate it to just this project.

The relay board is powered by a 5v USB wall plug and USB cord i had laying around. i cut the cord and just used the red and black wires, these are the wires refereed to as the main power and ground on the wiring diagram

Here is the wiring diagram for my setup:
https://www.dropbox.com/s/5oqr11vfbl5b3rg/RaspberryPi__Siri%20Open%20Garage%20Door_Relay%20Board%20Wiring%20Diagram.jpg

Relay board used:
https://www.dropbox.com/s/f4jxvw1vnkmi1i3/RaspberryPi__Siri%20Open%20Garage%20Door_Relay%20Board%20Top.JPG

https://www.dropbox.com/s/243jjdxvky7lv2k/RaspberryPi__Siri%20Open%20Garage%20Door_Relay%20Board%20Front.JPG

Wall switch and where it connects:
https://www.dropbox.com/s/bp76j7hfyqa0cig/RaspberryPi__Siri%20Open%20Garage%20Door_Garage%20Door%20Wall%20Switch%20Front.JPG

https://www.dropbox.com/s/lzrwpwfqrxwj36t/RaspberryPi__Siri%20Open%20Garage%20Door_Garage%20Door%20Wall%20Switch%20Back.JPG

https://www.dropbox.com/s/5jmq4on4aew73ky/RaspberryPi__Siri%20Open%20Garage%20Door_Garage%20Door%20Safety%20Beam%20and%20Wall%20Switch%20Terminals.JPG

Door sensor:
https://www.dropbox.com/s/ppcjdworgfh84tb/RaspberryPi__Siri%20Open%20Garage%20Door_Door%20Sensor.JPG

How i installed the relay board in the garage door housing:
https://www.dropbox.com/s/1yhk2gcys31v4m1/RaspberryPi__Siri%20Open%20Garage%20Door_Relay%20Board%20Installed.JPG
Posts: 15
Joined: Mon Dec 24, 2012 7:50 pm
by RugYG » Tue Jan 15, 2013 2:22 am
@alankernel

Left Side
The main power and ground for the relay board goes to a USB wall charger (I used one of these because they generally output 5v @ 1a. Also I have my raspberryPi in my office and not in my garage so less wire to run.)

I believe the provided code uses pin 1 which is the 3.3v output for the relay 1 signal. (Someone correct me if I'm wrong)
I am working on some code to use pin 11 which is GPIO 17

Right Side
You can go all the way to the button if you want. However to save wire, you can just connect to where the wall switch connects to your garage door opener. Basically all you are doing is completing the circuit to open the door (At least that is how my garage door opener model works)

The second relay isn't required. It's something I added to this project that i thought would be a cool addition.

The second relay is used to monitor the door sensor (The kind used with alarm systems to see if a window is open or closed)

I have this circuit as follows. Power from USB wall charger goes to the door sensor, then from the sensor to the relay 2 command, (The sensor is installed so when the door is closed the loop is complete) the relay then has the first terminal empty, power from the wall charger to the middle terminal and a line from the third terminal to a resistor then to the raspberryPi pin 12 which is GPIO pin 18 (any input to the raspberryPi must be 3.3v)

Once I finish the code, you will be able to ask "is the garage door closed?" or when you ask "Open the garage door" Siri can respond "The garage door is already open" if the door is already open.

The way everything is setup right now you can open and close the garage door with the same command.
(Say "open the garage door" the door will open {if closed} and if you say "open the garage door" again it will close)

With the added sensor it's forcing you to use two commands and so that the garage door will only open when it is closed and vice versa. This is ideal for those who plan to use siriproxy over WAN (VPN)

RugYG

by alankernel » Mon Jan 14, 2013 3:23 pm

@RugYG
Thanks or sharing the pictures of your setup. I'm still a bit confused though.
In your wiring diagram:

Left side:
1. Main power goes to Pi's 5v pin
2. Main ground goes to Pi's Gnd pin
3. Relay 1 signal for command to open door (Question: where does that connect on Pi?)

Right side:
1. Black wire goes to "Right Wall Switch Terminal" (Question: is this going into the right button of the garage door wall switch?)
2. Red wire goes to "Left Wall Switch Terminal" (Question: is this going into the left button of the garage door wall switch?)
3. To Main Power (Question: From where? Is this fed from a wall socket?)
4. To Raspberry Pi (Question: I wasn't aware that we needed to connect relay to Pi through a power wire)
Posts: 7
Joined: Wed Jan 09, 2013 5:38 am
by alankernel » Tue Jan 15, 2013 5:04 am
@RugYG
Thank you very much for explaining the details of your setup. My initial plan was not to use a sensor but after reading your description I'm more interested in doing it (and also definitely how to VPN in and use SIRI remotely).

For now, if I don't go for the sensor and just go with the simple setup, I wanted to validate with you that I would be ok if I do the following (Please note that I have a 5v/100mA wall charger for the Pi and I had a non-charged USB hub that I use to connect peripherals to the Pi, but I swapped it with another one that comes with a charger since I heard the non-charged one may suck some of the power from the Pi):

Left Side:
1. Main power goes to Pi's 5v pin
2. Main ground goes to Pi's Gnd pin
3. IN 1 on Relay connects to Pin 1 on Pi, which will give signal for command to open door

Right Side:
1. Black wire connects from common (COM) on Relay to where the right wall switch connects to my garage door opener - in the garage door engine (I'm assuming I can pinpoint this by tracing where the right wall switch cable connects to)
2. Red wire connects from Normally Open (NO) on Relay to where the left wall switch connects to my garage door opener - in the garage door engine (same assumption)

Finally, since I'm not implementing the sensor (yet), I don't have to worry about the Relay 2 in or out connectivity.

Thank you again


RugYG wrote:@alankernel

Left Side
The main power and ground for the relay board goes to a USB wall charger (I used one of these because they generally output 5v @ 1a. Also I have my raspberryPi in my office and not in my garage so less wire to run.)

I believe the provided code uses pin 1 which is the 3.3v output for the relay 1 signal. (Someone correct me if I'm wrong)
I am working on some code to use pin 11 which is GPIO 17

Right Side
You can go all the way to the button if you want. However to save wire, you can just connect to where the wall switch connects to your garage door opener. Basically all you are doing is completing the circuit to open the door (At least that is how my garage door opener model works)

The second relay isn't required. It's something I added to this project that i thought would be a cool addition.

The second relay is used to monitor the door sensor (The kind used with alarm systems to see if a window is open or closed)

I have this circuit as follows. Power from USB wall charger goes to the door sensor, then from the sensor to the relay 2 command, (The sensor is installed so when the door is closed the loop is complete) the relay then has the first terminal empty, power from the wall charger to the middle terminal and a line from the third terminal to a resistor then to the raspberryPi pin 12 which is GPIO pin 18 (any input to the raspberryPi must be 3.3v)

Once I finish the code, you will be able to ask "is the garage door closed?" or when you ask "Open the garage door" Siri can respond "The garage door is already open" if the door is already open.

The way everything is setup right now you can open and close the garage door with the same command.
(Say "open the garage door" the door will open {if closed} and if you say "open the garage door" again it will close)

With the added sensor it's forcing you to use two commands and so that the garage door will only open when it is closed and vice versa. This is ideal for those who plan to use siriproxy over WAN (VPN)

RugYG

by alankernel » Mon Jan 14, 2013 3:23 pm

@RugYG
Thanks or sharing the pictures of your setup. I'm still a bit confused though.
In your wiring diagram:

Left side:
1. Main power goes to Pi's 5v pin
2. Main ground goes to Pi's Gnd pin
3. Relay 1 signal for command to open door (Question: where does that connect on Pi?)

Right side:
1. Black wire goes to "Right Wall Switch Terminal" (Question: is this going into the right button of the garage door wall switch?)
2. Red wire goes to "Left Wall Switch Terminal" (Question: is this going into the left button of the garage door wall switch?)
3. To Main Power (Question: From where? Is this fed from a wall socket?)
4. To Raspberry Pi (Question: I wasn't aware that we needed to connect relay to Pi through a power wire)
Posts: 15
Joined: Mon Dec 24, 2012 7:50 pm
by DarkTherapy » Tue Jan 15, 2013 7:23 am
It's good to see so many people involved in this project now. I'd like to add the fact that you may not actually need a relay to do the switching for you. You can try using just an NPN transistor, connect the two button points to the emitter/collector of the transistor then connect the base pin to your GPIO pin and share the ground from the pi to the ground of the garage system. The small signal through the transistor may be enough to trigger the door. You'll have to experiment a little with your own setup. You'll need a transistor between GPIO and base pin (10k would do) and you may need to add a pull down resistor from base to ground (maybe 10ohm?), again this is all experimentation but it could save some parts.
Posts: 69
Joined: Mon Aug 20, 2012 8:14 am
by RugYG » Tue Jan 15, 2013 10:05 pm
@alankernel

No problem, VPN is very handy but lets work on geting your Pi setup first then we can worry about that.

Double check your wall charger if you are using a usb splitter i wouldnt use anything under 500mA (1a would be best)

Left side looks good

Right side looks good. Only change would be to switch the COM and N.O. make the COM the red (Positive) wire {I just noticed that and will probably switch mine, it shouldnt matter because all you are doing is briding the gab between the two leads}

Correct about the second relay, you can ignore that part.

RugYG

by alankernel » Mon Jan 14, 2013 11:04 pm

@RugYG
Thank you very much for explaining the details of your setup. My initial plan was not to use a sensor but after reading your description I'm more interested in doing it (and also definitely how to VPN in and use SIRI remotely).

For now, if I don't go for the sensor and just go with the simple setup, I wanted to validate with you that I would be ok if I do the following (Please note that I have a 5v/100mA wall charger for the Pi and I had a non-charged USB hub that I use to connect peripherals to the Pi, but I swapped it with another one that comes with a charger since I heard the non-charged one may suck some of the power from the Pi):

Left Side:
1. Main power goes to Pi's 5v pin
2. Main ground goes to Pi's Gnd pin
3. IN 1 on Relay connects to Pin 1 on Pi, which will give signal for command to open door

Right Side:
1. Black wire connects from common (COM) on Relay to where the right wall switch connects to my garage door opener - in the garage door engine (I'm assuming I can pinpoint this by tracing where the right wall switch cable connects to)
2. Red wire connects from Normally Open (NO) on Relay to where the left wall switch connects to my garage door opener - in the garage door engine (same assumption)

Finally, since I'm not implementing the sensor (yet), I don't have to worry about the Relay 2 in or out connectivity.

Thank you again
Posts: 7
Joined: Wed Jan 09, 2013 5:38 am
by alankernel » Thu Jan 17, 2013 2:30 am
@RugYG
Thanks! I will try this out and let you know.

RugYG wrote:@alankernel

No problem, VPN is very handy but lets work on geting your Pi setup first then we can worry about that.

Double check your wall charger if you are using a usb splitter i wouldnt use anything under 500mA (1a would be best)

Left side looks good

Right side looks good. Only change would be to switch the COM and N.O. make the COM the red (Positive) wire {I just noticed that and will probably switch mine, it shouldnt matter because all you are doing is briding the gab between the two leads}

Correct about the second relay, you can ignore that part.

RugYG

by alankernel » Mon Jan 14, 2013 11:04 pm

@RugYG
Thank you very much for explaining the details of your setup. My initial plan was not to use a sensor but after reading your description I'm more interested in doing it (and also definitely how to VPN in and use SIRI remotely).

For now, if I don't go for the sensor and just go with the simple setup, I wanted to validate with you that I would be ok if I do the following (Please note that I have a 5v/100mA wall charger for the Pi and I had a non-charged USB hub that I use to connect peripherals to the Pi, but I swapped it with another one that comes with a charger since I heard the non-charged one may suck some of the power from the Pi):

Left Side:
1. Main power goes to Pi's 5v pin
2. Main ground goes to Pi's Gnd pin
3. IN 1 on Relay connects to Pin 1 on Pi, which will give signal for command to open door

Right Side:
1. Black wire connects from common (COM) on Relay to where the right wall switch connects to my garage door opener - in the garage door engine (I'm assuming I can pinpoint this by tracing where the right wall switch cable connects to)
2. Red wire connects from Normally Open (NO) on Relay to where the left wall switch connects to my garage door opener - in the garage door engine (same assumption)

Finally, since I'm not implementing the sensor (yet), I don't have to worry about the Relay 2 in or out connectivity.

Thank you again
Posts: 15
Joined: Mon Dec 24, 2012 7:50 pm
by zstryker » Fri Jan 18, 2013 1:00 am
I got the server to start, but when I talk to siri using a 4S, I get the error:

Code: Select all
Create server for iPhone connection
start conn #<SiriProxy::Connection::Iphone:0x21f7608 @signature=3, @processed_headers=false, @output_buffer="", @input_buffer="", @unzipped_input="", @unzipped_output="", @unzip_stream=#<Zlib::Inflate:0x21f7500>, @zip_stream=#<Zlib::Deflate:0x21f74e8>, @consumed_ace=false, @name="iPhone", @ssled=false>
[Info - Plugin Manager] Plugins laoded: [#<SiriProxy::Plugin::Example:0x289c5c0 @manager=#<SiriProxy::PluginManager:0x21f7110 @plugins=[...]>>]
[Info - iPhone] Received Object: LoadAssistant
/usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:217:in `encode': "\xFF" on UTF-8 (Encoding::InvalidByteSequenceError)
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:217:in `charset_convert'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:442:in `string_to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbCFTypes.rb:48:in `to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `block in dict_to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `map'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `dict_to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbCFTypes.rb:243:in `to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `block in dict_to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `map'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `dict_to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbCFTypes.rb:243:in `to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:70:in `to_str'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbCFPropertyList.rb:363:in `to_str'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbCFPropertyList.rb:398:in `to_plist'
   from /root/SiriProxy/lib/siriproxy/connection.rb:150:in `inject_object_to_output_stream'
   from /root/SiriProxy/lib/siriproxy/connection.rb:90:in `process_compressed_data'
   from /root/SiriProxy/lib/siriproxy/connection.rb:58:in `receive_binary_data'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/eventmachine-1.0.0/lib/em/protocols/linetext2.rb:94:in `receive_data'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run_machine'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run'
   from /root/SiriProxy/lib/siriproxy.rb:16:in `initialize'
   from /root/SiriProxy/lib/siriproxy/command_line.rb:96:in `new'
   from /root/SiriProxy/lib/siriproxy/command_line.rb:96:in `start_server'
   from /root/SiriProxy/lib/siriproxy/command_line.rb:85:in `run_server'
   from /root/SiriProxy/lib/siriproxy/command_line.rb:37:in `initialize'
   from /root/SiriProxy/bin/siriproxy:6:in `new'
   from /root/SiriProxy/bin/siriproxy:6:in `<top (required)>'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/bin/siriproxy:19:in `load'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/bin/siriproxy:19:in `<main>'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/bin/ruby_noexec_wrapper:14:in `eval'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/bin/ruby_noexec_wrapper:14:in `<main>'
zlib(finalizer): the stream was freed prematurely.


Could someone point me toward a post that might help? I've already installed this a couple of times, and I'm desperate for it to work so I can use it to control stuff from siri...
Warning: Absolute Newbie Approaching
Posts: 19
Joined: Sun Jan 06, 2013 3:15 am
by DarkTherapy » Fri Jan 18, 2013 5:44 am
zstryker wrote:I got the server to start, but when I talk to siri using a 4S, I get the error:

Code: Select all
Create server for iPhone connection
start conn #<SiriProxy::Connection::Iphone:0x21f7608 @signature=3, @processed_headers=false, @output_buffer="", @input_buffer="", @unzipped_input="", @unzipped_output="", @unzip_stream=#<Zlib::Inflate:0x21f7500>, @zip_stream=#<Zlib::Deflate:0x21f74e8>, @consumed_ace=false, @name="iPhone", @ssled=false>
[Info - Plugin Manager] Plugins laoded: [#<SiriProxy::Plugin::Example:0x289c5c0 @manager=#<SiriProxy::PluginManager:0x21f7110 @plugins=[...]>>]
[Info - iPhone] Received Object: LoadAssistant
/usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:217:in `encode': "\xFF" on UTF-8 (Encoding::InvalidByteSequenceError)
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:217:in `charset_convert'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:442:in `string_to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbCFTypes.rb:48:in `to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `block in dict_to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `map'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `dict_to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbCFTypes.rb:243:in `to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `block in dict_to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `map'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `dict_to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbCFTypes.rb:243:in `to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:70:in `to_str'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbCFPropertyList.rb:363:in `to_str'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbCFPropertyList.rb:398:in `to_plist'
   from /root/SiriProxy/lib/siriproxy/connection.rb:150:in `inject_object_to_output_stream'
   from /root/SiriProxy/lib/siriproxy/connection.rb:90:in `process_compressed_data'
   from /root/SiriProxy/lib/siriproxy/connection.rb:58:in `receive_binary_data'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/eventmachine-1.0.0/lib/em/protocols/linetext2.rb:94:in `receive_data'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run_machine'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run'
   from /root/SiriProxy/lib/siriproxy.rb:16:in `initialize'
   from /root/SiriProxy/lib/siriproxy/command_line.rb:96:in `new'
   from /root/SiriProxy/lib/siriproxy/command_line.rb:96:in `start_server'
   from /root/SiriProxy/lib/siriproxy/command_line.rb:85:in `run_server'
   from /root/SiriProxy/lib/siriproxy/command_line.rb:37:in `initialize'
   from /root/SiriProxy/bin/siriproxy:6:in `new'
   from /root/SiriProxy/bin/siriproxy:6:in `<top (required)>'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/bin/siriproxy:19:in `load'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/bin/siriproxy:19:in `<main>'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/bin/ruby_noexec_wrapper:14:in `eval'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/bin/ruby_noexec_wrapper:14:in `<main>'
zlib(finalizer): the stream was freed prematurely.


Could someone point me toward a post that might help? I've already installed this a couple of times, and I'm desperate for it to work so I can use it to control stuff from siri...


https://github.com/plamoni/SiriProxy/issues/389
Posts: 69
Joined: Mon Aug 20, 2012 8:14 am
by zstryker » Fri Jan 18, 2013 6:31 am
I tried changing the line on the file, but it didn't work, and I got the same error. There was another post, that said to move something into something, but I couldn't find the directory to move that thing into...

DarkTherapy wrote:
zstryker wrote:I got the server to start, but when I talk to siri using a 4S, I get the error:

Code: Select all
Create server for iPhone connection
start conn #<SiriProxy::Connection::Iphone:0x21f7608 @signature=3, @processed_headers=false, @output_buffer="", @input_buffer="", @unzipped_input="", @unzipped_output="", @unzip_stream=#<Zlib::Inflate:0x21f7500>, @zip_stream=#<Zlib::Deflate:0x21f74e8>, @consumed_ace=false, @name="iPhone", @ssled=false>
[Info - Plugin Manager] Plugins laoded: [#<SiriProxy::Plugin::Example:0x289c5c0 @manager=#<SiriProxy::PluginManager:0x21f7110 @plugins=[...]>>]
[Info - iPhone] Received Object: LoadAssistant
/usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:217:in `encode': "\xFF" on UTF-8 (Encoding::InvalidByteSequenceError)
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:217:in `charset_convert'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:442:in `string_to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbCFTypes.rb:48:in `to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `block in dict_to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `map'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `dict_to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbCFTypes.rb:243:in `to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `block in dict_to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `map'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:550:in `dict_to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbCFTypes.rb:243:in `to_binary'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbBinaryCFPropertyList.rb:70:in `to_str'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbCFPropertyList.rb:363:in `to_str'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/CFPropertyList-2.2.0/lib/rbCFPropertyList.rb:398:in `to_plist'
   from /root/SiriProxy/lib/siriproxy/connection.rb:150:in `inject_object_to_output_stream'
   from /root/SiriProxy/lib/siriproxy/connection.rb:90:in `process_compressed_data'
   from /root/SiriProxy/lib/siriproxy/connection.rb:58:in `receive_binary_data'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/eventmachine-1.0.0/lib/em/protocols/linetext2.rb:94:in `receive_data'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run_machine'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run'
   from /root/SiriProxy/lib/siriproxy.rb:16:in `initialize'
   from /root/SiriProxy/lib/siriproxy/command_line.rb:96:in `new'
   from /root/SiriProxy/lib/siriproxy/command_line.rb:96:in `start_server'
   from /root/SiriProxy/lib/siriproxy/command_line.rb:85:in `run_server'
   from /root/SiriProxy/lib/siriproxy/command_line.rb:37:in `initialize'
   from /root/SiriProxy/bin/siriproxy:6:in `new'
   from /root/SiriProxy/bin/siriproxy:6:in `<top (required)>'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/bin/siriproxy:19:in `load'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/bin/siriproxy:19:in `<main>'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/bin/ruby_noexec_wrapper:14:in `eval'
   from /usr/local/rvm/gems/ruby-1.9.3-p362@SiriProxy/bin/ruby_noexec_wrapper:14:in `<main>'
zlib(finalizer): the stream was freed prematurely.


Could someone point me toward a post that might help? I've already installed this a couple of times, and I'm desperate for it to work so I can use it to control stuff from siri...


https://github.com/plamoni/SiriProxy/issues/389
Warning: Absolute Newbie Approaching
Posts: 19
Joined: Sun Jan 06, 2013 3:15 am
by DarkTherapy » Fri Jan 18, 2013 7:27 am
"I tried changing the line on the file, but it didn't work, and I got the same error. There was another post, that said to move something into something, but I couldn't find the directory to move that thing into..."

On my Pi is a dir: /usr/local/rvm/gems

Inside that is the @SiriProxy/gems directory.

I have a CFPropertyList-2.1.1 and mine works fine. If yours is different and not functioning, you can try:
gem install CFPropertyList --version 2.1.1
Posts: 69
Joined: Mon Aug 20, 2012 8:14 am
by alankernel » Sat Jan 19, 2013 4:48 am
I GOT IT!! IT WORKS!! Siri answers my every garage-door-command :-))
@RugYG and @DarkTherapy
Thank you much!
Now, it's time to do more interesting stuff with this.. How about that VPN thing? :-)

RugYG wrote:@alankernel

No problem, VPN is very handy but lets work on geting your Pi setup first then we can worry about that.

Double check your wall charger if you are using a usb splitter i wouldnt use anything under 500mA (1a would be best)

Left side looks good

Right side looks good. Only change would be to switch the COM and N.O. make the COM the red (Positive) wire {I just noticed that and will probably switch mine, it shouldnt matter because all you are doing is briding the gab between the two leads}

Correct about the second relay, you can ignore that part.

RugYG

by alankernel » Mon Jan 14, 2013 11:04 pm

@RugYG
Thank you very much for explaining the details of your setup. My initial plan was not to use a sensor but after reading your description I'm more interested in doing it (and also definitely how to VPN in and use SIRI remotely).

For now, if I don't go for the sensor and just go with the simple setup, I wanted to validate with you that I would be ok if I do the following (Please note that I have a 5v/100mA wall charger for the Pi and I had a non-charged USB hub that I use to connect peripherals to the Pi, but I swapped it with another one that comes with a charger since I heard the non-charged one may suck some of the power from the Pi):

Left Side:
1. Main power goes to Pi's 5v pin
2. Main ground goes to Pi's Gnd pin
3. IN 1 on Relay connects to Pin 1 on Pi, which will give signal for command to open door

Right Side:
1. Black wire connects from common (COM) on Relay to where the right wall switch connects to my garage door opener - in the garage door engine (I'm assuming I can pinpoint this by tracing where the right wall switch cable connects to)
2. Red wire connects from Normally Open (NO) on Relay to where the left wall switch connects to my garage door opener - in the garage door engine (same assumption)

Finally, since I'm not implementing the sensor (yet), I don't have to worry about the Relay 2 in or out connectivity.

Thank you again
Posts: 15
Joined: Mon Dec 24, 2012 7:50 pm
by alankernel » Sun Jan 20, 2013 4:55 am
I guess I celebrated too quickly.. 2 things:
1 - when I connect the wires from the relay to the garage door opener, Siri is able to open and close the garage door but as soon as I use it, I notice that the light on the wall mounted switch goes out and its buttons don't work anymore. any idea why that may be?
2 - Both the Pi and the relay fell down from the garage ceiling. One of the relays broke (I have 7 left) and the padding within one of the 2 USB ports on the Pi fell out...but - amazingly - they both still work. I guess this attests to the sturdiness of the Pi/relay or to my luck with that incident :D

Your suggestion for 1- would be appreciated.


alankernel wrote:I GOT IT!! IT WORKS!! Siri answers my every garage-door-command :-))
@RugYG and @DarkTherapy
Thank you much!
Now, it's time to do more interesting stuff with this.. How about that VPN thing? :-)

RugYG wrote:@alankernel

No problem, VPN is very handy but lets work on geting your Pi setup first then we can worry about that.

Double check your wall charger if you are using a usb splitter i wouldnt use anything under 500mA (1a would be best)

Left side looks good

Right side looks good. Only change would be to switch the COM and N.O. make the COM the red (Positive) wire {I just noticed that and will probably switch mine, it shouldnt matter because all you are doing is briding the gab between the two leads}

Correct about the second relay, you can ignore that part.

RugYG

by alankernel » Mon Jan 14, 2013 11:04 pm

@RugYG
Thank you very much for explaining the details of your setup. My initial plan was not to use a sensor but after reading your description I'm more interested in doing it (and also definitely how to VPN in and use SIRI remotely).

For now, if I don't go for the sensor and just go with the simple setup, I wanted to validate with you that I would be ok if I do the following (Please note that I have a 5v/100mA wall charger for the Pi and I had a non-charged USB hub that I use to connect peripherals to the Pi, but I swapped it with another one that comes with a charger since I heard the non-charged one may suck some of the power from the Pi):

Left Side:
1. Main power goes to Pi's 5v pin
2. Main ground goes to Pi's Gnd pin
3. IN 1 on Relay connects to Pin 1 on Pi, which will give signal for command to open door

Right Side:
1. Black wire connects from common (COM) on Relay to where the right wall switch connects to my garage door opener - in the garage door engine (I'm assuming I can pinpoint this by tracing where the right wall switch cable connects to)
2. Red wire connects from Normally Open (NO) on Relay to where the left wall switch connects to my garage door opener - in the garage door engine (same assumption)

Finally, since I'm not implementing the sensor (yet), I don't have to worry about the Relay 2 in or out connectivity.

Thank you again
Posts: 15
Joined: Mon Dec 24, 2012 7:50 pm
by pwb2103 » Tue Jan 22, 2013 5:12 am
I'm so close to getting everything working so that Siri can buzz me in to my apartment building. The hardware is fine: the intercom system connects two pins when you hold the "door" button to let someone in, so I'm using a relay to connect those two pins.

My problem is that I need to keep that relay closed for about 10 seconds so that I have time to get in. I used the following code:

listen_for /can you let me in right now/i do
say "I'll buzz you in now..."
request_completed
system("gpio mode 1 out")
system("gpio write 1 1")
system("sleep 10")
system("gpio write 1 0")
end


But that sleep 10 bit crashes SiriProxy every time. The relay closes for 10 seconds and then opens again, but after that SiriProxy is out of commission until I restart. Siri never even responds with "I'll buzz you in now..." so I assume it is a buffer issue and it is actually waiting 10 seconds before giving the request completed command (like this guy had here: http://stackoverflow.com/questions/3084 ... ay-in-ruby ).

Someone else had a similar problem but I was lost in the answer: https://github.com/plamoni/SiriProxy/issues/154

Anyone have any ideas?
Posts: 3
Joined: Fri Dec 28, 2012 12:09 am
by DarkTherapy » Tue Jan 22, 2013 5:37 am
Try moving the "request completed" to after the relay is turned off.

Or you could put the GPIO commands in a separate bash script and have the siriproxy call it with: system("sh /SiriProxy/doorscript.sh")

Maybe that will work?

I've just Googled "ruby multithreading" and that looks like the answer, I'm going to mess with my Server to see of I can get multithreading working, running the relay code in its own thread so SiriProxy can continue in it's own.
Posts: 69
Joined: Mon Aug 20, 2012 8:14 am
by rurwin » Tue Jan 22, 2013 10:41 am
DarkTherapy wrote:Or you could put the GPIO commands in a separate bash script and have the siriproxy call it with: system("sh /SiriProxy/doorscript.sh")


If the application (siriproxy?) is waiting for the script to end, then it doesn't matter if it is in a bash script or not; it will still wait.

On the other hand you could use "&" and maybe "nohup" to let siriproxy set it off and forget it.

I think system("nohup bash /SiriProxy/doorscript.sh &") should work, but I can't test it at the moment. (And I can't test it with siriproxy anyway).
User avatar
Forum Moderator
Forum Moderator
Posts: 2902
Joined: Mon Jan 09, 2012 3:16 pm
by DarkTherapy » Tue Jan 22, 2013 10:48 am
rurwin wrote:
DarkTherapy wrote:Or you could put the GPIO commands in a separate bash script and have the siriproxy call it with: system("sh /SiriProxy/doorscript.sh")


If the application (siriproxy?) is waiting for the script to end, then it doesn't matter if it is in a bash script or not; it will still wait.

On the other hand you could use "&" and maybe "nohup" to let siriproxy set it off and forget it.

I think system("nohup bash /SiriProxy/doorscript.sh &") should work, but I can't test it at the moment. (And I can't test it with siriproxy anyway).



Thanks for that, I'll give it a go!
Posts: 69
Joined: Mon Aug 20, 2012 8:14 am
by pwb2103 » Wed Jan 23, 2013 4:22 am
Thanks rurwin,

system("bash /SiriProxy/doorscript.sh &") worked perfectly. My doorscript.sh currently is pretty plain with just:

#! /bin/bash
# basic door script
gpio mode 1 out
gpio write 1 1
sleep 10
gpio write 1 0

but I like that I can edit it on the fly.
Posts: 3
Joined: Fri Dec 28, 2012 12:09 am
by MarkAtHomeToysDotCom » Fri Feb 01, 2013 7:54 pm
Hi All

I recently wrote an articel on how to install and configure SiriProxy on PI (and Linux) and how to integrate with other systems using IP. the article also contains a link to a (guaranteed virus/spy where free) full configure Linux VM and PI SD image. All you need to do is change IP, one config file and install certificate on phone and you'll have a working SiriProxy

http://www.hometoys.com/emagazine/2013/02/siri-home-automation-integration-from-start-to-finish-brpart-1--the-basics-using-a-linux-vm/2087

Regards

Mark
Posts: 2
Joined: Fri Feb 01, 2013 7:49 pm
by tdpolo26 » Sun Feb 03, 2013 5:19 am
Hi i am new to all of this but love the idea
i also want to keep my raspberry pi inside and use it for other things. I was wondering a couple things.
1. I like the sensor idea.... but couldnt u just send a 5v signal through the door sensor and then the return wire feeds into one of the pins on the pi.... if it reads voltage you know the door is open or shut... is there any reason to do the relay???? would i still need a resistor????
2. can i send all this to the relay with a cat5 or 6 cable from my office. can it carry the 5v??? is it safe???
well any help would be great
oh btw this is the relay i got.... it was a few more dollars and i figure i could add to the system if i wanted to do something else.... also the reason for wanting to run cat 5 or 6 to the system.
Well any help would be great....
BTW would be great for a pictoral step by step with parts list to do the hardware part. i would but i wouldnt want to screw it up.
Thanks for all the work you guys have put in

RugYG wrote:@alankernel

Left Side
The main power and ground for the relay board goes to a USB wall charger (I used one of these because they generally output 5v @ 1a. Also I have my raspberryPi in my office and not in my garage so less wire to run.)

I believe the provided code uses pin 1 which is the 3.3v output for the relay 1 signal. (Someone correct me if I'm wrong)
I am working on some code to use pin 11 which is GPIO 17

Right Side
You can go all the way to the button if you want. However to save wire, you can just connect to where the wall switch connects to your garage door opener. Basically all you are doing is completing the circuit to open the door (At least that is how my garage door opener model works)

The second relay isn't required. It's something I added to this project that i thought would be a cool addition.

The second relay is used to monitor the door sensor (The kind used with alarm systems to see if a window is open or closed)

I have this circuit as follows. Power from USB wall charger goes to the door sensor, then from the sensor to the relay 2 command, (The sensor is installed so when the door is closed the loop is complete) the relay then has the first terminal empty, power from the wall charger to the middle terminal and a line from the third terminal to a resistor then to the raspberryPi pin 12 which is GPIO pin 18 (any input to the raspberryPi must be 3.3v)

Once I finish the code, you will be able to ask "is the garage door closed?" or when you ask "Open the garage door" Siri can respond "The garage door is already open" if the door is already open.

The way everything is setup right now you can open and close the garage door with the same command.
(Say "open the garage door" the door will open {if closed} and if you say "open the garage door" again it will close)

With the added sensor it's forcing you to use two commands and so that the garage door will only open when it is closed and vice versa. This is ideal for those who plan to use siriproxy over WAN (VPN)

RugYG

by alankernel » Mon Jan 14, 2013 3:23 pm

@RugYG
Thanks or sharing the pictures of your setup. I'm still a bit confused though.
In your wiring diagram:

Left side:
1. Main power goes to Pi's 5v pin
2. Main ground goes to Pi's Gnd pin
3. Relay 1 signal for command to open door (Question: where does that connect on Pi?)

Right side:
1. Black wire goes to "Right Wall Switch Terminal" (Question: is this going into the right button of the garage door wall switch?)
2. Red wire goes to "Left Wall Switch Terminal" (Question: is this going into the left button of the garage door wall switch?)
3. To Main Power (Question: From where? Is this fed from a wall socket?)
4. To Raspberry Pi (Question: I wasn't aware that we needed to connect relay to Pi through a power wire)
Posts: 2
Joined: Sat Feb 02, 2013 5:01 pm