CTC time problem after power loss

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by DarylMc, Dec 29, 2017.

  1. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,313
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    I have a colour touch screen from 2008.
    Recently it is losing time after a power loss.
    I suspect the onboard battery.
    Has anyone changed one and do you remember the cell type?
    Thanks
     
    DarylMc, Dec 29, 2017
    #1
  2. DarylMc

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,534
    Likes Received:
    175
    Location:
    Adelaide, Australia
    Since you are running a copy of cgate on a pi you could just set it as a time master (its a config option) and get it to broadcast the time every 10 minutes or so. Assuming of course that the pi is connected to the internet and has a time server enabled.
     
    Ashley, Dec 29, 2017
    #2
  3. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,313
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Thanks
    Does the battery provide any other benefit for reliable operation of the Touch screen to boot etc?
     
    DarylMc, Dec 29, 2017
    #3
  4. DarylMc

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,534
    Likes Received:
    175
    Location:
    Adelaide, Australia
    No idea. Given the touch screen runs embedded xp I assume it has some sort of bios that may be maintained by the battery, but I think you need the other Ashleigh for that one :)
     
    Ashley, Dec 30, 2017
    #4
  5. DarylMc

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,393
    Likes Received:
    25
    Location:
    Adelaide, South Australia
    Too long ago - I don't remember. But it does run embedded XP, and typically the battery in a PC keeps the real time clock going. Last I knew things like BIOS settings are supposed to be non-volatile, but I guess that depends on the maker of the motherboard and the BIOS.
     
    ashleigh, Dec 31, 2017
    #5
  6. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,313
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    @ashleigh
    @Ashley
    Thanks
    Will give CIS a call this week and see if they know the cell type.

    As far as I can see the Colour Touch has no connection to an internet time server?
    If so I don't know how it kept time for so many years.
    Perhaps the occasional visit to transfer some changes was enough to keep it close.
    The customer is unlikely to have made changes through the settings page.

    Maybe I should give the task over to CGate anyway?
    Does this sound correct.

    clock.master=yes
    clock.mastermode=primary
     
    DarylMc, Jan 1, 2018
    #6
  7. DarylMc

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,427
    Likes Received:
    64
    Location:
    Adelaide
    There are several different generations of Colour Touch. Of the two different ones I could find in the repair area, both had a CR2032... one in a holder and one in an assembly with flying leads and a connector.

    As for setting C-Gate up as a time master... I actually have no idea whether it can do that or whether that comes from the connected client.

    What else do you have on your network?

    Nick
     
    NickD, Jan 2, 2018
    #7
  8. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,313
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    @NickD
    Thanks Nick
    I was onsite to setup Homebridge CBus.
    The customer mentioned the CTC clock reset to 2004 after a recent power outage.
    I will change the CTC battery but still might have a go at using CGate as the time master.

    The home has a Colour Touch and "Clipsal Homegate" running on a headless Windows PC.
    The logic and schedules are running only on the Homegate PC.

    For now I will keep the remote PC on site running Homegate but point it to CGate on the pi.
     
    DarylMc, Jan 3, 2018
    #8
  9. DarylMc

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,427
    Likes Received:
    64
    Location:
    Adelaide
    The Homegate should be able to be set up to be a time master, and I would have thought it should be a higher accuracy device (assuming Windows gets its time from NTP), in which case it would take over as the master as the CTC would have lower priority.

    If it were me I wouldn't rely on C-Gate on the pi for the Homegate instance... why do you need to change it?

    Nick
     
    NickD, Jan 3, 2018
    #9
  10. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,313
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    That's a thought.
    If the PC is running I may as well leave the CGate there.
     
    DarylMc, Jan 3, 2018
    #10
  11. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,313
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Homegate on the PC is doing one job right now and that is running the logic for a Coolmaster AC interface.
    Thanks again @djaggar I still think it is magic.
    I could move it to the touch screen but that is in a long list of jobs not done.
    I'm hoping one day soon Coolmaster will release a standalone Homekit AC bridge.

    Remote operation is not a customer requirement.
    Of course it makes sense to keep that as an option though.

    There is a few reasons why I even considered letting the pi run CGate.
    For one I wanted to test the stability of CGate for long term use on the pi in conjunction with Homebridge CBus and Apple Home app for some voice control.

    Right now the Touch screen does handle a lot of lighting groups which do not have key inputs.
    It's a big home but I'm very proud of the simplicity of the setup.
    There is only 1 gang and 2 gang key inputs for the whole home.
    Mostly 1 gang.
    There is an extensive amount of outdoor spot lights and fans etc which can only be operated by the touch screen though.
    Also things like disabling motion sensors, boosting solar hot water etc.
    If the Touch screen died it would be a problem.
    The CTC has been super reliable but since it is no longer available as a spare I'm considering future options.

    Keeping time for the last 8 years has never really been much of a problem.
    I'm sure it has been the best clock in the house and I'm hoping a new CR2032 will keep it that way for a few more years.
     
    DarylMc, Jan 3, 2018
    #11
  12. DarylMc

    daniel C-Busser Moderator

    Joined:
    Jul 26, 2004
    Messages:
    769
    Likes Received:
    21
    Location:
    Adelaide
    Hi Daryl, I've had a chance to test this clock master functionality in C-Gate and regretfully, it's broken. There's a possibility we can get a fix into the next release, if so I'll bump this thread with an update and a how-to. But as others have mentioned, you can get good results now with Homegate or a Touchscreen.
     
    Last edited: Jan 4, 2018
    daniel, Jan 4, 2018
    #12
  13. DarylMc

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,534
    Likes Received:
    175
    Location:
    Adelaide, Australia
    Glad to know it wasn't just me. I tried it myself the other day and couldn't get it to work. Was on my list to post the question.
     
    Ashley, Jan 4, 2018
    #13
  14. DarylMc

    cmlp

    Joined:
    Feb 5, 2008
    Messages:
    32
    Likes Received:
    2
    Location:
    Melbourne, Australia.
    Apologies for dredging this up, but this still seems broken to me. My C-Gate (for homebridge) install on a pi never sets the cbus network. If I understand the logs, clock updates are only ever emitted by the PAC, which drifts a lot. I just discovered by 10pm holiday mode has been happening at 2am, for example.
     
    cmlp, Jan 15, 2022
    #14
  15. DarylMc

    cmlp

    Joined:
    Feb 5, 2008
    Messages:
    32
    Likes Received:
    2
    Location:
    Melbourne, Australia.
    Following up for future readers, this seems to be resolvable by running cronjob at suitable intervals (every 5 minutes in my example) to set the cbus network time to the local system time:

    */5 * * * * echo "CLOCK TIME //networkname/254/223 `date +\%H:\%M:\%S`" | netcat -N -w 0 localhost 20023

    where network name is as required for your installation etc.
     
    cmlp, Jan 15, 2022
    #15
    Mr Mark likes this.
  16. DarylMc

    Mr Mark

    Joined:
    Jan 27, 2006
    Messages:
    322
    Likes Received:
    5
    Location:
    FNQ
    I like this one - so simple!
    Years ago, I had a RPi running C-Gate in my unit as an interface with Command Fusion software. There was a python script that used to run after the RPi restarted, scrape the time and date then broadcast it across the network. This solution looks so much tidier.
     
    Mr Mark, Jan 16, 2022
    #16
  17. DarylMc

    cmlp

    Joined:
    Feb 5, 2008
    Messages:
    32
    Likes Received:
    2
    Location:
    Melbourne, Australia.
    Thanks. Makes me wonder why it only took me 7+ years since I noticed it to do something about it! I guess because we don't go on holiday much :)
     
    cmlp, Jan 16, 2022
    #17
  18. DarylMc

    Trevor

    Joined:
    Nov 22, 2018
    Messages:
    336
    Likes Received:
    26
    Location:
    Melbourne Victoria
    Hi All,
    Colour CTC's use a button battery, the CTC1 is soldered onto the main PCB, the CTC2 has it in a cell holder, the CTC3 uses the same cell battery but it has a wired connector that plugs into the main PCB.
    You can swap the cell in the holder (CTC2) , solder the wires from the old battery (CTC3). Only 4 screws to get access to them.
    The CTC1 is soldered to the PCB, but can also be changed, the ground pin is the hardest, the PCB has 4 layers of copper sinking the heat from it.
    They all use a standard 3volt CR2032 or BR2032 button cell battery.

    regards
    Trevor
     
    Trevor, Jan 19, 2022
    #18
  19. DarylMc

    alexdski

    Joined:
    May 17, 2011
    Messages:
    17
    Likes Received:
    2
    Location:
    UK
    And for the Windows users out there, you can use task scheduler to run a batch script very easily.

    Install ncat (https://nmap.org/ncat/) then create a batch scipt as below.

    @echo off
    for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
    set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
    set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%" & set "MS=%dt:~15,3%"
    set "datestamp=%YYYY%-%MM%-%DD%"
    echo CLOCK DATE //networkname/254/223 %datestamp% | ncat 127.0.0.1 20023


    If your time creeps you can use this one:

    for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
    set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
    set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%" & set "MS=%dt:~15,3%"
    set "datestamp=%YYYY%-%MM%-%DD%"
    set "timestamp=%HH%:%Min%:%Sec%"
    echo CLOCK TIME //networkname/254/223 %timestamp% | ncat 127.0.0.1 20023

    Thanks so much cmlp
     
    alexdski, Feb 2, 2022
    #19
    cmlp likes this.
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.