This object is in archive! 

Shorten url in http device

Sébastien Albrech shared this problem 11 years ago
Not a Problem

Hi,


I just installed an ebobe IP vision 58 Camera who is working quite fine with zipabox.


Then,I created and "http device" (to gather cam's motion detection alram) but the "active URL" guiven by zipabox is too long and was truncate when i pasted it in the camera setup software.


you can have a look on the 2 screenshots include in this post.


do you have any work around on that point ?

Replies (17)

photo
1

The same problem with foscam cameras, URL is to long...

photo
1

i found on a tutorial a work around by using a shorten url application like google shortener (http://goo.gl/), but it's not working with my cam :-(


Actually it work when i paste the short url in a browser, but the camera seem not to send the HTTP request.


and it's the same issue when sending http request from Zipabox rule creator to the camera...


i'm will turn crasy :-/


Kristian can you test the work around with your foscam and update me ?

photo
1

Sure Will, another option would be to put a very small script on a web server and Call that from the camera, the script then calls the zipato sensor.

photo
1

Another thing I found out, Axis cameras seems to work fine.

photo
1

OK, test done and its not working for me either.

- Added a virtual sensor (Camera Sensor)

- Added the Virtual sensor true value into google shortener.

- Updated my camera with the new shorten value for http motion request

- No activation upon motion

- Both the Zipato url and then shortened url works fine.


The funny thing is that i have mailed the Foscam support about this and their replay was that foscam cameras do not support http request trigger. When i then asked about this from i forum... no replay...

http://foscam.us/forum/customize-motion-alert-t2811.html

photo
1

I tried out with tiny URL instead of google shortener same issue :-(


I sent a mail to edobe support as well.


I read that ebode and foscam are based on the same firmware and web interface...


By the way what is you camera network config ?


mine is


Wifi on port 81 with DHCP (ip booked in DHCP server)

port forwarding added in router (acces cam web server from outside is ok)


it would be interesting to call a PHP script (as you suggest) who update a db field, just to validate if the HTTP request is send out (or not) by the camera.


by the way i managed to send http request from zipabox rules to camera to enable disable camera motion sensor with a virtual switch.

photo
1

First of all, we can't shorten virtual device URLs.

Your workarounds with short URL services doesn't work (except in browser) because camera doesn't follow redirects which are sent from those services (status 301).

Only option for now is the one that Kristian already suggested:

Kristian Olofsson wrote:

Sure Will, another option would be to put a very small script on a web server and Call that from the camera, the script then calls the zipato sensor.

photo
1

okay thanks Nenad, i will try it, and by the way i will post a idea here, to a get a work around

photo
2

Here if a simple php script to trigger your virtual sensor


usage


1 - to set virtual sensor to ON:


http://the_script_location/virtual_sensor_enable.php?sensor_status=on


or


http://the_script_location/virtual_sensor_enable.php (with no param it's send "on" status)


1 - to set virtual sensor to OFF:


http://your_script_location/virtual_sensor_enable.php?sensor_status=off


  1. <?php
  2. /*******************************************************************************
  3. * Script name: virtual_sensor_enable.php
  4. * Auteur: Sébastien Albrech
  5. * Version: v 1.00
  6. * Date: 03/06/2013
  7. * Description: change a zipabox virtual sensor state (on/off)
  8. * Copyright (c) 2013 InDeepLight Sarl
  9. * Parameters: sensor_status (optional) value "on" or "off"
  10. ******************************************************************************/
  11. // Settings
  12. // Zipabox virtual sensor Activate URL
  13. $activate_URL = "paste here your virtual sensor Activate URL";
  14. // Zipabox virtual sensor Desactivate URL
  15. $desactivate_URL = "paste here your virtual sensor Desactivate URL";
  16. // Main actions
  17. if ($_GET['sensor_status']) {

  18. if ($_GET['sensor_status'] == "on") {

  19. header('Location: ' . $activate_URL);

  20. } else {

  21. header('Location: ' . $desactivate_URL);

  22. }
  23. } else {

  24. header('Location: ' . $activate_URL);
  25. }
  26. ?>

photo
1

OK guys i just tested with the above scrip but same issuses :-(


I get mail, i get photo in alarm folder, but the virtual sensor didn't work.


i confirm i didn't use short ARL but directly my script URL.


I test from a production server (where alla my e-shop and Wordpress are) and from my local web server, no way :-(

photo
1

This script will work only if you open activation URL (http://the_script_location/virtual_sensor_enable.php?sensor_status=on) in browser, because expression

  1. header('Location: ' . $activate_URL);

browser will redirect you to that URL and activate URL will be called (camera is not able to do that).


If you want it to work from camera then simply replace that line with

  1. file_get_contents($activate_URL);

that way the server will call original virtual sensor URL.

photo
1

IT WORKS, thanks a lot Nenad.


so here is the working script:


  1. <?php
  2. /*******************************************************************************
  3. * Script name: virtual_sensor_enable.php
  4. * Auteur: Sébastien Albrech
  5. * Version: v 1.00
  6. * Date: 03/06/2013
  7. * Description: change a zipabox virtual sensor state (on/off)
  8. * Copyright (c) 2013 InDeepLight Sarl
  9. * Parameters: sensor_status (optional) value "on" or "off"
  10. ******************************************************************************/
  11. // Settings
  12. // Zipabox virtual sensor Activate URL
  13. $activate_URL = "paste here your virtual sensor Activate URL";
  14. // Zipabox virtual sensor Desactivate URL
  15. $desactivate_URL = "paste here your virtual sensor Desactivate URL";
  16. // Main actions
  17. if ($_GET['sensor_status']) {

  18. if ($_GET['sensor_status'] == "on") {

  19. file_get_contents($activate_URL);

  20. } else {

  21. file_get_contents($desactivate_URL);

  22. }
  23. } else {

  24. file_get_contents($activate_URL);
  25. }
  26. ?>

photo
1

Great! Any recomendation of webserver that can be used? I normally use dropbox public folder but i gess it wouldnt work to call php scrips. Or alt. add synkee.com. Other pruposals?

photo
1

Lovely! It works for me too!


I now got the following set-up:

- Foscam 8910w camera

- Content server Dropbox

- Webserver Synkee (using Dropbox)

- Php script uploaded to Dropbox

- Synkee URL calling php uploaded to the ip camera config

- Rule created to trigger http request to pushing box for notification upon motion.

photo
1

here is a tuto (in french) explainign how to host pph script in a raspberry:


http://maison-de-geek.com/2013/06/tuto-heberger-les-scripts-php-sur-son-raspberry/

photo
1

Kristian Olofsson wrote:

Lovely! It works for me too!


I now got the following set-up:


I'd like to get my Foscam 8910W's to work with AutoRemote/Tasker automation but the camera won't accept the massive number of chars in the url I push through set_alarm.cgi. Could you please explain your solution like I'm a five-year old?

photo
1

I created a account in "http://www.alwaysdata.com" to create a web page (free), then I just uploaded (through ftp) a file named index.php in the directory www. (I deleted the original index.html)

In file index.php I put the script, or simply this:

<?php

$activate_URL = "https://my.zipato....=TRUE";

file_get_contents($activate_URL);

?>

Then, I put in my Foscam camera, the url of the new web (http://xxxx.alwaysdata.net/) where xxxx is my created account.


It works fine!!


(But zipato should do more easy that a ip camera could trigger something when a photo was uptoaded, or simply do shorter the url of sensor activation.)

Leave a Comment
 
Attach a file