Axis M7014 feedback

Forum to ask for any help
Post Reply
ChrisB75
Posts: 52
Joined: Sun Feb 17, 2013 1:11 pm

Axis M7014 feedback

Post by ChrisB75 » Mon Nov 04, 2013 4:34 pm

Hi, I'm hoping someone can help me with this as its driving me potty! :? Basically, as with the example on the forum using an Aviosys 9100, I use an axis M7014 connected to my sky box and pull images from it that are displayed. I've been trying to find a way for Demopad to know the current power status of the sky box. Because sky won'rt release API and I can't find how to do this using IP commands to the sky box (which I know it does because the most recent update of the box and sky+ app pulls data from the sky box including power status), I had a brainwave that I could poll the axis to see whether it is receiving video on the input the sky box is connected to and sure enough, there is a command that can be sent - http://<axisusername>:<axispassword>@<axisipaddress>/axis-cgi/videostatus.cgi?status=1 This is sent as <send data to a website> on page load. The response is Video 1 = video or Video 1 = no video and I know this works because this is displayed when I put http://<axisusername>:<axispassword>@<axisipaddress>/axis-cgi/videostatus.cgi?status=1 directly into a browser. I thought it would be straight forwards to set up a 2-way feedback matching <feedback matches specific data> with the date as Video 1 = video and then having to actions to set SkyPowerOn to ON and SkyPowerOff to OFF and the associated image is turned on. Equally, I had data as Video 1 = no video and then having to actions to set SkyPowerOn to OFF and SkyPowerOff to ON and the associated image is turned on. But it doesn't work :cry:
I've tried various device response terminators including \xOD, >, \r, \r\n etc etc and I can't get my head around regex.
Any help would really be appreciated :)
Thanks, Chris

User avatar
DemoPad
Site Admin
Posts: 770
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: Axis M7014 feedback

Post by DemoPad » Mon Nov 04, 2013 4:44 pm

The first thing is to be sure exactly what data comes back from the camera server - issue the HTTP GET request via Hercules & see the data (including the hex characters) that comes back. Common response terminators for html / xml data are \x0D, \x0A or worst case >

ChrisB75
Posts: 52
Joined: Sun Feb 17, 2013 1:11 pm

Re: Axis M7014 feedback

Post by ChrisB75 » Mon Nov 04, 2013 4:55 pm

Quick reply as usual :D I had tried using Hercules but had problems because I didn't seem to get the format right with what is sent. For example, I just tried;

Connecting to 192.168.0.xx ...
Connected to 192.168.0.xx
POST/axis-cgi/videostatus.cgi?status=1HTTP/1.0 501 Not Implemented
Date: Mon, 04 Nov 2013 15:50:39 GMT
Accept-Ranges: bytes
Connection: close
Content-Type: text/html; charset=ISO-8859-1

<HTML><HEAD><TITLE>501 Not Implemented</TITLE></HEAD>
<BODY><H1>501 Not Implemented</H1>
POST to non-script is not supported in Boa.
</BODY></HTML>
Connection closed
Connecting to 192.168.0.xx ...
Connected to 192.168.0.xx
POSTaxis-cgi/videostatus.cgi?status=1HTTP/1.0 501 Not Implemented
Date: Mon, 04 Nov 2013 15:50:52 GMT
Accept-Ranges: bytes
Connection: close
Content-Type: text/html; charset=ISO-8859-1

<HTML><HEAD><TITLE>501 Not Implemented</TITLE></HEAD>
<BODY><H1>501 Not Implemented</H1>
POST to non-script is not supported in Boa.
</BODY></HTML>
Connection closed
Connecting to 192.168.0.xx ...
Connected to 192.168.0.xx
GETaxis-cgi/videostatus.cgi?status=1HTTP/1.0 501 Not Implemented
Date: Mon, 04 Nov 2013 15:51:05 GMT
Accept-Ranges: bytes
Connection: close
Content-Type: text/html; charset=ISO-8859-1

<HTML><HEAD><TITLE>501 Not Implemented</TITLE></HEAD>
<BODY><H1>501 Not Implemented</H1>
POST to non-script is not supported in Boa.
</BODY></HTML>
Connection closed
Connecting to 192.168.0.xx ...
Connected to 192.168.0.xx
GETvideostatus.cgi?status=1HTTP/1.0 501 Not Implemented
Date: Mon, 04 Nov 2013 15:51:17 GMT
Accept-Ranges: bytes
Connection: close
Content-Type: text/html; charset=ISO-8859-1

<HTML><HEAD><TITLE>501 Not Implemented</TITLE></HEAD>
<BODY><H1>501 Not Implemented</H1>
POST to non-script is not supported in Boa.
</BODY></HTML>
Connection closed
Connecting to 192.168.0.xx ...
Connected to 192.168.0.xx
POSTvideostatus.cgi?status=1HTTP/1.0 501 Not Implemented
Date: Mon, 04 Nov 2013 15:51:29 GMT
Accept-Ranges: bytes
Connection: close
Content-Type: text/html; charset=ISO-8859-1

<HTML><HEAD><TITLE>501 Not Implemented</TITLE></HEAD>
<BODY><H1>501 Not Implemented</H1>
POST to non-script is not supported in Boa.
</BODY></HTML>
Connection closed

:? :?

User avatar
DemoPad
Site Admin
Posts: 770
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: Axis M7014 feedback

Post by DemoPad » Mon Nov 04, 2013 5:09 pm

You can try & get this working via [email protected] - the GET request would seem to be the way to go, but problems are probably being caused by the username/password. Here is a sample GET command for a similar device that requires very basic username/password authentication:

GET /Set.cmd?CMD=SetPower+P60=1 HTTP /1.0\x0D\x0AAuthorization: Basic YWRtaW46MTIzNDU2Nzg=\x0D\x0A\x0D\x0A

where the username/password is simply Base64 encoded

ChrisB75
Posts: 52
Joined: Sun Feb 17, 2013 1:11 pm

Re: Axis M7014 feedback

Post by ChrisB75 » Mon Nov 04, 2013 9:34 pm

Thanks, I've emailed support.
I've just managed to successfully send a GET request via Hercules;

Connecting to 192.168.0.xx ...
Connected to 192.168.0.xx
GET /axis-cgi/videostatus.cgi?status=1 HTTP/1.1\x0D\x0AHTTP/1.1 200 OK
Date: Mon, 04 Nov 2013 20:28:24 GMT
Accept-Ranges: bytes
Connection: close
Cache-Control: no-cache
Pragma: no-cache
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Content-Type: text/plain

Video 1 = video
Connection closed

So there doesn't seem to be anything in the response apart from Video 1 = video, or do I have to include Content-Type etc?
Cheers
Chris

ChrisB75
Posts: 52
Joined: Sun Feb 17, 2013 1:11 pm

Re: Axis M7014 feedback

Post by ChrisB75 » Tue Nov 05, 2013 12:17 pm

Hi
Sussed it! :D I hadn't put the "\" in the response terminator, d'Oh!, so it works with \x0A as the response terminator and including it at the end of the data; Video 1 = video\x0A and Video 1 = no video\x0A :D :)
Works well and means I now have feedback for sky box power status, yay.
Thanks again for your help.
Cheers
Chris

Post Reply