Announcement

Collapse
No announcement yet.

Resetting Time/Clock

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Resetting Time/Clock

    I will try to make this clear as I can. If confusing please let me know and I will add more info.

    I am using Hometroller Pi w/ HS4 and a few z-wave devices AND local use only (meaning Pi is NOT connected to the Internet except for occasional updating). I do not need or want remote access. Also, I use a surplus router locally to access the HS web interface (it too is NOT connected to the Internet). This allows me to control/adjust events, etc. The Hometroller is connected to a UPS.

    My problem is that cccasionally our electricity goes off for extended times (sometimes several hours), exceeding the capacity of the UPS to support the Pi. When power is restored, the Pi does not/cannot reset the clock to the current time and the system time defaults to the time when the Pi Hometroller was shutdown. Obviously this creates problems for my event triggers. It seems the only way I can reset the system time is by connecting the Pi to the Internet and waiting for it to obtain the time (and then correct it for my location - which it does properly). It is not clear to me if the system time for the Pi/HS4 is actually being obtained from the Internet (maybe some NTP server) or from my laptop/desktop which I use to access the Web Interface locally.

    Is there a way to reset the clock manually or adjust for this problem manually when it occurs??? Any suggestions/comments would be appreciated.

    BTW otherwise the set up works pretty flawlessly as long as there is no power interruption.

    #2
    You should be able to set date/time from the Linux command prompt, using the 'date' command. Enter 'date --help' or 'man date' for a description.

    date format: [MMDDhhmm[[CC]YY][.ss]]

    You'll need to preface the command with 'sudo' in order to gain elevated privileges.

    Example
    Code:
    sudo date 100419302021
    MM=10
    DD=04
    hh=19 (7pm)
    mm=30
    CC=20
    YY=21

    PS. Normally the RPi gets timedate via NTP.

    Comment


      #3
      Alternatively there are lots of cheap real time clock modules for the pi which have a coin battery to keep the date across restarts without internet access.

      Steve

      Comment


        #4
        And if you still no happy with the above and because your device is based on the Raspberry Pi 3, you could migrate your install to this board : https://www.waveshare.com/product/ra...poe-4g-box.htm It's got much more you could add to your operations...



        Eman.
        TinkerLand : Life's Choices,"No One Size Fits All"

        Comment


          #5
          Originally posted by Eman View Post
          And if you still no happy with the above and because your device is based on the Raspberry Pi 3, you could migrate your install to this board : https://www.waveshare.com/product/ra...poe-4g-box.htm It's got much more you could add to your operations...



          Eman.
          I bite my lip with several of your posts but I have to ask what does this have to do with the OP question?
          Jon

          Comment


            #6
            Not sure why your UPS is running out of juice so quickly or what else it is maintaining but here is a battery free RTC which easily clips into the RPI GPIO socket. No messy soldering or battery changes to worry about either as the module has its own on board cap. https://thepihut.com/products/mini-r...r-raspberry-pi

            Comment


              #7
              +1 for an RTC clock - very simple to add.
              HS4Pro on a Raspberry Pi4
              54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
              Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

              HSTouch Clients: 1 Android

              Comment


                #8
                Originally posted by jon00 View Post

                I bite my lip with several of your posts but I have to ask what does this have to do with the OP question?
                If I should answer this with insight, the post at #2 best suits the OP clearly or it's with no cost at all to the beholder but then when you move over to the third post #3 which invoked you to in case the PI is still recently acquired/purchased to void your warranty by opening it and including a GPIO board...?
                • Along comes my post at #4 though expensive (democratic or pro-choice) and if I should quote this
                  Is there a way to reset the clock manually or adjust for this problem manually when it occurs??? Any suggestions/comments would be appreciated.
                  is about a board which comes with an RTC on board plus other bells and whistles... 😖
                Click image for larger version  Name:	Compute-Module-PoE-4G-Board-details-intro1.jpg Views:	0 Size:	213.4 KB ID:	1500659
                • What really is your problem?...


                Eman.
                TinkerLand : Life's Choices,"No One Size Fits All"

                Comment


                  #9
                  Originally posted by Eman View Post

                  If I should answer this with insight, the post at #2 best suits the OP clearly or it's with no cost at all to the beholder but then when you move over to the third post #3 which invoked you to in case the PI is still recently acquired/purchased to void your warranty by opening it and including a GPIO board...?
                  • Along comes my post at #4 though expensive (democratic or pro-choice) and if I should quote this is about a board which comes with an RTC on board plus other bells and whistles... 😖
                  Click image for larger version Name:	Compute-Module-PoE-4G-Board-details-intro1.jpg Views:	0 Size:	213.4 KB ID:	1500659
                  • What really is your problem?...


                  Eman.
                  No problem. You first post provides no information on this so in isolation makes no sense. If you had included this information in that post it would be much more valid.



                  Jon

                  Comment


                    #10
                    Originally posted by jon00 View Post

                    No problem. You first post provides no information on this so in isolation makes no sense. If you had included this information in that post it would be much more valid.


                    I often times seek no misunderstanding (if I can put it lightly) but often refer others to known sources if in case I would be assumed misguiding but in this case if I would step out of this thread gracefully and would refer you to the link in my post at #4


                    We need not really add anything more as a diversion to the OP's intent... Respect.


                    Eman.

                    TinkerLand : Life's Choices,"No One Size Fits All"

                    Comment


                      #11
                      Well -- thank you all for your suggestions so far -- did not intend to open a can of worms. My original question was about manually re-setting the time, but morphed into adding a RTC (which I did not know existed - I am not a Pi enthusiast - but maybe a viable option questions below) and then move to starting over with a new more sophisticated/advanced board (while interesting more than I want to do). I appreciate all the comments for sure - especially bc I have learned some new things along the way. In the end I need to keep it simple.

                      Remember I am using a HomeTroller Pi (early version not new G2 recently released). Also note my current UPS is older (and may be weak) and is supporting a NAS, Modem and Router. Suspect together accounts for short run-time. And I have reasonable Linux background - not an expert however.
                      1. The only really essential item is the NAS to give me time for a controlled shut-down. 2. It may be better to have a dedicated UPS for the HSPi -- I could be wrong, but gather the Pi only draws around 10-15W -- in fact I have a new 360W UPS unboxed as yet.
                      3. I guess I could dedicate either the old weak UPS or the new one to the Pi -- any thoughts?? Am I correct that a new 360W UPS would support the Pi alone for 36 hours 360/10????

                      Let me see if I can understand all of the suggestions so far
                      A. Post #2 One option is to simply re-set the date/time manually (Post #2) - zwolfpack - I am not sure how to address the HS Pi. Can I do this from within HS4 - Tools>Linux>Linux Tools option OR is there a better/safer wayn???
                      B. Post #3 and #6 - Add a simple RTC module with a coin battery to the HSPi (egDS3231). This means opening the case and installing the module and possibly voiding the warranty. SteveMSJ and concordseer - Found instructions for setting up DS3231 -- https://thepihut.com/blogs/raspberry...r-raspberry-pi, but not clear how I then address the module to set it up?? Can it be accessed through HS4 as above or ssoem other way?? Will it corrupt HS4?? Will the Hometroller case accommodate the module???
                      C.@Eman - Very informative option, but not really viable for me at this point. But appreciate you extensive input!!

                      Comment


                        #12
                        Originally posted by SteveMSJ View Post
                        Alternatively there are lots of cheap real time clock modules for the pi which have a coin battery to keep the date across restarts without internet access.

                        Steve
                        This solution uses a super cap rather than a battery. SteveMSJ , do you know how long it will maintain the date/time?

                        Comment


                          #13
                          Originally posted by logbuilder View Post

                          This solution uses a super cap rather than a battery. SteveMSJ , do you know how long it will maintain the date/time?
                          Sorry I don't have any direct experience of the capacitor type, mine is from years ago and has a coin battery. I suspect they will be fine for power cuts though.

                          Steve

                          Comment


                            #14
                            Tools>Linux>Linux Tools can be used to execute simple Linux commands; however it suffers a significant shortcoming in that it doesn't display "error" output, only "standard" output. Thus if you make a mistake you don't get any feedback...

                            I'd recommend ssh as the best/easiest way to access. From Windows 10, click on the lower-left search button, then enter ssh homeseer@192.168.1.123 where '192.168.1.123' represents the IP address of the Hometroller Pi, as reported on https://find.homeseer.com. If this works, you'll be prompted for 'homeseer@192.168.1.123's password:' ... This is the Linux password you'd use on the Linux Tools page, NOT one of the ones you'd use to access MyHS or other HS4 pages.

                            Another option is to connect up an HDMI monitor and USB keyboard.

                            The hardware RTC is interesting, I might pick one up to experiment with. Be aware that the "primary" I2C pins that it uses are occupied by the Z-Wave Controller GPIO board. According to one of the comments on the product page (look for user Brian J), the device can be configured to use GPIO pins 17-28.

                            This shows an image of the Z-Wave Controller board: https://products.z-wavealliance.org/products/1244
                            GPIO pin 1 is on the lower right, pin 12 on the upper left. It appears the pin 17 spot is right near the edge of the board. I'd recommend opening up the case to verify if that RTC board will fit in there. (I have one of these boards in my Z-Net device but it hasn't been opened for years).

                            Comment


                              #15
                              If opening boxes and voiding warranties is an issue you’ve already found the solution. The UPS is the way to go. Plenty of cheap dedicated UPS’s on the market these days. Here’s an example of one https://uk.pi-supply.com/products/pi...y-raspberry-pi

                              Depending on how long you expect your RPI to run without mains supply will determine what UPS to go for. Have a little read of this to give you a better insight https://forums.raspberrypi.com/viewtopic.php?t=262564

                              Comment

                              Working...
                              X