Raspberry Pi & LMS - way to postpone start-up?

Bodgit

Wammer
Wammer
Feb 27, 2019
949
450
83
Woking
AKA
David
HiFi Trade?
  1. No
Am running LMS on Raspberry Pi 4 Raspian OS, whenever I start it up, the date/time showing on the SqueezeBox Touch is the time when the LMS was shutdown, its as though the LMS service is starting before the Pi has synced its time. Is it possible to delay starting up the LMS until the time is synced?

Currently having to restart the LSM via 'Material' URL in order for the correct time to show.

 

Man in a van

Wammer
Wammer
Sep 28, 2012
1,768
301
103
Staffordshire
AKA
Ronnie
Am running LMS on Raspberry Pi 4 Raspian OS, whenever I start it up, the date/time showing on the SqueezeBox Touch is the time when the LMS was shutdown, its as though the LMS service is starting before the Pi has synced its time. Is it possible to delay starting up the LMS until the time is synced?

Currently having to restart the LSM via 'Material' URL in order for the correct time to show.
Hi David

That's a strange one :(

Is it the Desktop Buster on the rpi, also which version of LMS

and in what order (and how) do you power the devices off and on ?

ronnie

Is everything Wireless or Ethernet ?

 

Man in a van

Wammer
Wammer
Sep 28, 2012
1,768
301
103
Staffordshire
AKA
Ronnie
You can try this

If Desktop

Menu > Preferences > System > Wait for network

If Headless, open a Terminal and type

sudo raspi-config

select 1 System Options  > S6 Network at Boot > Enable > exit and reboot

I think it may be possible to increase the wait time But I would have to search for that command

ronnie

 

Bodgit

Wammer
Wammer
Feb 27, 2019
949
450
83
Woking
AKA
David
HiFi Trade?
  1. No
You can try this

If Desktop

Menu > Preferences > System > Wait for network

If Headless, open a Terminal and type

sudo raspi-config

select 1 System Options  > S6 Network at Boot > Enable > exit and reboot

I think it may be possible to increase the wait time But I would have to search for that command

ronnie
Hi Ronnie, I've done that so will see if it solves the issue. I might have already configred the Pi to wait for network anyway, if so it won't have changed anything.

I'm using the latest raspian desktop OS, which I think is Buster? Not sure about the other acronyms. The Squeezebox touch and NAS are left on, the Pi is powered on as needed (via remotely activated socket) and then shutdown/powered off when not in use. No idea what EDO is..

David

 

bencat

Amplifier Destroyer
Wammer Plus
Feb 6, 2010
7,412
4,197
193
Liverpool
AKA
Andrew
HiFi Trade?
  1. No
Could I ask why you turn off your Pi with LMS ? The pi uses much less electricity than your Touch which you leave on . If you leave the Raspberry Pi on 24/7 then while it would not solve your problem it would not be appear as the time would be be in sync .

 

Man in a van

Wammer
Wammer
Sep 28, 2012
1,768
301
103
Staffordshire
AKA
Ronnie
Last night I powered off the rpi and Touch (I can't remember the sequence)

After reading David's post this morning, I first powerd on the Touch which gave a screen with only two lines on, Settings and My Music, (I think that is correct)  but I have seen these before when there is no LMS to connect to.

The screen then defaulted to the time last night when the Touch was powered off.

When I plugged in the rpi, it started up but the Touch was not recognised, restarted LMS and everything hooked up.

The player is supposed to poll for the LMS (or the other way around, I can never remember)

At the moment I have powered off the rpi and left the Touch powered on, showing the (correct) time

I'll leave things for sometime, to let the LMS cache expire

ronnie

 
Last edited by a moderator:

Bodgit

Wammer
Wammer
Feb 27, 2019
949
450
83
Woking
AKA
David
HiFi Trade?
  1. No
My LMS is version 8.2.0. Just tried rebooting again and I thought the issue persists but was looking at the time of the LMS build! Will need to test again.

I am being a bit irrational perhaps in powering off the Pi, its used only at weekends so I decided to save some pennies and have it running only when needed, there are so many things now that are plugged in all the time that I am trying to cut them down. The SBT remains powered up as it displays quite a useful clock in the Lounge if nothing else.

 

Man in a van

Wammer
Wammer
Sep 28, 2012
1,768
301
103
Staffordshire
AKA
Ronnie
Ok I'll change to 8.2.0

I have just booted the rpi up and the Touch (and a Radio on the same network) reset to 12:08 which was when I shut down.

I restarted LMS and the time on both devices corrected

I have a rpi3b+ I'll connect up later today for further testing

ronnie

 
  • Upvote
Reactions: Bodgit

Man in a van

Wammer
Wammer
Sep 28, 2012
1,768
301
103
Staffordshire
AKA
Ronnie
Right;

I installed this Buster Desktop on a rpi3b+

https://downloads.raspberrypi.org/raspios_armhf/images/raspios_armhf-2021-05-28/2021-05-07-raspios-buster-armhf.zip

using the raspberrypi Image Maker Tool on a Windows 10 Pro Desktop, this let me configure SSH easily.

Connected the pi up to a monitor and fired it up.

When running I connected by SSH and used sudo raspi-config to enable VNC.

I connected to the rpi via VNC and did not run an update, nor  "wait for network"

I used Chromium to navigate to Mysqueezebox.com and downloaded logitechmediaserver_8.2.0_arm.deb

right clicked the file and used Package Install

Connected to LMS from the Windows Desktop and installed Radio Paradise

Checked playback worked.

Then I stopped the Touch, left it displaying the time, and shutdown the pi, this was at 14:30

At 1508 I restarted the rpi

Went to Touch screen, tapped on, selected My Apps > Radio Paradise > play

stopped play and stopped the Touch

Time showing 14:33 when actual time is 15:11

Tapped start on the touch, playback begain from Radio paradise

I have just stopped playback on the Touch, screen is showing 14:51 and time is 15:29

Connect by terminal

pi@Bodgit:~ $ sudo /etc/init.d/logitechmediaserver restart
[....] Restarting logitechmediaserver (via systemctl): logitechmediaserver.servi[ .k
pi@Bodgit:~ $


and time has updated.

I checked the server log, but nothing stood out

I did a factory restart on the Touch  (disconnecting the EDO Applet) and selected a Radio as player.

Started playback on the Radio

I used the Touch to stop playback on the Radio, which went to 15:46

The Touch went to 3:46

I shut down the rpi via VNC

I'll come back later with another update

 
  • Upvote
Reactions: Bodgit

Man in a van

Wammer
Wammer
Sep 28, 2012
1,768
301
103
Staffordshire
AKA
Ronnie
Power rpi up at 5:01

Time on Touch and Radio changes to 3:48

Tap start on the Touch, screen shows Main Mix Radio Paradise stopped, > hit play > Radio starts, plays Eine Kliene Nachmusik

Hit pause on Touch, Radio shows 15:52,  Touch shows stopped screen, then 3:53

I use VNC to enable "Wait for Network" and reboot rpi

The rpi comes back up and Radio changes time to 17:12 and the Touch follows  a few seconds later

Tap start on the Touch,  screen shows stopped, tap play and Radio starts playing.

Stop the radio playing (17:16) via the Touch control (after a pause, the Touch changes to the same time as the Radio) and then power off the rpi ( using Shutdown via VNC) pull the power on the rpi.

Back later

Back later

 

Man in a van

Wammer
Wammer
Sep 28, 2012
1,768
301
103
Staffordshire
AKA
Ronnie
Powered on the rpi at 18:32 when the rpi came up both touch and Randio changed time to 17:19

Tapped start on the Touch then >play and the Radio began playback

Waited for a couple of minutes or so until the track changed, and then hit pause on the Touch

Time on both devices changed to 17:27

Restarted LMS and both devices show the correct time

That's all for now, I don't know if it is a fault with LMS or Raspberry pi OS.

If I get chance to try picoreplayer and raspberry pi OS Lite tomorrow I will

I have been playing with crontab and might have a solution

See next post

 

Man in a van

Wammer
Wammer
Sep 28, 2012
1,768
301
103
Staffordshire
AKA
Ronnie
Open a Terminal into the rpi

Type sudo crontab -e

press enter

Select 1 for the text editor

at the bottom of the page type

@reboot sleep 1 && /etc/init.d/logitechmediaserver restart


crontab.png


Save and exit

Ctrl+X;   Y;  Enter

sudo reboot

This seems to work. I'll find out tomorrow morning o_O

There  might be a bug somewhere but more testing is required and I'm not sure how much time I can spend on it.

ronnie

 
  • Upvote
Reactions: Bodgit

Man in a van

Wammer
Wammer
Sep 28, 2012
1,768
301
103
Staffordshire
AKA
Ronnie
Rpi Log, star date  Wednesday;

powered up the rpi and the time on both Radio and rpi reverted to 20:24 Tuesday.

I was able to navigate on the Touch to Favourites and start playback of fip radio on the Radio, so a little progress.
 Server log shows last start time of yesterday and not for today

I let it play for a few tracks and then paused play, time returned to 20:41 Tuesday 5th Oct

I opened a terminal and changed the time for the cron job, restarted LMS, played a few tracks and the powered off the rpi.

I'll connect the Touch and Radio to the Windows Desktop which has a LMS installed and see what happens

back later