Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 10 of 10
  1. #1
    Senior Member
    Join Date
    Oct 2009
    Location
    Western & Northern New York
    Posts
    228

    Power Interruptions & Timezone Loss

    Hi;

    I hesitate to even mention this issue, but it is unique, I thought I would.

    I am running LMS on PcP 6 at home, but at my current location, I am running 4.1. If the answer is to install 6 and "then try it" that's fine. I hesitate because it's a bit of work to get at the server and sd card. If the answer is "get a UPS" then that's fine too...

    Pi 3B+, Picore 4.1, running LMS only. I have a USB Hdd with my library attached, so a self contained server/library. The LMS server preferences and cache are moved to the HDD (per picore "how to" instructions). I should also mention I am running SAMBA to create a network drive (windows 10).

    At this location we have frequent power failures (forest and wind = power lines down), but I have also seen this when I intentionally shut down and restart.

    The spiral of events and work to restore things is as follows:

    1) After the power failure, the timezone in the tweak page must be corrupted. The field is blank. My touch has a blank time screensaver (no time to display). My radio and boom display goofy incorrect times. As a side effect, I noticed that the RP FLAC Interactive streams won't play, but the regular FLAC ones do. note that the rest of the system operates just fine, favorites, music library, etc. It's only when I try to fix the time that I break everything.
    2) I go into tweaks, clear the field, and reboot the Pcp.
    3) Often the reboot never completes, and I have to manually shut down power, but the end result is LMS has lost it's way. No library, no favorites, in fact (from memory) it might only offer MySB.com
    4) I think what happens is the PcP/LMS loses track of the HDD with the LMS data. I usually go into the LMS page, see the USB drive is mounted visually in the UI (but I don't think that LMS sees it). What I have to do is this (on the PcP LMS page):
    a) move the LMS data to the SD card
    b)unmount the HDD drive, then remount it.
    c) move the LMS data back to the HDD
    5) What this results in is the loss of my favorites (I have a backup so I manually restore), and I have to do a complete rescan. I am not sure about what happens to the plugins, the ones that I use (RP App, Material Skin, Squeezelite-X, etc) seem to be there, but maybe they are by default.

    Often, Usually, LMS is streaming when the power failure happens, but it doesn't seem like the SD Card is getting irretrievably corrupted, as I can recover without a reformat/redo.

    Whats telling is that the system seems to mostly recover from the power failure (except time display, RP interactive), everything works, it sees the HDD, it plays favorites, library. It's when I try to "fix" it is really breaks.

    We had a windstorm and a couple power failures yesterday, and I am playing my system with a messed up clock, and no flac interactive, but everything else works so, I hesitate to try to fix it . Maybe it's time to do the version 6 upgrage....

    Jim

  2. #2
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    1,876
    hi Redrum,

    The timezone gets set automatically and saved when you boot, but it must have a network and internet access. Once set, it will not check again. I can't see how it could corrupted once set.

    Similarly, ntp sets the time, but it also needs internet access.

    We seem to be getting a lot of these kind of happenings, are the worlds power systems failing?

    regards
    Greg

  3. #3
    Senior Member
    Join Date
    Oct 2009
    Location
    Western & Northern New York
    Posts
    228
    Quote Originally Posted by Greg Erskine View Post
    hi Redrum,

    The timezone gets set automatically and saved when you boot, but it must have a network and internet access. Once set, it will not check again. I can't see how it could corrupted once set.

    Similarly, ntp sets the time, but it also needs internet access.

    We seem to be getting a lot of these kind of happenings, are the worlds power systems failing?

    regards
    Greg
    Hi Greg;

    I think you are on to something...when power is interrupted and restored, the Pcp powers up well before the modem has established internet access. It is crappy DSL, and it takes forever to boot and establish internet access. Up to 5 minutes, seriously.

    So, if PcP boots, and timezone was set previously, does it leave it alone? If not, and no internet access, what does it do? Because, what I am seeing is that time is fine before power failure, then on reboot (with no internet access at the time) it gets messed up. Then when I go to reset the timezone, everything breaks.

    I am almost thinking that maybe I can do this instead? Power failure, I see no time on touch, goofy time on boom and radio. stop lms. Just power down and power up pcp (while internet access is established), everyone is happy? It really is an ordeal as I described.

    One other thing of note - I mentioned that RP FLAC interactive (all streams) doesn't work in this state. I noticed today that while RP FLAC regular stream works, there is no song an album art info displayed. The MP3 streams are fine. I wonder what the significance is.

    Not sure about the world but this is happening in the Adirondacks in Northern New York, Huge Pine trees that fall down on power lines, crappy DSL on ancient copper infrastructure that can drop out for days. You pass more utility trucks than cars on windy days. But it's beautiful here...the price you pay.

    I'll try my idea....

    Jim

  4. #4
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    1,876
    Quote Originally Posted by Redrum View Post
    So, if PcP boots, and timezone was set previously, does it leave it alone?
    Yes. Once set, it never gets touched again.

    Because, what I am seeing is that time is fine before power failure, then on reboot (with no internet access at the time) it gets messed up. Then when I go to reset the timezone, everything breaks.
    Timezone should still be OK but the time is not set because there is no internet access to a ntp server. Don't touch the timezone. Currently pCP only sets the time on boot so the time will never get fixed by itself and it may drift over time.

  5. #5
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    2,715
    An easy way to resolve this is to tell cron (timed tasks tool) to set the time every few hours.
    https://forums.slimdevices.com/showt...l=1#post925614

    If you set it to run every 10 minutes then you should find that the time is back to normal soon after boot.

    Another way to do it would be to force a long delay on start up to give it time for the router to come up .... perhaps only if the outside world cannot be reached.
    Paul Webster
    http://dabdig.blogspot.com
    Author of "Now Playing" plugins covering Radio France (FIP etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland

  6. #6
    Senior Member
    Join Date
    Oct 2009
    Location
    Western & Northern New York
    Posts
    228
    Thank you Greg, Paul;

    Maybe the timezone field isn't causing my issue, I guess I just assumed it was because "time" was lost (touch screensaver) and incorrect (Boom and Radio Display). This problem is very repeatable, and a real PITA to recover from.

    So, I thought I would try something based on your comments, and it failed, and will rebuild again.....

    Here's what I did:
    1) we lost power a few times a couple days ago, and I have been operating in this "limp" mode
    2) based on your comments, I decide to try shutting down the PcP, restarting it with internet available and hopefully viola! Not. I shut it down through the PcP UI. Note that the page never redirected, it just counted down and stopped. I reapplied power, and it took a while for the UI to come back up.
    3) I looked at my touch, favorites - "empty", My Music->album artists - "empty". I then went to look at the network drive contents (via samba that appears to work through this), and not only is the media folder missing, but the favorites are a "default" file, created today:

    Name:  2020-05-01 08_38_58-Window.jpg
Views: 89
Size:  25.3 KB

    You guys are much more versed on what is going on "under the hood" but if I had to guess, I would say that the power failure, or restore, broke something with regard to the mounted USB HDD which contains my music library, and the LMS cache and prefs. My guess is that when LMS came up, it didn't detect the needed files, library, etc, so it just created a default configuration which is empty...

    In this broken state, this is what my LMS page looks like. Note that it says that the drive is "not mounted", even though if I go to mount it, it says "mount not changed". I have to uncheck, change mount, recheck, remount to get it to mount.

    Name:  aaa.jpg
Views: 88
Size:  76.6 KB

    Could it be this? - The HBB is powered by the USB of the Pcp (no external adaptor). The drive is a western digital WDBU6Y0020BBK. I could not find it's power consumption spec anywhere...I suppose I could try an experiment with a thumb drive of music on a stick and see what happens...But, then why is it that the "time" is the symptom?

    One other thought, should I just consider leaving the LMS cache and preferences on the SD card?

    Jim

    *** Edit *** Ok, so it turns out I can avoid a rescan. What I need to do to recover is:
    Set LMS Data to SD Card (this will allow unmount of HDD)
    Uncheck the HDD mount, save
    check the HDD, save
    Set LMS data to HDD
    Storp/start LMS.

    It turns out that I caused the need for a rescan by "moving" the LMS data
    Last edited by Redrum; 2020-05-01 at 06:41. Reason: update

  7. #7
    Senior Member
    Join Date
    Oct 2009
    Location
    Western & Northern New York
    Posts
    228

    with what I've learned, If I could start this thread all over...

    ...I would put it this way:

    PcP 4.1 as server with external HDD for library, a touch, boom and radio as players. When there is a power failure, and power is restored to Pcp before internet is available, the server "works" but there is an issue with displaying the correct time, and the RP FLAC app does not work in interactive mode. It works in regular stream, but there is no song info/artwork.

    If I try to reboot PcP from this state it fails, it does not recognize the HDD mount. To recover, I have to:
    set LMS data to the SD card
    Unmount the HDD
    Remount the HDD
    Set LMS data to HDD
    Restart LMS
    Reboot PcP? Not sure, but I do....

    Time is then displayed correctly and everything including RP works perfectly.

    This might not be a PCP thing, it might be an LMS thing, and now that I know a non painful way of recovering, it's not a big deal to me. But perhaps indicative of a weakness in the system where others might be interested.

    Jim

  8. #8
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    1,876
    hi Redrum,

    You should upgrade to the latest pCP a lot has changed from pCP 4.1. I think Paul did put some checks re: LMS and setting the time recently.

    I can't see why you should be resetting settings. It should really just be a matter of booting things in the right order.

    Are you using a self powered external USB?

    Back in the old days, I had a USB drive powered off the RPi and it won't mount reliably because of a power issue. If it did mount, it was in readonly mode. If I plugged it into a USB hub it worked!

    regards
    Greg

  9. #9
    Senior Member
    Join Date
    Oct 2009
    Location
    Western & Northern New York
    Posts
    228
    Hi Greg;

    Yes, the USB HDD is self powered via USB, no additional adapter.

    I upgraded to Pcp 6 at home, and have a SD image ready to update this system, but have been lazy, it's in a loft, in an enclosure in that has to be disassembled (i.e. lazy).

    I posted because I thought the failure mechanism might be interesting to the dev's. It's not every day the pcp and LMS is "stress tested" with power failures and slow booting DSL . Especially since the "symptoms" that something is wrong are so bizarre (time, and the RP app).

    I'll upgrade and bump this thread after the next time a tree takes down a power line....

    Thank you for your input and take care, oh, and thank you so much for contributing to PcP and keeping SB alive...

    Jim

  10. #10
    Senior Member
    Join Date
    Oct 2009
    Location
    Western & Northern New York
    Posts
    228

    Update

    I wanted to post an update for information only, in case this happens to someone else. I am not asking for any resolution or work to be done!

    I upgraded to PcP6, and in fact we just got a new ISP in the area, which I switched to. I have a pcp6 as a LMS server only, with a 2TB USB HDD as storage.

    The problem is frequent power failures - symptoms after failure - no time screen saver on touch, wrong time on radio, boom, RP FLAC interactive won't stream. Recovery was not as simple as rebooting, it involved unmounting and remounting HDD, rescan, restore favorites, etc. LMS on Windows never did this, PcP must handle this exception differently.

    Anyhow, when setting up Pcp, I moved cache and prefs to the HDD. Based on thoughts on this and other threads, I decided to try keeping cache and prefs on the SD.

    Yesterday we had another power failure (we have 6-10 a summer). When power was restored, same symptoms. However, with cache and prefs on the SD, it was a simple shutdown re-power of pcp and viola! everything is fine.

    The pcp setup instructions say to move the cache and prefs to HDD, so I did it. Now that I understand what that really means, the best solution for me is to keep it on the SD

    Jim

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •