Please login or register.

Login with username, password and session length
Pages: [1] 2

Author Topic: Re: Pi DST is coming....  (Read 2324 times)

LostDog88

  • Hero Member
  • *****
  • Helpful Post Rating: 2
  • Posts: 171
Re: Pi DST is coming....
« on: March 01, 2019, 01:07:32 PM »

I googled how to reboot at midnight.
Seems my pi likes to be rebooted every 5 to 6 or so days anyways.
I set mine to reboot every morning at 3AM.

The last DST I was one day off and it is my understanding that the pi does it's clock update at 12AM. Since DST actually happens at 2AM and there is no RTC built into the PI the system clock won't update until the next day.

Rebooting at 3AM solves this issue.

I hope.

We shall see! LOL
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: Re: Pi DST is coming....
« Reply #1 on: March 01, 2019, 03:33:42 PM »

I googled how to reboot at midnight.
Seems my pi likes to be rebooted every 5 to 6 or so days anyways.
I set mine to reboot every morning at 3AM.

The last DST I was one day off and it is my understanding that the pi does it's clock update at 12AM. Since DST actually happens at 2AM and there is no RTC built into the PI the system clock won't update until the next day.

Rebooting at 3AM solves this issue.

Problem solved by setting up an NTP server. You can have that NTP server sync all devices on your LAN too.

I'm puzzled by the need to reboot the Pi every night too. Why do you need to do this. I've noticed a few who seem to have the need to do this too. Servers only need to be rebooted for maintenance purposes.

Are you running unstable software on it.

I hope.

We shall see! LOL
Logged

LostDog88

  • Hero Member
  • *****
  • Helpful Post Rating: 2
  • Posts: 171
Re: Re: Pi DST is coming....
« Reply #2 on: March 01, 2019, 03:53:42 PM »

I googled how to reboot at midnight.
Seems my pi likes to be rebooted every 5 to 6 or so days anyways.
I set mine to reboot every morning at 3AM.

The last DST I was one day off and it is my understanding that the pi does it's clock update at 12AM. Since DST actually happens at 2AM and there is no RTC built into the PI the system clock won't update until the next day.

Rebooting at 3AM solves this issue.

Problem solved by setting up an NTP server. You can have that NTP server sync all devices on your LAN too.

I'm puzzled by the need to reboot the Pi every night too. Why do you need to do this. I've noticed a few who seem to have the need to do this too. Servers only need to be rebooted for maintenance purposes.

Are you running unstable software on it.

I hope.

We shall see! LOL

Nope......Not running anything but stable. HomeGenie v1.2 - Stable.38. Straight from the maintenance page.

Two mornings in a row I have woke up and automation had failed. I quickly open putty and am able to log into the Pi no issues at all.

I then open a browser and navigate to Home Genie. Nothing. 401 does not exist error. sudo reboot now and the pi reboots very quickly and HomeGenie returns to working status.

So. Since I am gone an awful lot and my vacation scenes are important to me, the only solution I had was to reboot every night.

Hence the reason for google and a cron tab thingy.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: Re: Pi DST is coming....
« Reply #3 on: March 01, 2019, 05:50:40 PM »

The word HomeGenie Stable doesn't apply in your case so.

Did you check the Raspberry Pi logs to find the cause.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: Re: Pi DST is coming....
« Reply #4 on: March 01, 2019, 06:02:26 PM »

Before you rebooted did you sudo systemctl status homegenie.service to find the reason why the service halted

Just add the line Restart=always into your homegenie.service file and never again will you have to reboot your HG Raspberry Pi

To do this just sudo nano /etc/systemd/system/homegenie.service and add the above line under the [Service] section press ctrl x and you're done forever.

No more messy cron jobs now.
Logged

LostDog88

  • Hero Member
  • *****
  • Helpful Post Rating: 2
  • Posts: 171
Re: Re: Pi DST is coming....
« Reply #5 on: March 02, 2019, 12:37:11 PM »

The word HomeGenie Stable doesn't apply in your case so.

Did you check the Raspberry Pi logs to find the cause.

I am not a linux guru. I would not have the faintest clue on how to do this.

I know this much. System stops every so often. My limited knowledge knows it has to be rebooted to get the system to work as desired.

Rebooting system solves the issue. Wife happy buttons on remote work. Every one including cats and dogs live happily ever after!  rofl rofl rofl rofl
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: Re: Pi DST is coming....
« Reply #6 on: March 02, 2019, 01:51:36 PM »

The word HomeGenie Stable doesn't apply in your case so.

Did you check the Raspberry Pi logs to find the cause.

I am not a linux guru. I would not have the faintest clue on how to do this.

I know this much. System stops every so often. My limited knowledge knows it has to be rebooted to get the system to work as desired.

Rebooting system solves the issue. Wife happy buttons on remote work. Every one including cats and dogs live happily ever after!  rofl rofl rofl rofl

That simple line I gave you added to your homegenie.service file along with the instruction on how to do it will restart the service (in other words restart homegenie automatically) anytime it stops.

You do not need to be a Linux guru or any other type of guru to do this. If Homegenie is crashing as you described it is not set up properly in the first place.

Imagine turning off and on your freezer every night at midnight to prevent it from going in to a defrost cycle. You'd soon be calling the maintenance guy to sort the problem.

Servers are designed to run unassisted 24/7 unless they are powered down for maintenance.

A number of other commercial home automation applications on the market which are poorly designed and suffer from memory leaks encourage their user base to reboot their servers regularly. Lazy designers and silly users for tolerating poor design and paying for the privilege to do so.

By all means keep rebooting nightly but it's only a matter of time before the server sits down permanently unless the underlying need for rebooting nightly is addressed.
Logged

Dave Mc

  • Jr. Member
  • **
  • Helpful Post Rating: 1
  • Posts: 24
Re: Re: Pi DST is coming....
« Reply #7 on: March 03, 2019, 03:46:39 AM »

Just add the line Restart=always into your homegenie.service file and never again will you have to reboot your HG Raspberry Pi

To do this just sudo nano /etc/systemd/system/homegenie.service and add the above line under the [Service] section press ctrl x and you're done forever.

No more messy cron jobs now.

Is this something that could/should be added to the PiX10Hub image for everyone's convenience?
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: Re: Pi DST is coming....
« Reply #8 on: March 03, 2019, 08:23:02 AM »

Just add the line Restart=always into your homegenie.service file and never again will you have to reboot your HG Raspberry Pi

To do this just sudo nano /etc/systemd/system/homegenie.service and add the above line under the [Service] section press ctrl x and you're done forever.

No more messy cron jobs now.

.
Is this something that could/should be added to the PiX10Hub image for everyone's convenience?

You can add it yourself

sudo systemctl stop homegenie.service
sudo nano /etc/systemd/system/homegenie.service

You'll see your service file. Move to the [Service] section and under that heading just add the line

restart=always

When that is done press ctrl x and enter. Press y and enter and problem solved. To restart HG just type

sudo systemctl start homegenie.service
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: Re: Pi DST is coming....
« Reply #9 on: March 03, 2019, 02:18:47 PM »

Adding the line your self would be a lot more simple then reinstalling a Pi image and reloading your HG backup.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Dave Mc

  • Jr. Member
  • **
  • Helpful Post Rating: 1
  • Posts: 24
Re: Re: Pi DST is coming....
« Reply #10 on: March 04, 2019, 04:18:31 AM »

That is fine with me.  I was thinking more about future users so it would be included in the image.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1750
Re: Re: Pi DST is coming....
« Reply #11 on: March 04, 2019, 05:56:00 AM »

That is fine with me.  I was thinking more about future users so it would be included in the image.

Most of these type of changes are just minor tweaks and can be easily carried out locally.

More pressing would be the need to address the issue of a user having to reboot the server on a nightly basis. This is a stability issue and needs to be investigated if not for the user in question certainly for the rest of the user base. In this users case HG will eventually stop functioning permanently.

As I mentioned earlier, should HG stop functioning a simple command sudo systemctl status homegenie.service will give an indication what caused this crash. The results can be reported to the Homegenie Club forum or the Homegenie GitHub and can be investigated further and a solution provided
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: Pi DST is coming....
« Reply #12 on: March 22, 2019, 09:43:25 AM »

You can reset your PiX10Hub time with some simple terminal commands, you'd type:
Code: [Select]
sudo timedatectl set-ntp truefollowed by
Code: [Select]
date or for more detail
Code: [Select]
timedatectl status
you could then create a script to do this and a cron job to fire the script when you wished to update the time. Every day at 2:01 am or just when DST & Standard Time starts.
I've started to create some programs that perform terminal tasks from inside HG, this may be one I should look at creating.
Unless someone beats me to it. ;) ;)
 >!
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2081
Re: Pi DST is coming....
« Reply #13 on: March 22, 2019, 10:59:16 AM »

I'm with petera on this.  If the RPi or HG are not stable and require any regular reboot or other tweaking, they are not stable and need to be fixed.  Adding a reboot is a band-aid that is covering up a real problem that should be fixed.  If the HG release is broken, Gene needs to know so that it can be fixed.  If the RPi has some system issue with the installation, it must be sorted out.  This is not the right solution for a "Hub".  If all people want is a toy, then continue with the reboot approach but you will never have a reliable system if you do it that way.

FWIW, I found a similar issue when using the HG-BE image on RPi.  That fork was aimed more so at Windows users so running on RPi was more experimental.  In the end, it was not a good choice for my setup at the time so I did not deploy it.

LostDog88

  • Hero Member
  • *****
  • Helpful Post Rating: 2
  • Posts: 171
Re: Pi DST is coming....
« Reply #14 on: March 22, 2019, 11:49:23 AM »

I do not want to make anyone mad here, I enjoy this board, and love the (free) support that I get.
With that being said, it also needs to be noted that I am NOT a linux person. I am learning. I am trying. But it is a new language and I am old.
In my 30 years of playing, fixing, repairing, etc. computers I have never ever ever met one that never needed to be rebooted. The OP was about a problem with DST. There was also an issue where once in a while, randomly my system would stop responding and need to be rebooted. This was rare, but it seemed to happen randomly and almost always when I was out of town.
I did what I thought was a good idea and set it to reboot every evening. After the DST and any other changes that would happen between 12AM and 2AM. I don't think there is an issue with my system and I certainly wouldn't refer to it as a toy. It literally controls everything in my house. Literally. From my fish tank to my outside lights, to my chicken watering solution. Everything.
I have been programming phone system back to when they used clappers, springs and 25 pair cables. Once electro-mechanical went away and systems became more electrical that is when the issues started. A 1A2 key system never needed rebooting. Even the most robust Norstar system needed a reboot once in a while. While not often, every tech knew to reboot it if there was a major problem with the system. This is just how it was/is. And still stands true today.
While Linux is much more robust than windows, I still think that once in a while it will need a reboot.
I thought I had a great idea. Apparently I was wrong. But there is no way I am smart enough or experienced enough to fix what I cannot figure out. And trying to get support over a board is well..........support over a board. :-)
All computers are built by humans. Software is built by humans. Every human is flawed. This shows up in our software and hardware.
I want to be helpful here and I want to learn, but I just don't have the skills to "fix" everything. And with so many modules, scripts, etc. It is time consuming. Sometimes I just have to do what is best for my situation.
Rebooting a server is not a bad thing. In my humble opinion.
Again, just trying to convey thoughts, please by all means help me. I welcome it. I encourage it. I want to learn. But I lack the skills. Again I don't want to P anyone off. I was simply trying to convey what I did to solve a problem and kill two birds. Fixing DST issue, which by the way I didn't have an issue with this time and making sure my system was fresh every day to take care of my animals and wife.
Please don't tell my wife I put her in the same category as chickens and fish and cats, she will kill me. No seriously, she will.
Logged
Pages: [1] 2
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.