Sky HD Box Test

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

sijones
Posts: 70
Joined: Wednesday 15 October 2014 14:16
Target OS: Linux
Domoticz version: Git
Location: UK
Contact:

Sky HD Box Test

Post 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.
User avatar
Westcott
Posts: 423
Joined: Tuesday 09 December 2014 17:04
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: UK - Glos
Contact:

Re: Sky HD Box Test

Post by Westcott »

I got this -

nc: getaddrinfo: Name or service not known
Zwave - Sigma Z+ stick, Fibaro, Horstmann, Neo Coolcam, EUROtronic
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
suridge
Posts: 1
Joined: Thursday 04 February 2016 8:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Sky HD Box Test

Post 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
sijones
Posts: 70
Joined: Wednesday 15 October 2014 14:16
Target OS: Linux
Domoticz version: Git
Location: UK
Contact:

Re: Sky HD Box Test

Post 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.
sijones
Posts: 70
Joined: Wednesday 15 October 2014 14:16
Target OS: Linux
Domoticz version: Git
Location: UK
Contact:

Re: Sky HD Box Test

Post 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?
User avatar
blackdog65
Posts: 311
Joined: Tuesday 17 June 2014 18:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Norfolk, UK
Contact:

Re: Sky HD Box Test

Post 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 :D
CubieTruck Master
RasPi slaves
Aeon Labs Z-Stick, multi sensor
Fibaro Dimmers, relays, Universal sensors
EQ3 MAX!
TKB Sockets
RFXCOM
LightwaveRF sockets, switches, relays, doorbell
MySensors
ESPEasy ESP8266-12E
User avatar
C4rtm4N
Posts: 53
Joined: Saturday 07 February 2015 21:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: UK
Contact:

Re: Sky HD Box Test

Post 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.
User avatar
Westcott
Posts: 423
Joined: Tuesday 09 December 2014 17:04
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: UK - Glos
Contact:

Re: Sky HD Box Test

Post by Westcott »

No - my fault for not putting my IP addr in :oops:

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
Zwave - Sigma Z+ stick, Fibaro, Horstmann, Neo Coolcam, EUROtronic
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
sijones
Posts: 70
Joined: Wednesday 15 October 2014 14:16
Target OS: Linux
Domoticz version: Git
Location: UK
Contact:

Re: Sky HD Box Test

Post by sijones »

Cheers for testing, I'll have a another look and come back to you.
sijones
Posts: 70
Joined: Wednesday 15 October 2014 14:16
Target OS: Linux
Domoticz version: Git
Location: UK
Contact:

Re: Sky HD Box Test

Post 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.
User avatar
C4rtm4N
Posts: 53
Joined: Saturday 07 February 2015 21:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: UK
Contact:

Re: Sky HD Box Test

Post 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?
sijones
Posts: 70
Joined: Wednesday 15 October 2014 14:16
Target OS: Linux
Domoticz version: Git
Location: UK
Contact:

Re: Sky HD Box Test

Post 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!
sijones
Posts: 70
Joined: Wednesday 15 October 2014 14:16
Target OS: Linux
Domoticz version: Git
Location: UK
Contact:

Re: Sky HD Box Test

Post 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;
    }
  }
}
User avatar
blackdog65
Posts: 311
Joined: Tuesday 17 June 2014 18:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Norfolk, UK
Contact:

Re: Sky HD Box Test

Post 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
CubieTruck Master
RasPi slaves
Aeon Labs Z-Stick, multi sensor
Fibaro Dimmers, relays, Universal sensors
EQ3 MAX!
TKB Sockets
RFXCOM
LightwaveRF sockets, switches, relays, doorbell
MySensors
ESPEasy ESP8266-12E
User avatar
C4rtm4N
Posts: 53
Joined: Saturday 07 February 2015 21:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: UK
Contact:

Re: Sky HD Box Test

Post 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.
User avatar
C4rtm4N
Posts: 53
Joined: Saturday 07 February 2015 21:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: UK
Contact:

Re: Sky HD Box Test

Post by C4rtm4N »

Thanks for the code @sijones - I will try it later if I have time before I leave
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: Sky HD Box Test

Post 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.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
User avatar
blackdog65
Posts: 311
Joined: Tuesday 17 June 2014 18:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Norfolk, UK
Contact:

Re: Sky HD Box Test

Post 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!
CubieTruck Master
RasPi slaves
Aeon Labs Z-Stick, multi sensor
Fibaro Dimmers, relays, Universal sensors
EQ3 MAX!
TKB Sockets
RFXCOM
LightwaveRF sockets, switches, relays, doorbell
MySensors
ESPEasy ESP8266-12E
User avatar
C4rtm4N
Posts: 53
Joined: Saturday 07 February 2015 21:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: UK
Contact:

Re: Sky HD Box Test

Post 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
sijones
Posts: 70
Joined: Wednesday 15 October 2014 14:16
Target OS: Linux
Domoticz version: Git
Location: UK
Contact:

Re: Sky HD Box Test

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest