Page 1 of 2
Sky HD Box Test
Posted: Wednesday 03 February 2016 23:08
by sijones
Hi,
As it seems some people would like Sky support am having a look at it - am not promising anything as i don't own a sky box, am researching and trialing things.
So can someone try this command on a linux box - make sure you have netcat installed
echo '4100002240' | nc -w 1 SkyIPAddress 49160
and let me know the result.
Re: Sky HD Box Test
Posted: Wednesday 03 February 2016 23:41
by Westcott
I got this -
nc: getaddrinfo: Name or service not known
Re: Sky HD Box Test
Posted: Thursday 04 February 2016 9:01
by suridge
First post here, hope this is helpful...
Code: Select all
$ echo '4100002240' | nc -w 1 192.168.0.2 49160
SKY 000.001
$ nc -w 1 192.168.0.2 49160
SKY 000.001
Re: Sky HD Box Test
Posted: Thursday 04 February 2016 10:26
by sijones
Westcott wrote:I got this -
nc: getaddrinfo: Name or service not known
Apologies, I should have said you need to change SkyIPAddress to the IP address of the box.
Re: Sky HD Box Test
Posted: Thursday 04 February 2016 10:27
by sijones
suridge wrote:First post here, hope this is helpful...
Code: Select all
$ echo '4100002240' | nc -w 1 192.168.0.2 49160
SKY 000.001
$ nc -w 1 192.168.0.2 49160
SKY 000.001
Did the box respond / do anything, that command should be the power toggle, so switch to standby and out of standby?
Re: Sky HD Box Test
Posted: Thursday 04 February 2016 11:06
by blackdog65
I get this
Code: Select all
$ echo '4100002240' | nc -w 1 192.168.1.75 49160
SKY 000.001
I tried with the sky box on and on standby, but nothing happened. Hope that still helps in some way.
Good luck

Re: Sky HD Box Test
Posted: Thursday 04 February 2016 11:07
by C4rtm4N
Tried on 2 Sky boxes with both the old & the current EPG & they return the same as Suridge, neither coming out of standby.
Reply is identical whether the box is on or if it's off.
Re: Sky HD Box Test
Posted: Thursday 04 February 2016 11:36
by Westcott
No - my fault for not putting my IP addr in
Now I get standby and on -
SKY 000.001
As Blackdog65 reported, nothing changed on the box itself.
Attempting to ping the box, the ping command hangs (yes, really!)
Added the box's IP to Domoticz to the 'System alive checker', it does not change status
Re: Sky HD Box Test
Posted: Thursday 04 February 2016 13:01
by sijones
Cheers for testing, I'll have a another look and come back to you.
Re: Sky HD Box Test
Posted: Thursday 04 February 2016 21:37
by sijones
ok, little update.
I have the way to toggle the box power, i need to put it in to domoticz but it's not going to be quite a straightforward implementation as it needs 2 different ways of talking to the box, one for power and the other to test the status for if the box is on or off.
So I will leave this open to you who want this, either i need someone to forward ports on their router so i can test against it - this can be locked to only allow my static ip's so shouldn't be too risky.
or someone with a spare box or you club together to buy a cheap second hand one sent to me and i'll put something together on that.
Note that I can't promise a date of completion, i do this in my spare time and that varies week to week.
Let me know what you think.
Re: Sky HD Box Test
Posted: Sunday 07 February 2016 23:49
by C4rtm4N
As discussed I can open ports temporarily but I'm away on business for most of the next 3 weeks so it needs to wait until after then. Hopefully one of the others who are interested in this can help before then.
How are you thinking about detecting whether it's on?
Re: Sky HD Box Test
Posted: Monday 08 February 2016 0:02
by sijones
There's a function call over dnla interface that may give away that the box is on - yet to test.
Although to be honest by the lack of response I may not do this as it's not seemly wanted!
Re: Sky HD Box Test
Posted: Monday 08 February 2016 0:05
by sijones
Here's a linux app that will toggle the box power:
Code: Select all
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <arpa/inet.h>
int main(int argc, char *argv[])
{
int sockfd = 0,nin = 0,nout = 0,l = 12;
char recvBuff[32];
char sendBuff[9] = {4,1,0,0,0,0,224,0};
struct sockaddr_in serv_addr;
if(argc < 2)
{
printf("\n Usage %s Sky box IP address\n", argv[0]);
return 0;
}
memset(recvBuff, '0' ,sizeof(recvBuff));
if((sockfd = socket(AF_INET, SOCK_STREAM, 0))< 0)
{
printf("\n Error : Could not create socket \n");
return 1;
}
serv_addr.sin_family = AF_INET;
serv_addr.sin_port = htons(49160);
serv_addr.sin_addr.s_addr = inet_addr(argv[1]);
if(connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr))<0)
{
printf("\n Error : Connect Failed \n");
return 1;
}
while (1)
{
nin = read(sockfd, recvBuff, 31);
if( nin < 0)
{
printf("\n Read Error \n");
}
if (nin < 24)
{
nout = write(sockfd, recvBuff, l);
if( nout < 0)
{
printf("\n Write Error \n");
}
l = 1;
}
else
{
nout = write(sockfd, sendBuff, 8);
if( nout < 0)
{
printf("\n Write Error \n");
}
sendBuff[1] = 0;
nout = write(sockfd, sendBuff, 8);
if( nout < 0)
{
printf("\n Write Error \n");
}
close(sockfd);
return 0;
}
}
}
Re: Sky HD Box Test
Posted: Monday 08 February 2016 9:18
by blackdog65
sijones wrote:Although to be honest by the lack of response I may not do this as it's not seemly wanted!
I happy to help (been busy with my E3Q Max! Heating Control), but I'm not sure what you want to achieve.
Obviously an off command has uses (though mine has an auto sleep function) but what else is possible?
Sean
Re: Sky HD Box Test
Posted: Monday 08 February 2016 9:23
by C4rtm4N
Blackdog, is 'on' not the aim as if people have it connected to a supported TV via HDMI it will turn the TV on. Live pause on a doorbell ringing is also lee's aim.
Re: Sky HD Box Test
Posted: Monday 08 February 2016 9:31
by C4rtm4N
Thanks for the code @sijones - I will try it later if I have time before I leave
Re: Sky HD Box Test
Posted: Monday 08 February 2016 9:39
by Marci
Use app above to toggle power, use any of the current Node-based libraries to provide a http api for the rest...?
The notable two are...
https://github.com/dalhundal/sky-plus-h ... plus-hd.js
https://github.com/mwrf/skyplus.js
The former, if memory serves provides a box-status request also.
Should simplify a pause script down to triggering a switch in domoticz which fires the relevant http request over to localhost:5555 or similar.
Re: Sky HD Box Test
Posted: Monday 08 February 2016 10:11
by blackdog65
C4rtm4N wrote: Live pause on a doorbell ringing is also lee's aim.
Yup, sounds useful. If the communication is two-way then lighting control (like kodi) would be super sexy!
Re: Sky HD Box Test
Posted: Monday 08 February 2016 12:30
by C4rtm4N
Many thanks @sijones - code is working well
@Marci - I never could get dalhundal's code to work although it looks as though he does now have a more simple remote app available that can't get the sky box's state
Re: Sky HD Box Test
Posted: Tuesday 09 February 2016 23:04
by sijones
C4rtm4N wrote:Many thanks @sijones - code is working well

Code was in the public domain so no need to thank me, was pointed to me by Dal, the developer of the NodeJS stuff.
Possibly if enough people want the functions I'll integrate something but have had to look at something else at the minute that we need more importantly.
Cheers sijones