Vehicle isn't starting #3

Closed
scojo opened this Issue Jan 7, 2012 · 4 comments

Projects

None yet

2 participants

scojo commented Jan 7, 2012

I'm trying to run the PHP script from the CLI. The vehicle isn't starting and I'm getting some PHP errors, along with a "Command Completed Successfully". Here's what I get:

scott@empoknor:/var/www/public$ php viper_control.php
Running from CLI

Requesting Session ID...
Session ID:
Getting Vechicle List...
1 vehicle(s) available.
Array
(
[0] => locate
[1] => enable_movement_alert
[2] => disable_movement_alert
[3] => set_geozone
[4] => set_speed_alert
[5] => remote
[6] => arm
[7] => disarm
[8] => trunk
[9] => panic
[10] => enable_zone1_entry_alert
[11] => disable_zone1_entry_alert
[12] => enable_zone1_exit_alert
[13] => disable_zone1_exit_alert
[14] => enable_battery_alert
[15] => disable_battery_alert
[16] => fastest_speed
[17] => set_geozone_rect
[18] => set_geozone1_circle
[19] => set_geozone2_circle
[20] => set_geozone3_circle
[21] => enable_zone2_entry_alert
[22] => disable_zone2_entry_alert
[23] => enable_zone2_exit_alert
[24] => disable_zone2_exit_alert
[25] => enable_zone3_entry_alert
[26] => disable_zone3_entry_alert
[27] => enable_zone3_exit_alert
[28] => disable_zone3_exit_alert
[29] => direct_io_lock_400
[30] => direct_io_lock_750
[31] => direct_io_lock_3500
[32] => direct_io_unlock_400
[33] => direct_io_unlock_750
[34] => direct_io_unlock_3500
[35] => direct_io_remote_750
[36] => direct_io_trunk_750_with_unlock
[37] => direct_io_trunk_750
[38] => direct_io_lock_400_2pulse
[39] => direct_io_lock_750_2pulse
[40] => direct_io_lock_3500_2pulse
[41] => direct_io_unlock_400_2pulse
[42] => direct_io_unlock_750_2pulse
[43] => direct_io_unlock_3500_2pulse
)
Enter Command: 5
PHP Notice: Trying to get property of non-object in /var/www/public/viper_control.php on line 37
PHP Notice: Trying to get property of non-object in /var/www/public/viper_control.php on line 37
PHP Notice: Trying to get property of non-object in /var/www/public/viper_control.php on line 37
Command received successfully.

scott@empoknor:/var/www/public$

When I look at viper_control.php, line 37 is "if($result->Return->ResponseSummary->StatusCode == 0){"
Ideas?

Great project. Would love to help out in some way, although my experience with Ruby is limited.

Scott

Owner
fiquett commented Jan 7, 2012

Type the option like "arm" or "disarm" instead of "1" or "2".

I need to allow it to accept the number option too later.

On Sat, Jan 7, 2012 at 2:35 PM, scojo <
reply@reply.github.com

wrote:

I'm trying to run the PHP script from the CLI. The vehicle isn't starting
and I'm getting some PHP errors, along with a "Command Completed
Successfully". Here's what I get:

scott@empoknor:/var/www/public$ php viper_control.php
Running from CLI

Requesting Session ID...
Session ID:
Getting Vechicle List...
1 vehicle(s) available.
Array
(
[0] => locate
[1] => enable_movement_alert
[2] => disable_movement_alert
[3] => set_geozone
[4] => set_speed_alert
[5] => remote
[6] => arm
[7] => disarm
[8] => trunk
[9] => panic
[10] => enable_zone1_entry_alert
[11] => disable_zone1_entry_alert
[12] => enable_zone1_exit_alert
[13] => disable_zone1_exit_alert
[14] => enable_battery_alert
[15] => disable_battery_alert
[16] => fastest_speed
[17] => set_geozone_rect
[18] => set_geozone1_circle
[19] => set_geozone2_circle
[20] => set_geozone3_circle
[21] => enable_zone2_entry_alert
[22] => disable_zone2_entry_alert
[23] => enable_zone2_exit_alert
[24] => disable_zone2_exit_alert
[25] => enable_zone3_entry_alert
[26] => disable_zone3_entry_alert
[27] => enable_zone3_exit_alert
[28] => disable_zone3_exit_alert
[29] => direct_io_lock_400
[30] => direct_io_lock_750
[31] => direct_io_lock_3500
[32] => direct_io_unlock_400
[33] => direct_io_unlock_750
[34] => direct_io_unlock_3500
[35] => direct_io_remote_750
[36] => direct_io_trunk_750_with_unlock
[37] => direct_io_trunk_750
[38] => direct_io_lock_400_2pulse
[39] => direct_io_lock_750_2pulse
[40] => direct_io_lock_3500_2pulse
[41] => direct_io_unlock_400_2pulse
[42] => direct_io_unlock_750_2pulse
[43] => direct_io_unlock_3500_2pulse
)
Enter Command: 6
PHP Notice: Trying to get property of non-object in
/var/www/public/viper_control.php on line 37
PHP Notice: Trying to get property of non-object in
/var/www/public/viper_control.php on line 37
PHP Notice: Trying to get property of non-object in
/var/www/public/viper_control.php on line 37
Command received successfully.

scott@empoknor:/var/www/public$

When I look at viper_control.php, line 37 is
"if($result->Return->ResponseSummary->StatusCode == 0){"
Ideas?

Great project. Would love to help out in some way, although my experience
with Ruby is limited.

Scott


Reply to this email directly or view it on GitHub:
#3

scojo commented Jan 7, 2012

There we go. That solved everything. Awesome. Once I knew the CLI worked I went to http://webserver/viper_control?action=remote and that works as well.

Question: I want to have my vehicle start on a schedule. I made a script on my box "starttruck" the contents are:

scott@empoknor:/var/www/public$ cat /bin/starttruck
curl http://empoknor/viper_control.php?action=remote
scott@empoknor:/var/www/public$

And then I set my cron schedule for the "starttruck" as appropriate. It's working, so I'm happy, but I'm curious if there is a better way to do this.....

scojo commented Jan 7, 2012

Also, is it normal to occassionally get this back (CLI or web interface):

[code]
scott@empoknor:/var/www/public$ starttruck

<title>Exception</title>

Exception

COLT Servers cannot process your request

Please press Dashboard Home to continue

<script type="text/javascript"> function dashboard(){ window.location = window.location.protocol + "//" + window.location.host + "/dashboard/home"; } function install_portal(){ window.location = window.location.protocol + "//" + window.location.host + "/install/install/action"; } </script>

scott@empoknor:/var/www/public$

[/code]

Owner
fiquett commented Jan 8, 2012

I have only seen that Exception a couple of times when they were probably doing maintenance.

You have two options for automating your car using the php script:

You can adjust the php page to parse command line arguments. (http://php.net/manual/en/features.commandline.php)

OR

You could just continue to curl and do something like this from crontab:

00 08 * * * /usr/bin/curl http://127.0.0.1/viper_control.php?action=remote > /dev/null 2>&1

That would start your car everyday at 8:00 and pass and discard any STDOUT and STDERROR to /dev/null.

Closing this issue. Thanks for your help! Enjoy!

@fiquett fiquett closed this Jan 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment