Peppy Player config screen reboot not working

I am using Marc version on a 3B+ with RPi 7" screen.

From the browser config screen, clicking Reboot caused the music to stop playing, the screen goes blank (backlight is on) but the screen never comes back. During that time opening an SSH into the player still works so Peppy is running. Then, from SSH do a sudo reboot, it actually does a reboot. Or, doing a "sudo shutdown now", the backlight goes off and I hear an audible click. There is no click when Peppy is shut down from the LCD screen power button and the backlight stays on.
 
Hi,

Have you made any changes in the pre_shutdown/shutdown functions? It looks like there is some error condition in the player which prevents it from reboot/shutdown. What is the current state of the player when you are trying to reboot? Is it playing radio or files? Could you list all steps which lead to the issue right from the beginning. That could help to reproduce the issue on my side. It would be also helpful to check if there are any error messages in the log file.

Best regards
 
I enabled logging and connected to Peppy SSH using VS Code to view the log. When I click Reboot in the webpage I see a log which quickly gets overwritten. It would be nice to be able to append rather than overwrite the log. I am able to briefly see a line with an SMBus Error from switchutil.py line 47. While connected this way, SSH never disconnects and the player starts playing again after 5s, every time I click reboot. VS Code may be causing this to act differently. I am going to send you what I have for config.txt and the peppy.log without VS Code and without the USB drive connected.
 
Well, it's changed its behavior. Reboot from webpage earlier today caused the pi to not reboot but stay in a stable state where I could SSH into it. Now, for some reason, after reboot it goes dark for about 5s then starts playing again. I have captured two logs, one after startup and another after reboot was clicked.
 

Attachments

I don't see any fatal errors in the logs. The log after reboot is not completely readable but in the end there is no any error either.
Did the behaviour changed to normal when you disconnected the USB disk?
I'll try to assemble Pi with 7" display later today and test.
I'm planning to release a new player version pretty soon (either this or next weekend). It would be great to fix the issue (if any) before the release.

Best regards
 
I haven't seen any difference between having the USB drive plugged in and not. I think VS Code loads some SSH code on the pi which might be causing a problem. I will try some more things to see if I can uncover something.
 
Here's the appended log. I get different results on different days. It's frustrating. At the end of the log is an odd file not found error. My Peppy has the favorites in the Genre folder. There is no favorites folder yet favorites still works anyway.
 

Attachments

I've found the issue with 'favorites' folder. It's not a harmfull bug. The fix will be available in the next release.

Regarding reboot/shutdown, I've found some kind of issue which will be also fixed in the next release. When the player reboots it unmounts and powers off all connected USB devices. That's why if you rebooted during file playback from the USB drive that drive will not be mounted after reboot. The player makes several attempts to find that file. During this period the screen is black and you have impression that the player is down. But after about 20-30 seconds it will go back to normal. It just cannot find the file for the playback. To fix the issue during the reboot the player will not poweroff USB devices. The only way after poweroff is either shutdown the player or unplug/plug the USB device.

All commands in the terminal cause the system shutdown. I mean the following commands"
sudo reboot
sudo poweroff
sudo systemctl restart peppy
sudo systemctl stop peppy
I explain that as a systemd behavior. I don't think the player affects that in any way.

Other than that I didn't see any issues with reboot/shutdown from UI and Web.

Best regards
 
Sometimes, when streaming radio or playing USB files, Peppy comes back on and continues playing 5s after double tapping the power button. Double tapping it again successfully turns player off.
Could you consider turning off the backlight when Peppy is shut down from the UI?
 
The reboot/shutdown functionality is controlled by the Linux 'systemd' framework as the player runs as a service now. Probably there are some glitches in the communication between the player and systemd. Please let me know if you will find a way to reproduce the issue.

OK, I'll turn off the backlight during shutdown operation in the next release. I just thought that after shutdown the next step is to poweroff the system. In this case there is no need to turn the backlight off.
 
My Peppy i part of a bigger sound system which may continue to play FM or CDs after the Peppy is turned off but before the system power is switched off. I’ve never liked how the Pi handles shutdown/restart. I have lost SD cards from power switching at the wrong time. It should be handled in hardware on the Pi like a real computer.
 
I have been able to reliably reproduce a turnoff bug in Marc. If Peppy is playing a radio station and I double click the power button, it turns off correctly each time. However, if, while playing radio I click the Home button then select either AirPlay or Audio Files and play music, then Home again and play radio, when I double click the power button it goes off for 5s then comes back on. If I, again, double click the power button it turns off properly until I do what I just described again.

Is there a way to update to Klimt without doing a full image install?
 
Thank you for the steps! I was not able to reproduce the issue using this sequence: radio-home-file-home-radio-shutdown. It didn't reboot it was always shutdown. I'll try with different players...

Sure, you can install Klimt Edition by following these steps:

- Make a backup of the current player just in case: mv Peppy Peppy.bak

- Get the Klimt Edition from GitHub: git clone https://github.com/project-owner/Peppy.git

- Edit the configuration files according to your screen (the default player resolution is 480x320):
nano Peppy/config.txt (change resolution, touchscreen and other properties). What should be changed for a particular display can be found here:
https://github.com/project-owner/PeppyPlayers.doc/wiki/Disk-Images
(select your display)
nano Peppy/screensaver/peppymeter/config.txt (change VU Meter screensaver resolution e.g. large, wide etc)
nano Peppy/screensaver/spectrum/config.txt (change Spectrum screensaver resolution e.g. large, wide etc)
You can also reuse the files from the backup (Peppy.bak)
The file Peppy/config.txt has new properties in the new version. You can make a diff.

- Install new dependencies/libraries:
pip3 install vosk sounddevice
pip3 install beautifulsoup4
pip3 install -U requests
pip3 install internetarchive

Best regards
 
All done. Works ok. I like the look. Bluetooth Sink (odd name) works fine from iPhone too.
I still see the issue where the screen comes back 5s after a double click of the shutdown button. I noticed it doesn't matter what mode it starts in.
For instance, if it is playing Collection on power-up and I switch to Radio then double click the Power button, screen goes dark for 5s then comes back and plays Radio. When Peppy shuts down (screen goes black but backlight still on) I can still ssh into it. Is that expected?
The backlight never goes off under any conditions.
 
I cannot reproduce the shutdown issue using HDMI display. After shutdown you should not be able to SSH. I need to setup player with DSI display (official 7" display) to see if there is any difference. Probably there is some exception during shutdown process in the player with DSI display which causes the issue.

Regarding a backlight, it should go off after shutdown:
https://github.com/project-owner/Peppy/blob/0655be5202ecfef5de712ca4953353a47556b26b/peppy.py#L2809
Did you set the property 'use.display.backlight' to True?
https://github.com/project-owner/Peppy/blob/0655be5202ecfef5de712ca4953353a47556b26b/config.txt#L177