[driver] SMT C7400 / SMT C7401 / Ziggo Mediabox XL

UPDATE: 17/02/2019

Implemented 2 features of the new SDK version (0.53.8) and 4 new buttons of the remote (which can be found on the back)

  • registerFavoriteHandlers()
    This allows a device that supports favorites (only TV, DVB or TUNER) to implement a custom handler, for example for channel "42", rather than 2 buttonHandler calls for "4" and "2", a single call with "42" will be made to the favoriteHandler.
    After the favorite is chosen, the favorite is sent to the Mediabox, including an ENTER key. This speeds up channel hopping considerably.
  • setDriverVersion(version)
    Setting the version allows you to tell the Brain about changes to your devices components. If you for example add new buttons to a device, you can increase the version and this will let the Brain know to fetch the new components (NOTE: the Brain will only add new components, updating or removing old components is not supported).
    This was needed for registering the favorites handler and the new color buttons support.
  • .addButtonGroup('Color Buttons')
    Implemenents the 4 colored buttons on the back of the remote. Since no other implementation on the web for the Ziggo Horizon box has this, i am not sure if anybody IS going to use these. This means; if they screw up the interface to much i might even remove them in a future update.

UPDATE: 14/02/2019

I've restructured my code to move to the neeo-cli way of running this driver; more information and the new code can be found on GitHub. It looks like it 'works on my machine'.

Next step is trying to see if i can emulate the keyboard on the back, but i can't promise anything there. Basically i have already implemented all keys which can be found on various forums and implementing other keys is guesswork. I did find the codes for the color buttons green/red/blue/yellow on the back of the remote, so it does seem that more keys CAN be sent which no other implementation (Homey/OpenHAB/Domoticz) currently supports.

Original post:

The Dutch television provider Ziggo issues a so called 'Mediabox XL'. At the time of writing, this is either an SMT C7400 or an SMT C7401. Both devices don't have a discrete power on and power off command making them 'dumb devices' for Neeo.

Note: I have been mixed feelings with how Neeo handles dumb devices. Personally i think the current way how this is implemented means the remote is unusable for our partners and (small) kids, especially if they are non-native English like mine. I really hope Neeo will take the feedback of all beta testers and current active users into consideration and change/prioritize this.

With that said, i'll now focus in this topic on trying to make the Ziggo Mediabox XL 'smart', since that is something Neeo wants us to do, and which they have provided the Neeo SDK for. More information on the SDK and other drivers being developed, can be found here.

I've investigated online and came across some reading material which should make it possible to create my own 'driver', including discrete power handling so the device is no longer seen as a dumb device and basically solve 'my' problems for now.

Reading material used:

Basically i will be combining the best of the above in creating the Neeo driver.

Reply
79replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Besides a digital recorder, the Ziggo Mediabox XL is also a fully featured media player. Do you use the Ziggo Mediabox XL for television only and have a separate modem for the internet? Then you need to follow step 1 and step 2. Do you use your Ziggo Mediabox XL for both television and internet? Then you can get start at step step 2. In order for this driver to work, you would need to make sure both steps are completed.

    Step 1. Connect to your home network (Dutch instructions).

    Your Ziggo Mediabox XL should be connected to your home network. I would advise to connect with a network cable, but connection using WiFi follows almost the same steps outlined below. It is pretty self-explanatory.

    1. Press Menu on the Ziggo Mediabox XL remote.
    2. Select Opties.
    3. Select Mijn Thuisnetwerk and press OK.
    4. Select Instellen Thuisnetwerk and press OK.
    5. Select Op het modem and press OK.
    6. Connect the Ziggo Mediabox XL with a network cable to your modem.
    7. Select Netwerkkabel and press OK.
    8. The Ziggo Mediabox XL has to reboot now.

    2. Make sure you are sharing your media library (Dutch instructions).

    Now that your box is connected to your home network, you need to enable the embedded XBMC client inside the Ziggo Mediabox XL. This is an essential part for the driver, since XBMC is only running when your box is on, thus we can check to see if XBMC is reachable, meaning your box is on.

    1. Press Menu on the Ziggo Mediabox XL remote.
    2. Select Opties
    3. Select Mijn Thuisnetwerk and press OK.
    4. Select Instellen Thuisnetwerk and press OK.
    5. Select Ja and press OK
    6. Accept the Algemene voorwaarden
    7. The media library can be found through Mijn Media in the main menu of your Ziggo Mediabox XL.

    The Ziggo Mediabox XL is now going to index your personal media, but only if it is exposed on your home network via DLNA. This may take a while depending on the amount of files. If you don't have any DLNA servers that is ok, we just need this XBMC server to 'be online'.

    Reply Like
  • Assuming you have connected your Ziggo Mediabox XL  to your home network, figure out the IP of the box and preferably use DHCP on your router to give it a static DHCP address.

    Open a web-browser, type in the IP address and hit enter.

    A login page should appear (if not, tripple check Mijn Thuisnetwerk settings and try again).

    Login with admin/admin (yes.. very secure indeed).

    Click on Basis, followed by Thuisnetwerk. You should see a page like this. You can verify here that your horizon is connected to your home network.

    Then click Local Area Network where you can see your IP, the main MAC address of the Ziggo Mediabox XL and the DHCP-poolsize that the Ziggo Mediabox XL has claimed from your router (yes.. 19 IP addresses)

    In my particular case, i was interested in the last IP address, 192.168.1.143, this is hosting the media server when the box is powered on. You can figure this out by looking at the MAC address of your Mediabox XL (blurred in above pics) and see which other IP has almost the same MAC address in your router reservation table. In my case, only the last 2 digits of the MAC address where different. But that will be used later.

    Turn off the WiFi networks

    By default, the Ziggo Mediabox XL exposes 2 WiFi networks, one on 5 GHz and one on 2.4 GHz. Since i have my own router with 4 WiFi networks already (private/guest, both on 2.4 GHz and 5 GHz) AND i don't want other people to piggy back on my bandwidth, i have chosen to disable the WiFi networks on the Ziggo Mediabox XL.

    According to a different site, you should start with disabling the 5 GHz network. So first click Draadloos, followed by 5 GHz and then Radio. Change the dropdown to Uitgeschakeld and press Opslaan.

     Then follow the same steps for the 2.4 GHz network, like shown below.

     That should be it!

    Reply Like
  • Repository made and initial content of this topic added to the repository: https://github.com/Webunity/ziggo-horizon

    Reply Like 1
  • Great work!

    Reply Like
  • Nice work, and very good instructions 👍

    Reply Like 1
  • Another day, and a few hours in on the project...

    One of the big challenges is, that the Ziggo Mediabox XL gets a dynamic IP from your router (in case you have your own separate router). Even if you configure your router to assign a static IP address, based on the MAC address of the Mediabox XL, it will not get that IP.

    The first IP mentioned in the screenshots above is that of the 'main' client which is also hosting the management interface. This client reserves IPs from your router and hands out those IPs to other services inside the box, like the Mediabox XL itself. This way, the Mediabox XL never asks for an IP on your router (e.g. the IP we would need), since it already got one from the 'main' client. I've banged my head into the wall several times before i found this out.

    So how do you get your Mediabox IP then?

    Turn on your Ziggo Mediabox XL and press the following options on the remote:
    Menu

    • Opties, followed by OK.
    • Mijn Thuisnetwerk, followed by OK.
    • Status Thuisnetwerk (LAN), followed by OK.

    Isn't there an easier other way to get a fixed IP?

    In the end, i've set my mediabox to a static IP (which is possible by following these Dutch instructions) to prevent the box from claiming IP in my neatly organised static IP table. It is a pain in the ass to setup, since you need to connect a network cable between your mediabox and your PC etc. etc. steps i am not going to repeat here, just Google translate the Dutch instructions.

    Long story short; my horizon now has a fixed IP of 192.168.1.115 (which is the main client), i've disabled the DHCP server, decreased the DHCP-poolsize to 5, set the DHCP-lease to 86400 seconds (which is a day) and changed the DNS servers on the mediabox to Google's (8.8.8.8 and 8.8.4.4). The local addresses it claims start at 192.168.1.250 which is the IP i need. So in my case, it is 192.168.1.250 which i would need.

    All is not lost, since I've come to save the day!

    After I've set this up, I knew this wasn't going to work for the most of you guys, so i decided to look further. Then i saw that, when my Mediabox was on, it advertised itself in Windows Explorer so it had to do some sort of DLNA broadcast.

    I am proud to announce that I have found a way to do a 'auto-mediabox-ip-detection' using the Simple Service Discovery Protocol (SSDP) which no other Ziggo Driver mentioned above currently has implemented.

    It works if the mediabox is on and with the mediabox turned off, it constantly finds out the right IP. So contrary to the drivers above, my driver has zero manual configuration and works even if your media box gets a different IP on your network (I am 99% certain :-p).

    I am not going to revert my static IP changes for now, since i really like the changes I've done (e.g. the 192.168.1.250 address) so now i can continue hacking! When the driver is finished, i will revert to see if my script is dummy proof.

    Reply Like 1
  • First version is online! https://github.com/Webunity/ziggo-horizon

    Open points / TODO:

    • Auto-reconnect to box once the connection drops
    • Auto-reconnect once the IP of the box changes
    •  
    Reply Like 1
  • Just received my NEEO today! First thing I did was looking for Horizon driver and found this page. Awesome project! The only thing... I am not that technical. So before spending hours on diving into the SDK and so on; is there an easy way to get this driver on my NEEO? Any help would be appreciated :) I have the SMT G7401. 

    Reply Like
    • Update: Got it working! Actually learned quite a lot this evening :D. Unfortunately, Horizon / Ziggo support and functionality is totally crap. I don't have the Horizon connected via LAN, because I can't (only COAX at the spot where the horizon is placed.) And homenetwork setup doesn't work over WIFI due to a bug which is already there for nearly a year :-( 

      I guess there are other ways to make this device smart right? (Since the remote is working via RF)

      Reply Like 1
    • Kephas Busink you can try to find any iR command that turns on the horizon box (other than power toggle). If you found one or more iR command that turn on the box then let it know, the driver team can then make it smart.

      Reply Like
    • Niels de Klerk and Kephas Busink i've been there and done that (e.g. search the internet for known implementations), there is no current (known) IR command to turn it on, just a power toggle.

      Reply Like
  • How do I actually install the driver in the NEEO app? I can do the preparatory steps on the Ziggo box but its unclear to me how this driver itself is taken into use.

    Reply Like
    • Jorgen Behrens Currently the dirvers can't be loaded directly into the brains. It is neccessary to start a node.js v6 server on a raspberryPi or similar. Then you are able to run the code on the Pi and integrate the device into the brain. A Solution for this will come.

      Reply Like
    • Jorgen Behrens Just like Markus Mahr mentioned, you need to be able to 'host' the code somewhere on your network. This can be a NAS, raspberry pi or equivalent which should be on 24/7 and capable of running NodeJS.

      Reply Like
  • I've managed to install Node.js v9.0.0 on a Raspberry Pi. How can I install the ziggo-horizon package on it? Sorry for my ignorance...

    Reply Like
    • Jorgen Behrens no worries, you are just 'the first' to ask :)

      This reply contains important information, for the followers of this thread, right at the end.

      Initial setup:

      The Pi should be connected to the same network, I don't know (haven't tested) if you can use any combination of LAN v.s. wifi, e.g.

      • Box (WiFi) - Pi (LAN)
      • Box (LAN) - Pi (WiFi)
      • I am assuming it should work, but best results are when both the box and Pi are wired (LAN)

      Login to your Raspberry Pi (as user Pi, root is not needed yet) and go to any directory where you would like to install the ziggo-horizon module. I have installed mine in /opt; so here are the commands.

      cd /opt

      If you have wget installed:

      wget --no-check-certificate https://github.com/Webunity/ziggo-horizon/archive/master.tar.gz -O - | tar -xz

      (or) if you have curl installed:

      curl --insecure -L https://github.com/Webunity/ziggo-horizon/archive/master.tar.gz | tar -xz

      This would create a directory called 'ziggo-horizon'.

      cd ziggo-horizon
      npm install

      and you should be able to run it with:

      node ./index.js

      Have it run automagically at boot:

      If this works and you would like to have this run on boot automagically, you do this:

      sudo nano /etc/systemd/system/ziggo-horizon.service

      Paste the following contents in that file

      [Unit]
      Description=This service runs the Ziggo Horizon service
      After=network.target
      
      [Service]
      ExecStart=/bin/bash /opt/scripts/se-nat.sh
      ExecReload=/bin/kill -HUP $MAINPID
      KillMode=control-group
      Restart=always
      
      [Install]
      WantedBy=multi-user.target

      p.s. if you are NOT running Raspbian, then KillMode should be set to 'KillMode=process'.

      Then to enable and start the service, do this:

      sudo systemctl enable ziggo-horizon
      sudo systemctl start ziggo-horizon

      A reboot should also restart the ziggo-horizon service, after network comes up and it should automatically restart the controller once the driver crashes.

      There are currently 2 limitations to this script which i will probably fix when i have time:

      1. If your Ziggo Horizon Box is not online while starting the main script, it will try to search for 15 seconds and then exit the driver. This one is solved by the "Restart=Always" directive in the service, since that now just restarts the service. A nicer method should be implemented in the code, in order to remove the dependency on "systemctl".
      2. If your Ziggo Horizon Box reboots, or looses power, i am assuming that the driver will stop functioning. There is no fail safe yet built in for this.

      My current ideas are that the controller should in fact inherit from the eventemitter and let the controller signal the main index.js when it is 'disconnected', so the new discovery process can start again.

      Reply Like
  • Thanks a lot ! In Switzerland we have the same boxes under the brand UPC Cablecom horizon and your driver almost works at 100% :-) I need to debug a bit but you are saving me 99% of the work ! Thanks again !

    Reply Like 1
  • Gilles, I executed all of the steps you suggest and initially it 'found' the Mediabox at the IP address of my NAS. After I switched off DNLA on the NAS it found the actual Horizon box. I did work even with the wrong IP address but would crash on connection errors to the NAS.

    I cant get it to start on boot though. I use the latest Raspbian on a Pi 2

    Reply Like
  • Actually, strike that. It keeps crashing on ‘host unreachable’ after which it does find the NAS again on restart. When that happens the driver doesn’t work. How can I set a static IP address for the Horizon box in the driver?

    Reply Like
  • Replace index.js content with below . REPLACE on line 28 with the ip of your box since here I hardcoded mine to test !

     

    'use strict';

    const Promise = require("bluebird");
    const Ssdp = require('node-ssdp-lite');
    const neeoapi = require('neeo-sdk');
    const controller = require('./controller');

    //----------------------------------------------------------------------------------------------------
    // Start script
    //----------------------------------------------------------------------------------------------------

    console.log('---------------------------------------------');
    console.log(' Ziggo Horizon Mediabox adapter');
    console.log('---------------------------------------------');

    // Search for mediabox on local network
    var mediabox;


    console.log(' - Searching for NEEO Brain (max 15 sec.)');
    neeoapi.discoverOneBrain().then((brain) => {
        console.log('   - FOUND! -> ', brain.name);
        clearTimeout(15000);

                // initiate Mediabox object
        mediabox = new controller('192.168.6.186');

                // Set the device info, used to identify it on the Brain
        const neeoDevice = neeoapi.buildDevice('Mediabox XL')
                    .setManufacturer('Ziggo')
                    .addAdditionalSearchToken('horizon')
                    .setType('DVB')
                    .addButtonGroup('POWER')
                    .addButtonGroup('Menu and Back')
                    .addButtonGroup('Controlpad')
                    .addButtonGroup('Channel Zapper')
                    .addButtonGroup('Numpad')
                    .addButtonGroup('Transport')
                    .addButtonGroup('Transport Search')
                    .addButtonGroup('Record')
                    .addButton({ name: 'GUIDE', label: 'TV Gids' })
                    .addButton({ name: 'ONDEMAND', label: 'On Demand' })
                    .addButton({ name: 'HELP', label: 'Help' })
                    .addButton({ name: 'INFO', label: 'Informatie' })
                    .addButton({ name: 'TEXT', label: 'Teletekst' })
                    .addButtonHander((btn) => { mediabox.onButtonPressed(btn); });

                console.log(' - Starting "Ziggo Mediabox XL" driver ...');
                return neeoapi.startServer({
                    brain,
                    port: 6336,
                    name: 'mediaboxXl',
                    devices: [neeoDevice]
                });
        })
        .then(() => {
                console.log('   - READY! use the NEEO app to search for "Ziggo Mediabox XL".');
        })
        .catch((err) => {
            console.error('ERROR!', err);
            process.exit(1);
        });

    Reply Like 1
  • Hi all, I tried connecting the Horizon into my local network and this works the first couple of days but, after a while replay-tv and apps start to die on it. Has anyone else have this experience? It is the older 7400 I'm having. 

    I'm playing with the thought of connecting my Rpi via Wifi with the Horizon and via Lan with my local network. So it works really as a man in the middle. Has anyone tried this?

    Reply Like
  • Jorgen Behrens and Loic please check out the new code on Github, it has almost been a complete rewrite with now support for:

    • Static IP (or SSDP, you can choose)
    • Better SSDP detection*
    • Localisation
    • Auto-reconnect (w00t!)

    You might need to remove the driver and re-add it (since i changed some naming to better reflect UPC/Ziggo in the names) but that only has to be done this time, i promise :)

    Check out the WIKI i have created for my driver.

    I would love to see a code review or some sort from for example Niels de Klerk

    Nerd info: besides the right 'user agent' header it now also downloads the XML associated with the found record, parses it and looks for the right model numbers inside that XML. I might need to tweak it for Swiss boxes, but i don't own a Swiss box, so i have to rely on you guys.

    Since i don't know if you followers get a good notification, you are hereby tagged: Stephan de Klonia Christoph Engelbert AW de Kuiper Kees Loic  Richard Verweij Jin Fang Chen Sisela Kevin Joosten Jim Markus Mahr Jorgen Behrens Kephas Busink Patrick

    Reply Like 1
    • Gilles van den Hoven 

      I’d really love to test. Unfortunately, my Horizon box can’t connect to the local network. I only have coax at the place where the Horizon box is located and there is a long-time bug that doesn’t allow the Horizon to connect to WiFi. Maybe switching over to POE or waiting for NEEO to support HDMI-CEC for the Horizon box. 

      Reply Like 1
    • Gilles van den Hoven thanks ! just tried to install and lunch it and two good news : first the duo detection worked directly with my swiss box and second it now rums fine on my ubuntu server ... the previous version did run nicely on windows but not on this same machine :)

      Could not try yet the control part since it is too late but will do tomorrow. thanks a lot for the efforts !

      If i may i am not a fan of the silent mode by default... it runs anyway as a daemon and initially it failed due to the need port being used by another driver but i did not understand why it was just exiting with no message at all even errors :-)

      Reply Like
    • Loic the silent part is deliberately, check the logs from now on (if you are using the init.d script). But i've added a configuration value where you can set the port number, so that should be configurable now also.

      Reply Like
    • Gilles van den Hoven That's the thing. I am not using your init.d script since I use pm2 to manage all node processes on this VM ... So logs should probably be made configurable :)

      Reply Like
    • Loic you are free to make a proposal :) I am just doing what i know works best for me. I can look at PM2

      Reply Like
    • Gilles van den Hoven Actually doing the export before starting the job in PM2 does the job. And I recommend PM2, super useful tool !

      Reply Like
  • by the way, I just created a wiki on how to get this driver to run on boot

    Reply Like
  • Ok tested the commands this morning and all is fine :-) thanks !

    Reply Like 1
  • Hi Gilles van den Hoven I can't get this to work on my Pi yet. When I start the service using 'node ./index.js' I get the following error:

    module.js:544

        throw err;

        ^

     

    Error: Cannot find module 'debug'

        at Function.Module._resolveFilename (module.js:542:15)

        at Function.Module._load (module.js:472:25)

        at Module.require (module.js:585:17)

        at require (internal/module.js:11:18)

        at Object.<anonymous> (/opt/ziggo-horizon/index.js:4:15)

        at Module._compile (module.js:641:30)

        at Object.Module._extensions..js (module.js:652:10)

        at Module.load (module.js:560:32)

        at tryModuleLoad (module.js:503:12)

        at Function.Module._load (module.js:495:3)

     

    When I run 'service ziggo-horizon status' I get 

    ● ziggo-horizon.service - This service runs the Ziggo Horizon service

       Loaded: loaded (/etc/systemd/system/ziggo-horizon.service; enabled; vendor preset: enabled)

       Active: failed (Result: exit-code) since Thu 2017-12-14 10:39:29 CET; 1min 37s ago

      Process: 406 ExecStart=/bin/bash /opt/scripts/se-nat.sh (code=exited, status=127)

     Main PID: 406 (code=exited, status=127)

     

    Dec 14 10:39:28 raspberrypi systemd[1]: ziggo-horizon.service: Unit entered failed state.

    Dec 14 10:39:28 raspberrypi systemd[1]: ziggo-horizon.service: Failed with result 'exit-code'.

    Dec 14 10:39:29 raspberrypi systemd[1]: ziggo-horizon.service: Service hold-off time over, scheduling restart.

    Dec 14 10:39:29 raspberrypi systemd[1]: Stopped This service runs the Ziggo Horizon service.

    Dec 14 10:39:29 raspberrypi systemd[1]: ziggo-horizon.service: Start request repeated too quickly.

    Dec 14 10:39:29 raspberrypi systemd[1]: Failed to start This service runs the Ziggo Horizon service.

    Dec 14 10:39:29 raspberrypi systemd[1]: ziggo-horizon.service: Unit entered failed state.

    Dec 14 10:39:29 raspberrypi systemd[1]: ziggo-horizon.service: Failed with result 'exit-code'.

     

    Any ideas what I should do? During the installation of the update I;

    - Removed the old /opt/ziggo-horizon directory

    - Downloaded the GIT repository using wget

    - Unpacked the repository using tar into /opt/ziggo-horizon

    - Added 'opt' where it said '<PATH>' in the ziggo-horizon script in /init.d

    - Installed Forever

    - ran the other steps described in the WIKI to run the driver at boot.

    - rebooted the Pi

     

    Jorgen

    Reply Like
    • Jorgen Behrens after you downloaded the driver, did you do a 'npm install' in the root folder? The node_modules directory is not added to GitHub by default and the 'npm install' command is mandatory.

      Reply Like
  • Gilles van den Hoven No I didnt. Just 'npm install' or should I add something to it?

    Reply Like
    • Gilles van den Hoven  I ran 'sudo npm install /opt/ziggo-horizon' from the root directory after unpacking the tar. Now I still get the same error when I run 'service ziggo-horizon status'

      When I run 'sudo node ./index.js' from within the /opt/ziggo-horizon directory I get this error a few times: Got error: connect ECONNREFUSED 127.0.0.1:58080

      Where can I set a static IP for the box?

      Reply Like
    • Jorgen Behrens can you post your contents of the init.d script?

      you should indeed do:

      sudo -i on your raspberry pi to become root

      rm -rf /opt/ziggo-horizon/node_modules/

      cd /opt/ziggo-horizon

      npm install

      You could also check permissions, it might be that some files are owned by root and some by 'pi'.

      The static IP can be configured in ./config/default.json as well as the translations.

      Reply Like
  • Gilles van den Hoven I will take a closer look into your Driver, later up. Thanks for tagging me and Inform me about that!

    If you are ok with some stealing of code, maybe i implement some parts into my enigma Driver (manly interessted in the Autoconnect) I also will then Link you in the Readme!

    Reply Like
  • Gilles van den Hoven  works flawless with the swiss UPC box.

    SSDP discovery works now out of the box, finding the right device on my double network setup.

    I ditched my fork and cloned just your repo, without even changing the config.

    Thanks a lot for your work.

    Reply Like
  • I noticed recently that the driver restart very very often and in the logs I see

    [2018-03-18T19:08:26.002Z] 2018-03-18T19:08:26.002Z ziggo-horizon:main ---------------------------------------------
    0|Neeo Hor | [2018-03-18T19:08:26.003Z] 2018-03-18T19:08:26.003Z ziggo-horizon:main  Ziggo Horizon Mediabox XL driver
    0|Neeo Hor | [2018-03-18T19:08:26.004Z] 2018-03-18T19:08:26.004Z ziggo-horizon:main ---------------------------------------------
    0|Neeo Hor | [2018-03-18T19:08:26.004Z] 2018-03-18T19:08:26.004Z ziggo-horizon:main * verifying installed Node runtime ...
    0|Neeo Hor | [2018-03-18T19:08:26.004Z] 2018-03-18T19:08:26.004Z ziggo-horizon:main   - OK:  8.10.0
    0|Neeo Hor | [2018-03-18T19:08:26.004Z] 2018-03-18T19:08:26.004Z ziggo-horizon:main * loading modules ...
    0|Neeo Hor | [2018-03-18T19:08:26.245Z] 2018-03-18T19:08:26.245Z ziggo-horizon:main   - OK
    0|Neeo Hor | [2018-03-18T19:08:26.247Z] 2018-03-18T19:08:26.247Z ziggo-horizon:controller * Searching for Horizon Mediabox XL ...
    0|Neeo Hor | [2018-03-18T19:08:26.247Z] 2018-03-18T19:08:26.247Z ziggo-horizon:controller  - Found a box with IP: 192.168.6.45
    0|Neeo Hor | [2018-03-18T19:08:26.247Z] 2018-03-18T19:08:26.247Z ziggo-horizon:main * Searching for NEEO Brain (max 10 sec.)
    0|Neeo Hor | [2018-03-18T19:08:26.310Z] 2018-03-18T19:08:26.310Z ziggo-horizon:main   - OK, found a Neeo brain with name: NEEO Salon
    0|Neeo Hor | [2018-03-18T19:08:26.311Z] 2018-03-18T19:08:26.311Z ziggo-horizon:main * Announcing "Horizon Mediabox XL" driver to the Neeo brain ...
    0|Neeo Hor | [2018-03-18T19:08:26.363Z] 2018-03-18T19:08:26.363Z ziggo-horizon:main   - OK
    0|Neeo Hor | [2018-03-18T19:08:26.363Z] 2018-03-18T19:08:26.363Z ziggo-horizon:controller * Connecting to Horizon Mediabox XL with IP 192.168.6.45 ...
    0|Neeo Hor | Error: connect ECONNREFUSED 192.168.6.45:5900
    0|Neeo Hor |     at Object._errnoException (util.js:1022:11)
    0|Neeo Hor |     at _exceptionWithHostPort (util.js:1044:20)
    0|Neeo Hor |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
    0|Neeo Hor | [2018-03-18T19:08:27.515Z] 2018-03-18T19:08:27.515Z ziggo-horizon:main Error: connect ECONNREFUSED 192.168.6.45:5900
    0|Neeo Hor |     at Object._errnoException (util.js:1022:11)
    0|Neeo Hor |     at _exceptionWithHostPort (util.js:1044:20)
    0|Neeo Hor |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
     

     

    When the box is off it does not answer and this makes the driver crash it looks like ?

    Reply Like
    • Loic Sorry for the late reply; few questions:
      - What do you mean with 'off' do you mean 'no power' (e.g. power cable unplugged) or 'standby'? - In case you mean 'standby'; what is your energy profile you are using in your box so i can try to reproduce it?
      - Are you running the latest version of the driver (via Github?)

      Reply Like
    • Loic I've changed some of the reconnectin logic, can you check this commit: https://github.com/Webunity/ziggo-horizon

      Reply Like
    • Gilles van den Hoven Thanks a lot and sorry for my late reply as I was travelling. I applied your latest code. I will report back results :) Normally my box is in the less power saving mode available but I will check since some of my settings keep on being lost ... for exemple there is a favorites mode where only selected channels appears but the box randomly goes back to the "normal" mode which is a real pain since channels numbers are different between these two modes ! Meaning that every time this happens my need favorites icons don t work any more ... I did not find a command to activate it easlyly on top. it is a sequence of enter, down, down, down, down, down, enter, back ... I tried to script this sequence in your driver but I assume it sends the commands too fast, does not seem to work. For reference my very simple addition looks like :        toggleFavoritesMode() {
                      this.addCommands([ buttonMapping['CURSOR_ENTER'] ]);
                      this.addCommands([ buttonMapping['CURSOR_DOWN'] ]);
                      this.addCommands([ buttonMapping['CURSOR_DOWN'] ]);
                      this.addCommands([ buttonMapping['CURSOR_DOWN'] ]);
                      this.addCommands([ buttonMapping['CURSOR_DOWN'] ]);
                      this.addCommands([ buttonMapping['CURSOR_DOWN'] ]);
                      this.addCommands([ buttonMapping['CURSOR_ENTER'] ]);
                      this.addCommands([ buttonMapping['BACK'] ]);
              }
      + corresponding mappings. The button appears well and pressing on it does something, but not what I expect :) If you have a better way to toggle this Favorites mode that would be fantastic !

      Reply Like
    • Gilles van den Hoven Still the same behaviour ... I will check tonight the sleep settings ...

      exemple of logs:

      5|Neeo Hor | [2018-04-15T20:16:10.480Z] 2018-04-15T20:16:10.479Z ziggo-horizon:main ---------------------------------------------
      5|Neeo Hor | [2018-04-15T20:16:10.481Z] 2018-04-15T20:16:10.481Z ziggo-horizon:main  Ziggo Horizon Mediabox XL driver
      5|Neeo Hor | [2018-04-15T20:16:10.481Z] 2018-04-15T20:16:10.481Z ziggo-horizon:main ---------------------------------------------
      5|Neeo Hor | [2018-04-15T20:16:10.481Z] 2018-04-15T20:16:10.481Z ziggo-horizon:main * verifying installed Node runtime ...
      5|Neeo Hor | [2018-04-15T20:16:10.481Z] 2018-04-15T20:16:10.481Z ziggo-horizon:main   - OK:  8.11.1
      5|Neeo Hor | [2018-04-15T20:16:10.482Z] 2018-04-15T20:16:10.482Z ziggo-horizon:main * loading modules ...
      5|Neeo Hor | [2018-04-15T20:16:10.715Z] 2018-04-15T20:16:10.715Z ziggo-horizon:main   - OK
      5|Neeo Hor | [2018-04-15T20:16:10.717Z] 2018-04-15T20:16:10.717Z ziggo-horizon:controller * Searching for Horizon Mediabox XL ...
      5|Neeo Hor | [2018-04-15T20:16:10.717Z] 2018-04-15T20:16:10.717Z ziggo-horizon:controller  - Found a box with IP: 192.168.6.45
      5|Neeo Hor | [2018-04-15T20:16:10.717Z] 2018-04-15T20:16:10.717Z ziggo-horizon:main * Searching for NEEO Brain (max 10 sec.)
      5|Neeo Hor | [2018-04-15T20:16:10.811Z] 2018-04-15T20:16:10.811Z ziggo-horizon:main   - OK, found a Neeo brain with name: NEEO Salon
      5|Neeo Hor | [2018-04-15T20:16:10.812Z] 2018-04-15T20:16:10.812Z ziggo-horizon:main * Announcing "Horizon Mediabox XL" driver to the Neeo brain ...
      5|Neeo Hor | [2018-04-15T20:16:10.859Z] 2018-04-15T20:16:10.859Z ziggo-horizon:main   - OK
      5|Neeo Hor | [2018-04-15T20:16:10.859Z] 2018-04-15T20:16:10.859Z ziggo-horizon:controller * Connecting to Horizon Mediabox XL with IP 192.168.6.45 ...
      5|Neeo Hor | Error: connect EHOSTUNREACH 192.168.6.45:5900
      5|Neeo Hor |     at Object._errnoException (util.js:1022:11)
      5|Neeo Hor |     at _exceptionWithHostPort (util.js:1044:20)
      5|Neeo Hor |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
      5|Neeo Hor | [2018-04-15T20:16:13.315Z] 2018-04-15T20:16:13.315Z ziggo-horizon:main Error: connect EHOSTUNREACH 192.168.6.45:5900
      5|Neeo Hor |     at Object._errnoException (util.js:1022:11)
      5|Neeo Hor |     at _exceptionWithHostPort (util.js:1044:20)
      5|Neeo Hor |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
      5|Neeo Hor | [2018-04-15T20:16:13.481Z] 2018-04-15T20:16:13.480Z ziggo-horizon:main ---------------------------------------------
      5|Neeo Hor | [2018-04-15T20:16:13.482Z] 2018-04-15T20:16:13.482Z ziggo-horizon:main  Ziggo Horizon Mediabox XL driver
      5|Neeo Hor | [2018-04-15T20:16:13.482Z] 2018-04-15T20:16:13.482Z ziggo-horizon:main ---------------------------------------------
      5|Neeo Hor | [2018-04-15T20:16:13.483Z] 2018-04-15T20:16:13.483Z ziggo-horizon:main * verifying installed Node runtime ...
      5|Neeo Hor | [2018-04-15T20:16:13.483Z] 2018-04-15T20:16:13.483Z ziggo-horizon:main   - OK:  8.11.1
      5|Neeo Hor | [2018-04-15T20:16:13.483Z] 2018-04-15T20:16:13.483Z ziggo-horizon:main * loading modules ...
      5|Neeo Hor | [2018-04-15T20:16:13.717Z] 2018-04-15T20:16:13.717Z ziggo-horizon:main   - OK
      5|Neeo Hor | [2018-04-15T20:16:13.718Z] 2018-04-15T20:16:13.718Z ziggo-horizon:controller * Searching for Horizon Mediabox XL ...
      5|Neeo Hor | [2018-04-15T20:16:13.719Z] 2018-04-15T20:16:13.719Z ziggo-horizon:controller  - Found a box with IP: 192.168.6.45
      5|Neeo Hor | [2018-04-15T20:16:13.719Z] 2018-04-15T20:16:13.719Z ziggo-horizon:main * Searching for NEEO Brain (max 10 sec.)
      5|Neeo Hor | [2018-04-15T20:16:13.813Z] 2018-04-15T20:16:13.813Z ziggo-horizon:main   - OK, found a Neeo brain with name: NEEO Salon
      5|Neeo Hor | [2018-04-15T20:16:13.815Z] 2018-04-15T20:16:13.815Z ziggo-horizon:main * Announcing "Horizon Mediabox XL" driver to the Neeo brain ...
      5|Neeo Hor | [2018-04-15T20:16:13.868Z] 2018-04-15T20:16:13.868Z ziggo-horizon:main   - OK
      5|Neeo Hor | [2018-04-15T20:16:13.868Z] 2018-04-15T20:16:13.868Z ziggo-horizon:controller * Connecting to Horizon Mediabox XL with IP 192.168.6.45 ...
      5|Neeo Hor | [2018-04-15T20:16:13.870Z] 2018-04-15T20:16:13.870Z ziggo-horizon:controller   - Received version message, returning it.
      5|Neeo Hor | [2018-04-15T20:16:13.870Z] 2018-04-15T20:16:13.870Z ziggo-horizon:controller   - Received OK message, returning: 
      5|Neeo Hor | [2018-04-15T20:16:13.871Z] 2018-04-15T20:16:13.871Z ziggo-horizon:controller   - Received AUTH OK message
      5|Neeo Hor | [2018-04-15T20:16:14.868Z] 2018-04-15T20:16:14.868Z ziggo-horizon:controller   - Connected and ready to send commands.
      5|Neeo Hor | [2018-04-15T20:16:14.868Z] 2018-04-15T20:16:14.868Z ziggo-horizon:main * We are ready to control your Horizon Mediabox XL!
      5|Neeo Hor | [2018-04-15T20:16:14.868Z] 2018-04-15T20:16:14.868Z ziggo-horizon:main * If this is the first time you start this driver, you can use the
      5|Neeo Hor | [2018-04-15T20:16:14.868Z] 2018-04-15T20:16:14.868Z ziggo-horizon:main * Neeo app to search for a new device called "Horizon Mediabox XL".

      Reply Like
    • Gilles van den Hoven I checked and my box is in the standby mode described as the most power hungry. I tried to define the period it is authorized to go in standby as 1min per day, let’s see if it helps ...

      Reply Like
    • Loic any updates? I also have different power modes and can do some tests. I have my box currently in the mode that uses the most energy in standby mode since i need to be able to schedule remote recordings.

      Reply Like
    • Gilles van den Hoven Hi ! Thanks a lot for following up ... Unfortunately still the same happening... I tried as well to move your driver start as per your guide instead of using pm2 just to remove any change of additional variable but it keeps crashing and restarting ...

      Exemple of log... here below using auto detect instead of fixed ip

      Forever restarts it but still strange .... 

      2018-04-29T19:35:14.834Z] 2018-04-29T19:35:14.834Z ziggo-horizon:main ---------------------------------------------
      [2018-04-29T19:35:14.834Z] 2018-04-29T19:35:14.834Z ziggo-horizon:main  Ziggo Horizon Mediabox XL driver
      [2018-04-29T19:35:14.834Z] 2018-04-29T19:35:14.834Z ziggo-horizon:main ---------------------------------------------
      [2018-04-29T19:35:14.834Z] 2018-04-29T19:35:14.834Z ziggo-horizon:main * verifying installed Node runtime ...
      [2018-04-29T19:35:14.834Z] 2018-04-29T19:35:14.834Z ziggo-horizon:main   - OK:  8.11.1
      [2018-04-29T19:35:14.834Z] 2018-04-29T19:35:14.834Z ziggo-horizon:main * loading modules ...
      [2018-04-29T19:35:15.192Z] 2018-04-29T19:35:15.192Z ziggo-horizon:main   - OK
      [2018-04-29T19:35:15.193Z] 2018-04-29T19:35:15.193Z ziggo-horizon:controller * Searching for Horizon Mediabox XL ...
      [2018-04-29T19:35:30.200Z] 2018-04-29T19:35:30.200Z ziggo-horizon:controller   - Timeout occured after 15 seconds!
      [2018-04-29T19:35:30.218Z] 2018-04-29T19:35:30.218Z ziggo-horizon:controller * Searching for Horizon Mediabox XL ...
      [2018-04-29T19:35:45.222Z] 2018-04-29T19:35:45.222Z ziggo-horizon:controller   - Timeout occured after 15 seconds!
      [2018-04-29T19:35:45.239Z] 2018-04-29T19:35:45.239Z ziggo-horizon:controller * Searching for Horizon Mediabox XL ...
      [2018-04-29T19:36:00.242Z] 2018-04-29T19:36:00.242Z ziggo-horizon:controller   - Timeout occured after 15 seconds!
      [2018-04-29T19:36:00.251Z] 2018-04-29T19:36:00.251Z ziggo-horizon:controller * Searching for Horizon Mediabox XL ...
      [2018-04-29T19:36:15.255Z] 2018-04-29T19:36:15.255Z ziggo-horizon:controller   - Timeout occured after 15 seconds!
      [2018-04-29T19:36:15.263Z] 2018-04-29T19:36:15.263Z ziggo-horizon:controller * Searching for Horizon Mediabox XL ...
      [2018-04-29T19:36:30.267Z] 2018-04-29T19:36:30.267Z ziggo-horizon:controller   - Timeout occured after 15 seconds!
      [2018-04-29T19:36:30.285Z] 2018-04-29T19:36:30.285Z ziggo-horizon:controller * Searching for Horizon Mediabox XL ...
      [2018-04-29T19:36:45.288Z] 2018-04-29T19:36:45.288Z ziggo-horizon:controller   - Timeout occured after 15 seconds!
      [2018-04-29T19:36:45.298Z] 2018-04-29T19:36:45.298Z ziggo-horizon:controller * Searching for Horizon Mediabox XL ...
      [2018-04-29T19:37:00.306Z] 2018-04-29T19:37:00.306Z ziggo-horizon:controller   - Timeout occured after 15 seconds!
      [2018-04-29T19:37:00.310Z] 2018-04-29T19:37:00.310Z ziggo-horizon:controller * Searching for Horizon Mediabox XL ...
      [2018-04-29T19:37:15.312Z] 2018-04-29T19:37:15.312Z ziggo-horizon:controller   - Timeout occured after 15 seconds!
      [2018-04-29T19:37:15.327Z] 2018-04-29T19:37:15.327Z ziggo-horizon:controller * Searching for Horizon Mediabox XL ...
      [2018-04-29T19:37:15.799Z] 2018-04-29T19:37:15.799Z ziggo-horizon:controller   - Found a UPC Hzn Gateway (SMT-G7400:P01H)
      [2018-04-29T19:37:15.799Z] 2018-04-29T19:37:15.799Z ziggo-horizon:main * Searching for NEEO Brain (max 10 sec.)
      [2018-04-29T19:37:15.907Z] 2018-04-29T19:37:15.907Z ziggo-horizon:main   - OK, found a Neeo brain with name: NEEO Salon
      [2018-04-29T19:37:15.909Z] 2018-04-29T19:37:15.909Z ziggo-horizon:main * Announcing "Horizon Mediabox XL" driver to the Neeo brain ...
      [2018-04-29T19:37:15.957Z] 2018-04-29T19:37:15.957Z ziggo-horizon:main   - OK
      [2018-04-29T19:37:15.958Z] 2018-04-29T19:37:15.958Z ziggo-horizon:controller * Connecting to Horizon Mediabox XL with IP 192.168.6.45 ...
      [2018-04-29T19:37:15.960Z] 2018-04-29T19:37:15.960Z ziggo-horizon:controller   - Received version message, returning it.
      [2018-04-29T19:37:15.962Z] 2018-04-29T19:37:15.962Z ziggo-horizon:controller   - Received OK message, returning:
      [2018-04-29T19:37:15.962Z] 2018-04-29T19:37:15.962Z ziggo-horizon:controller   - Received AUTH OK message
      [2018-04-29T19:37:16.963Z] 2018-04-29T19:37:16.963Z ziggo-horizon:controller   - Connected and ready to send commands.
      [2018-04-29T19:37:16.964Z] 2018-04-29T19:37:16.964Z ziggo-horizon:main * We are ready to control your Horizon Mediabox XL!
      [2018-04-29T19:37:16.964Z] 2018-04-29T19:37:16.964Z ziggo-horizon:main * If this is the first time you start this driver, you can use the
      [2018-04-29T19:37:16.964Z] 2018-04-29T19:37:16.964Z ziggo-horizon:main * Neeo app to search for a new device called "Horizon Mediabox XL".
      [2018-04-30T18:17:09.660Z] 2018-04-30T18:17:09.660Z ziggo-horizon:main Error: read ECONNRESET
          at _errnoException (util.js:1022:11)
          at TCP.onread (net.js:628:25)
      error: Forever detected script exited with code: 0
      error: Script restart attempt #10
      
      Reply Like
    • Loic i´ve got the same problems with restarting script under Debian and solved it for me with changing MIN_UPTIME to 10000 and SPIN_SLEEP_TIME to 100 in init.d Script.

      Reply Like 1
    • Benjamin Wolonkiewicz Thanks. I tried your settings :) Let s see !

      Reply Like 1
    •   Loic In order to see what goes wrong you can try:
      > export DEBUG=ziggo-horizon:*
      > node index.js

      Keep the terminal open and wait for it to crash. This will print a shitload of debug messages which might help to see where the issue occurs.

      Reply Like
    • Gilles van den Hoven I just did start it this way manually since settings did not help for me... still crashing after a day or so. Will report back on next crash

      Reply Like
    • Gilles van den Hoven unfortunately the crash did not provide more info even with debug...

       

      [2018-05-02T21:02:51.087Z]   ziggo-horizon:controller * Connecting to Horizon Mediabox XL with IP 192.168.6.45 ... +338ms
      [2018-05-02T21:02:51.089Z]   ziggo-horizon:controller   - Received version message, returning it. +2ms
      [2018-05-02T21:02:51.090Z]   ziggo-horizon:controller   - Received OK message, returning:  +1ms
      [2018-05-02T21:02:51.091Z]   ziggo-horizon:controller   - Received AUTH OK message +1ms
      [2018-05-02T21:02:52.090Z]   ziggo-horizon:controller   - Connected and ready to send commands. +999ms
      [2018-05-02T21:02:52.091Z]   ziggo-horizon:main * We are ready to control your Horizon Mediabox XL! +1s
      [2018-05-02T21:02:52.091Z]   ziggo-horizon:main * If this is the first time you start this driver, you can use the +0ms
      [2018-05-02T21:02:52.091Z]   ziggo-horizon:main * Neeo app to search for a new device called "Horizon Mediabox XL". +0ms

      [2018-05-03T18:52:36.120Z]   ziggo-horizon:main Error: read ECONNRESET
        ziggo-horizon:main     at _errnoException (util.js:1022:11)
        ziggo-horizon:main     at TCP.onread (net.js:628:25) +22h

      Reply Like
    • Gilles van den Hoven i´ve some restarts on my driver again and again and can´t solve it. Now i use your debug export and get the following:

       

      [2018-05-10T11:32:59.979Z]   ziggo-horizon:main --------------------------------                                                                                                                                                             ------------- +0ms
      [2018-05-10T11:32:59.990Z]   ziggo-horizon:main  Ziggo Horizon Mediabox XL drive                                                                                                                                                             r +14ms
      [2018-05-10T11:32:59.992Z]   ziggo-horizon:main --------------------------------                                                                                                                                                             ------------- +1ms
      [2018-05-10T11:32:59.992Z]   ziggo-horizon:main * verifying installed Node runti                                                                                                                                                             me ... +1ms
      [2018-05-10T11:32:59.993Z]   ziggo-horizon:main   - OK:  8.11.1 +1ms
      [2018-05-10T11:32:59.994Z]   ziggo-horizon:main * loading modules ... +0ms
      [2018-05-10T11:33:01.193Z]   ziggo-horizon:main   - OK +1s
      [2018-05-10T11:33:01.201Z]   ziggo-horizon:controller * Searching for Horizon Me                                                                                                                                                             diabox XL ... +0ms
      [2018-05-10T11:33:01.202Z]   ziggo-horizon:controller  - Found a box with IP: 19                                                                                                                                                             2.168.0.100 +2ms
      [2018-05-10T11:33:01.204Z]   ziggo-horizon:main * Searching for NEEO Brain (max                                                                                                                                                              10 sec.) +11ms
      [2018-05-10T11:33:01.340Z]   ziggo-horizon:main   - OK, found a Neeo brain with                                                                                                                                                              name: NEEO Wohnzimmer +136ms
      [2018-05-10T11:33:01.356Z]   ziggo-horizon:main * Announcing "Horizon Mediabox X                                                                                                                                                             L" driver to the Neeo brain ... +15ms
      [2018-05-10T11:33:01.415Z]   ziggo-horizon:main Error: listen EADDRINUSE 0.0.0.0                                                                                                                                                             :6336
        ziggo-horizon:main     at Object._errnoException (util.js:1022:11)
        ziggo-horizon:main     at _exceptionWithHostPort (util.js:1044:20)
        ziggo-horizon:main     at Server.setupListenHandle [as _listen2] (net.js:1367:                                                                                                                                                             14)
        ziggo-horizon:main     at listenInCluster (net.js:1408:12)
        ziggo-horizon:main     at doListen (net.js:1517:7)
        ziggo-horizon:main     at _combinedTickCallback (internal/process/next_tick.js                                                                                                                                                             :141:11)
        ziggo-horizon:main     at process._tickCallback (internal/process/next_tick.js                                                                                                                                                             :180:9) +60ms
       

       

      Anything i can do/change?

      Reply Like
    • Benjamin Wolonkiewicz your log mentions that your driver tried and listen to a port that is already in use (probably another driver. Change the config to use a different port and it will work 

      Reply Like 1
    • Loic thx for your Reply, i give that a Chance tomorrow. 

      I thought i already Look at that and saw that this driver is the only driver on this TCP Port. 

      Reply Like
    • Loic hmm that sucks, i will try to reproduce it locally but i can't guarantee when, since i have a lot todo the comming week(s), sorry... 

      Reply Like
    • Loic by looking at the code i saw that i did not handle the ECONNRESET error at all. This should now trigger not only a reconnect (if i catch it correctly) but also any other errors should be printed via the DEBUG method.

      I changed that in this commit: https://github.com/Webunity/ziggo-horizon/commit/dddf1ad994768b641c9a05cfc1fee932f51af762

      But i made an additional commit of which i am not sure it would work at all (some refactoring); i need to test that at home first but you might want to use that bleeding edge version: https://github.com/Webunity/ziggo-horizon/commit/e290fe10ac3a3ceabbbcb0c2c1bb02963ef2b86d

      Reply Like
    • Gilles van den Hoven I tried both and something strange happens like if the files were not correctly formatted. I get a hugggge dump see below only first lines copied it keeps going for hundreds of line before simply exiting ...

      lsamson@ether:~/neeo/ziggo-horizon$ node index.js
      
      [2018-05-11T18:31:30.255Z] {} { [Function: require]
      
        resolve: { [Function: resolve] paths: [Function: paths] },
      
        main:
      
         Module {
      
           id: '.',
      
           exports: {},
      
           parent: null,
      
           filename: '/home/lsamson/neeo/ziggo-horizon/index.js',
      
           loaded: false,
      
           children: [ [Object], [Object] ],
      
           paths:
      
            [ '/home/lsamson/neeo/ziggo-horizon/node_modules',
      
              '/home/lsamson/neeo/node_modules',
      
              '/home/lsamson/node_modules',
      
              '/home/node_modules',
      
              '/node_modules' ] },
      
        extensions: { '.js': [Function], '.json': [Function], '.node': [Function] },
      
        cache:
      
         { '/home/lsamson/neeo/ziggo-horizon/index.js':
      
            Module {
      
              id: '.',
      
              exports: {},
      
              parent: null,
      
              filename: '/home/lsamson/neeo/ziggo-horizon/index.js',
      
              loaded: false,
      
              children: [Array],
      
              paths: [Array] },
      
           '/home/lsamson/neeo/ziggo-horizon/node_modules/debug/src/index.js':
      
            Module {
      
              id: '/home/lsamson/neeo/ziggo-horizon/node_modules/debug/src/index.js',
      
              exports: [Object],
      
              parent: [Object],
      
              filename: '/home/lsamson/neeo/ziggo-horizon/node_modules/debug/src/index.js',
      
              loaded: true,
      
              children: [Array],
      
              paths: [Array] },
      
           '/home/lsamson/neeo/ziggo-horizon/node_modules/debug/src/node.js':
      
            Module {
      
              id: '/home/lsamson/neeo/ziggo-horizon/node_modules/debug/src/node.js',
      
              exports: [Object],
      
              parent: [Object],
      
              filename: '/home/lsamson/neeo/ziggo-horizon/node_modules/debug/src/node.js',
      
              loaded: true,
      
              children: [Array],
      
              paths: [Array] },
      
           '/home/lsamson/neeo/ziggo-horizon/node_modules/debug/src/debug.js':
      
            Module {
      
              id: '/home/lsamson/neeo/ziggo-horizon/node_modules/debug/src/debug.js',
      
              exports: [Object],
      
              parent: [Object],
      
              filename: '/home/lsamson/neeo/ziggo-horizon/node_modules/debug/src/debug.js',
      
              loaded: true,
      
              children: [Array],
      
              paths: [Array] }
      Reply Like
    • Gilles van den Hoven I tried to check the diffs in your commit and between today s version and the previous one I can only see refactoring (which seems not to work)

      Reply Like
    • Loic i reverted some refactoring and tested at home; my driver now loads at home, can you retry?

      Reply Like
    • Gilles van den Hoven Hi ! So yes now it runs and error is now a bit different :)

      [2018-05-20T20:36:24.913Z] 2018-05-20T20:36:24.913Z ziggo-horizon:main ---------------------------------------------
      [2018-05-20T20:36:24.915Z] 2018-05-20T20:36:24.915Z ziggo-horizon:main  Ziggo Horizon Mediabox XL driver
      [2018-05-20T20:36:24.916Z] 2018-05-20T20:36:24.916Z ziggo-horizon:main ---------------------------------------------
      [2018-05-20T20:36:24.916Z] 2018-05-20T20:36:24.916Z ziggo-horizon:main * verifying installed Node runtime ...
      [2018-05-20T20:36:24.916Z] 2018-05-20T20:36:24.916Z ziggo-horizon:main   - OK:  8.11.2
      [2018-05-20T20:36:24.916Z] 2018-05-20T20:36:24.916Z ziggo-horizon:main * loading modules ...
      [2018-05-20T20:36:25.158Z] 2018-05-20T20:36:25.158Z ziggo-horizon:main   - OK
      [2018-05-20T20:36:25.159Z] 2018-05-20T20:36:25.159Z ziggo-horizon:controller * Searching for Horizon Mediabox XL ...
      [2018-05-20T20:36:25.159Z] 2018-05-20T20:36:25.159Z ziggo-horizon:controller  - Found a box with IP: 192.168.6.45
      [2018-05-20T20:36:25.160Z] 2018-05-20T20:36:25.160Z ziggo-horizon:main * Searching for NEEO Brain (max 10 sec.)
      [2018-05-20T20:36:25.237Z] 2018-05-20T20:36:25.237Z ziggo-horizon:main   - OK, found a Neeo brain with name: NEEO Salon
      [2018-05-20T20:36:25.238Z] 2018-05-20T20:36:25.238Z ziggo-horizon:main * Announcing "Horizon Mediabox XL" driver to the Neeo brain ...
      [2018-05-20T20:36:25.295Z] 2018-05-20T20:36:25.295Z ziggo-horizon:main   - OK
      [2018-05-20T20:36:25.295Z] 2018-05-20T20:36:25.295Z ziggo-horizon:controller * Connecting to Horizon Mediabox XL with IP 192.168.6.45 ...
      [2018-05-20T20:36:25.297Z] 2018-05-20T20:36:25.297Z ziggo-horizon:main An error occured!
      [2018-05-20T20:36:25.298Z] 2018-05-20T20:36:25.298Z ziggo-horizon:main Error: connect ECONNREFUSED 192.168.6.45:5900
          at Object._errnoException (util.js:992:11)
          at _exceptionWithHostPort (util.js:1014:20)
          at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
      [2018-05-20T20:36:25.298Z] 2018-05-20T20:36:25.298Z ziggo-horizon:main * No connection to MediaBox (BOX_CONNECTION_REFUSED). Trying to reconnect after 10 seconds ...
      [2018-05-20T20:36:25.299Z] 2018-05-20T20:36:25.299Z ziggo-horizon:main TypeError: Cannot create property 'connectionState' on string 'BOX_CONNECTION_CLOSED'
          at String.boxDisconnected (/home/lsamson/neeo/ziggo-horizon/horizon-controller.js:262:24)
          at emitOne (events.js:116:13)
          at Socket.emit (events.js:211:7)
          at TCP._handle.close [as _onclose] (net.js:557:12)
      error: Forever detected script exited with code: 0
      error: Script restart attempt #27

       

      Later on another one

       

      [2018-05-20T20:36:25.512Z] 2018-05-20T20:36:25.512Z ziggo-horizon:main ---------------------------------------------
      [2018-05-20T20:36:25.515Z] 2018-05-20T20:36:25.515Z ziggo-horizon:main  Ziggo Horizon Mediabox XL driver
      [2018-05-20T20:36:25.515Z] 2018-05-20T20:36:25.515Z ziggo-horizon:main ---------------------------------------------
      [2018-05-20T20:36:25.515Z] 2018-05-20T20:36:25.515Z ziggo-horizon:main * verifying installed Node runtime ...
      [2018-05-20T20:36:25.515Z] 2018-05-20T20:36:25.515Z ziggo-horizon:main   - OK:  8.11.2
      [2018-05-20T20:36:25.515Z] 2018-05-20T20:36:25.515Z ziggo-horizon:main * loading modules ...
      [2018-05-20T20:36:25.761Z] 2018-05-20T20:36:25.761Z ziggo-horizon:main   - OK
      [2018-05-20T20:36:25.762Z] 2018-05-20T20:36:25.762Z ziggo-horizon:controller * Searching for Horizon Mediabox XL ...
      [2018-05-20T20:36:25.762Z] 2018-05-20T20:36:25.762Z ziggo-horizon:controller  - Found a box with IP: 192.168.6.45
      [2018-05-20T20:36:25.763Z] 2018-05-20T20:36:25.763Z ziggo-horizon:main * Searching for NEEO Brain (max 10 sec.)
      [2018-05-20T20:36:25.840Z] 2018-05-20T20:36:25.840Z ziggo-horizon:main   - OK, found a Neeo brain with name: NEEO Salon
      [2018-05-20T20:36:25.842Z] 2018-05-20T20:36:25.842Z ziggo-horizon:main * Announcing "Horizon Mediabox XL" driver to the Neeo brain ...
      [2018-05-20T20:36:25.910Z] 2018-05-20T20:36:25.910Z ziggo-horizon:main   - OK
      [2018-05-20T20:36:25.911Z] 2018-05-20T20:36:25.911Z ziggo-horizon:controller * Connecting to Horizon Mediabox XL with IP 192.168.6.45 ...
      [2018-05-20T20:36:25.919Z] 2018-05-20T20:36:25.919Z ziggo-horizon:controller   - Received version message, returning it.
      [2018-05-20T20:36:25.940Z] 2018-05-20T20:36:25.940Z ziggo-horizon:controller   - Received OK message, returning:
      [2018-05-20T20:36:25.942Z] 2018-05-20T20:36:25.942Z ziggo-horizon:controller   - Received AUTH OK message
      [2018-05-20T20:36:26.939Z] 2018-05-20T20:36:26.939Z ziggo-horizon:controller   - Connected and ready to send commands.
      [2018-05-20T20:36:26.940Z] 2018-05-20T20:36:26.940Z ziggo-horizon:main * We are ready to control your Horizon Mediabox XL!
      [2018-05-20T20:36:26.940Z] 2018-05-20T20:36:26.940Z ziggo-horizon:main * If this is the first time you start this driver, you can use the
      [2018-05-20T20:36:26.940Z] 2018-05-20T20:36:26.940Z ziggo-horizon:main * Neeo app to search for a new device called "Horizon Mediabox XL".
      [2018-05-21T12:12:31.079Z] 2018-05-21T12:12:31.079Z ziggo-horizon:main TypeError: this.selectChannel is not a function
          at Timeout._onTimeout (/home/lsamson/neeo/ziggo-horizon/horizon-controller.js:366:10)
          at ontimeout (timers.js:498:11)
          at tryOnTimeout (timers.js:323:5)
          at Timer.listOnTimeout (timers.js:290:5)
      error: Forever detected script exited with code: 0
      error: Script restart attempt #28

       

      Btw the init.d script you provide as an exemple is missing the --workingDir directive to start forever so as is it does not take any config into account and uses default ;)

      The start() should be something like

              forever           --pidFile $PIDFILE           -a           -l $LOGFILE           --workingDir $APPLICATION_DIR           --minUptime $MIN_UPTIME           --spinSleepTime $SPIN_SLEEP_TIME           start $APPLICATION_PATH 2>&1 > /dev/null &
              RETVAL=$?

       

      Thanks!

      Reply Like
  • Hi,

    your driver works so far wonderful, but I fail at the moment to get it running under init.d. Probably it will be because I did not set the paths in the script correctly, but I am under Linux or with me under Debian Stretch even more than a beginner. Would it be possible to help me with this?

    Below the messages if I want to start the service

     

    root@amlogic-X96:/home/bennysb/NEEO-Treiber/NEEO-Treiber/Horizon/ziggo-horizon-master/Assets/init.d# service ziggo-horizon start
    Job for ziggo-horizon.service failed because the control process exited with error code.
    See "systemctl status ziggo-horizon.service" and "journalctl -xe" for details.
    root@amlogic-X96:/home/bennysb/NEEO-Treiber/NEEO-Treiber/Horizon/ziggo-horizon-master/Assets/init.d#
    root@amlogic-X96:/home/bennysb/NEEO-Treiber/NEEO-Treiber/Horizon/ziggo-horizon-master/Assets/init.d# service ziggo-horizon status
    ● ziggo-horizon.service - LSB: Ziggo Horizon Mediabox XL driver
       Loaded: loaded (/etc/init.d/ziggo-horizon; generated; vendor preset: enabled)
       Active: failed (Result: exit-code) since Sat 2018-04-14 11:08:02 CEST; 7s ago
         Docs: man:systemd-sysv-generator(8)
      Process: 5670 ExecStart=/etc/init.d/ziggo-horizon start (code=exited, status=203/EXEC)
    
    Apr 14 11:08:02 amlogic-X96 systemd[1]: Starting LSB: Ziggo Horizon Mediabox XL driver...
    Apr 14 11:08:02 amlogic-X96 systemd[1]: ziggo-horizon.service: Control process exited, code=exited status=203
    Apr 14 11:08:02 amlogic-X96 systemd[1]: Failed to start LSB: Ziggo Horizon Mediabox XL driver.
    Apr 14 11:08:02 amlogic-X96 systemd[1]: ziggo-horizon.service: Unit entered failed state.
    Apr 14 11:08:02 amlogic-X96 systemd[1]: ziggo-horizon.service: Failed with result 'exit-code'.
    
    
    
    Reply Like
    • Gilles van den Hoven Okay i solved the problem by myself.

      The Problem was, that the init.d Script is written under Windows and Line 1 can´t be read by my Debian System. I solved it with the command

      dos2unix ziggo-horizon
      Reply Like
  • I´ve now tested your Next Branch with systemd and it worked very smooth, good Job.

    Reply Like
Like6 Follow