project-owner / Peppy

Peppy Player Repository
GNU General Public License v3.0
72 stars 14 forks source link

Peppy's unstable work #48

Closed AlexPtushkin closed 1 year ago

AlexPtushkin commented 1 year ago

Hi! I use peppy, Waveshare 3.5" LCD (B) display and shutdown device. When there was no display there were no problems. The radio worked for days. After connecting the display, problems began.

  1. The radio may work for a long time, but then does not respond to touching the display. The browser also does not switch and there is a peppy screensaver. The screensaver works on the screen. Reboot helps.
  2. Sometimes Peppy turns off on his own. The reason is not clear. How to enable logs to identify the causes of problems. How to fix these problems. Pippi can work for a long time for 5-6 hours. I can take a video when the touch screen freezes. If you select the setting, you can reboot Peppy there.

Best regards, Alex

project-owner commented 1 year ago

Hi, the file logging should be enabled (set to True) here: https://github.com/project-owner/Peppy/blob/c4b55544bbaca5930f74c2d609bc285bc47d7629/configuration/config.txt#L33 also make sure that the appending was enabled as well, otherwise the player will create new log file on startup: https://github.com/project-owner/Peppy/blob/c4b55544bbaca5930f74c2d609bc285bc47d7629/configuration/config.txt#L35 logging of mouse events should be enabled if you want to see that touch events are logged: https://github.com/project-owner/Peppy/blob/c4b55544bbaca5930f74c2d609bc285bc47d7629/configuration/config.txt#L38

When it hangs, log into Pi using SSH and check the latest messages in the log file /home/pi/Peppy/peppy.log Hopefully there will be messages which will help to find the root cause.

Also it would be helpful when it hangs to check the memory and CPU utilization on Pi.

Best regards

project-owner commented 1 year ago

Which screensaver do you use when the player hangs? You can use the Monitor screensaver to see the memory and CPU utilization on Pi.

AlexPtushkin commented 1 year ago

Hi I use random Screenshot_2 I turned everything on and will fix the problem

AlexPtushkin commented 1 year ago

Hi The screensaver froze. Memory and CPU load is attached: Screenshot_3 peppy.log It doesn't respond to the power button either. I didn't overload

[logging] file.logging = True log.filename = /home/pi/Peppy/peppy.log append = True console.logging = False enable.stdout = True show.mouse.events = True

project-owner commented 1 year ago

Hi,

Is it always the same screensaver which hangs (Clock or Weather)? Can you try to use a single screensaver for example Clock? Does it make any difference?

I don't see anything suspicious in the log file. Could you also try to disable (set to False) displaying album art and see if that helps? https://github.com/project-owner/Peppy/blob/c4b55544bbaca5930f74c2d609bc285bc47d7629/configuration/config.txt#L22

Best regards

AlexPtushkin commented 1 year ago

I turned off the display of albums. I'm sending a log when Peppy turned off on its own. I don't know when he did it. I was not at home. peppy.log Where did the shutdown command come from?

project-owner commented 1 year ago

Could you set your player into the Headless mode, disconnect display and check if it will hang after that? https://github.com/project-owner/Peppy/blob/c4b55544bbaca5930f74c2d609bc285bc47d7629/configuration/config.txt#L20 I'm just trying to understand if the display is a root cause.

I don't see any shutdown command in the log. You attached the same log file.

AlexPtushkin commented 1 year ago

I came home at 23-40, the radio was turned off. I turned it on and pressed the power button. Parameter 11 is already false headless = False

browser.stream.player = False voice.assistant = False headless = False vu.meter = False album.art = False auto.play = True

Set to headless = True?

project-owner commented 1 year ago

Yes, set headless = True, disconnect display, turn it on and check if it will hang in a Headless mode.

AlexPtushkin commented 1 year ago

Okay, that's what I did

project-owner commented 1 year ago

OK, please let me know if it will hang or not.

AlexPtushkin commented 1 year ago

Hi! Today Peppy worked for a long time and froze. In the browser screen saver: Screenshot_8 Screenshot_5 The radio works, but there is no control. You can enter the settings, but you can’t change the station. As long as I don't overload.

project-owner commented 1 year ago

OK, this is without display, right? So, we can eliminate the display as a root cause. Memory and CPU looks OK. Do you still use the Random screensaver? Can you use just a single screensaver (e.g. Clock)? When you click in Web UI do you see those events in the log file?

AlexPtushkin commented 1 year ago

OK. The display is turned off. The screensaver has set the clock. Let's look further. When I select the clock, there is no entry in the log file, but it works

AlexPtushkin commented 1 year ago

At 11:30 p.m. the order to turn it off came. I can't figure out where. The radio turned off. At 00-11 I turned it on again. peppy.log

project-owner commented 1 year ago

Hmm, there is no any shutdown command in the log file. Is it possible that there is some issue with your Internet connection and player just cannot recover?

project-owner commented 1 year ago

Could you also disconnect your shutdown device if it's still connected?

AlexPtushkin commented 1 year ago

Hi! It worked overnight without any problems. If Wi-Fi disappears, does Peppy turn off?

project-owner commented 1 year ago

Hi,

It doesn't turn off but at some circumstences it can probably hang - become unresponsive. What did you change? Did you set just one screensaver and removed your shutdown electronics? Please test it more. If it works without issues for a long time could you start adding stuff which you removed (screensaver, electronics etc). To see what actually causing the issue.

Thanks a lot for testing!

AlexPtushkin commented 1 year ago

Okay, I'll test it.

AlexPtushkin commented 1 year ago

Hi! I worked all day without the display. The shutdown circuit is connected. Screensaver clock. Waveshare 3.5" RPi LCD Display (A) . Maybe I bought the wrong one? I don’t like that if I try to measure the 5V voltage on pins 4-6 with a tester, Peppy turns off. I measured the power supply at 5.14V. I connected the display, peppy worked a little and turned off. I'm upset and don't know what to do...

project-owner commented 1 year ago

Hi, very often the power supply causes this kind of issues. How powerful is your power supply? It should be at least 3A. Can you try more powerful power supply?

AlexPtushkin commented 1 year ago

Good afternoon, I will change the power supply to 3A. I already understood that. About freezing: There are no problems with the clock screensaver. When the screensaver was random it froze. Now I put on a slideshow. I'm watching. The one who walks will master the road! Best regards, Alex

project-owner commented 1 year ago

Hi, if the power supply is the root cause and you disconnected the display then more likely you will not face the issue and the player will work fine with any screensaver.

Best regards

AlexPtushkin commented 1 year ago

Good afternoon. With the clock and logo screensaver, the player works without freezing. On the screensaver, the random player works, but I can’t change stations. I can go into the configuration and reload it. I can't change the station. Alex

project-owner commented 1 year ago

Do you mean the random screensaver causes the issue? I guess the display is not connected. When the problem occurs does the random screensaver change savers or it hangs on one saver? If it hangs on one saver which saver is that (clock, logo or weather)?

AlexPtushkin commented 1 year ago

The display is not connected. When you select randomly, you can’t see in the browser which bookmark it’s stuck on. We determined that the logo does not hang on the watch. I turned on the weather tab.

AlexPtushkin commented 1 year ago

Please see what happened on 11.10 at 12-00. I arrived at 14-15 the radio did not work. Overloaded on power. peppy.log

AlexPtushkin commented 1 year ago

If the clock and logo tab is selected in random mode, there are no problems. I selected the weather tab and got stuck. I'll check again.

project-owner commented 1 year ago

According to the messages in the log file here is what happened:

I'll try to reproduce the issue and see how that can be fixed. Thanks!

AlexPtushkin commented 1 year ago

Today the radio worked all night without problems. I'll try to use the weather tab again. I doubt that the number of requests to the api.openweathermap.org site has exceeded the limit. I install 1 time per minute. There may be a problem with the 2G Wi-Fi network. Why doesn't Peppy see my 5G set? If you just download RasperiPI, then it is there. It's not in Peppy. Screenshot_3

Screenshot_4

project-owner commented 1 year ago

Do you use your own API Key for the OpenWeather web service? If not, then the requests from all Peppy players around the world will sum up.

I'm not sure why the player doesn't see that particular network. The player runs the following command (ip -j a) to get networks: https://github.com/project-owner/Peppy/blob/c4b55544bbaca5930f74c2d609bc285bc47d7629/util/wifiutil.py#L102 You can run the same commands from the terminal and see if that network is in the result list.

AlexPtushkin commented 1 year ago

Yes, I am registered and use my own API key for the OpenWeather web service. This is the command: sudo iwlist wlan0 scan

In the raspberrypi log there is network Tenda_Ptu_5G. Peppy is not in the log. Maybe the driver is not initializing correctly?

raspberrypi.txt log_peppy.txt

project-owner commented 1 year ago

What is minipc? Is it different user on the same Pi or different Pi? Is Peppy running on Pi 3 or Pi 4? Where is minipc user? Is it on Pi 3 or Pi 4?

project-owner commented 1 year ago

I've tried to fix the issue with the Weather screensaver in a browser. Could you do me a favor and test the fix?

This file: https://github.com/project-owner/Peppy.doc/blob/master/files/websocket.js should be placed in the folder /home/pi/Peppy/web/client

This file: https://github.com/project-owner/Peppy.doc/blob/master/files/websockethandler.py should be placed in the folder /home/pi/Peppy/web/server/handlers

And finally this file: https://github.com/project-owner/Peppy.doc/blob/master/files/weatherutil.py should be placed in the folder /home/pi/Peppy/screensaver/peppyweather

After these changes the player will print into log file more information if it cannot connect to the OpenWeather site. Also the player will be pinged from browser every 15 seconds to keep the webSocket connection alive even when there is no messages from the player during 20 seconds.

Please let me know if the issue is fixed and there is no any side effects. Thank you!

AlexPtushkin commented 1 year ago

nipc? Is it different user on the same Pi or different Pi? Is Peppy running on Pi 3 or Pi 4? Where is minipc user? Is it on Pi 3 or Pi 4?

I made a test PC. Downloaded the image https://www.raspberrypi.com/software/ Screenshot_4 I deployed the OS and attached the display. Executed the commands to install display drivers. Then in the network tab I saw Wi-Fi 2G and 5G. It's strange why Peppy doesn't see my 5G. There are fewer people there and it will work better than 2G.

project-owner commented 1 year ago

Yes, it's strange because it shows other 5G networks: apt118_5GHz and TP-LINK_2313_5G

AlexPtushkin commented 1 year ago

I've tried to fix the issue with the Weather screensaver in a browser. Could you do me a favor and test the fix?

This file: https://github.com/project-owner/Peppy.doc/blob/master/files/websocket.js should be placed in the folder /home/pi/Peppy/web/client

This file: https://github.com/project-owner/Peppy.doc/blob/master/files/websockethandler.py should be placed in the folder /home/pi/Peppy/web/server/handlers

And finally this file: https://github.com/project-owner/Peppy.doc/blob/master/files/weatherutil.py should be placed in the folder /home/pi/Peppy/screensaver/peppyweather

After these changes the player will print into log file more information if it cannot connect to the OpenWeather site. Also the player will be pinged from browser every 15 seconds to keep the webSocket connection alive even when there is no messages from the player during 20 seconds.

Please let me know if the issue is fixed and there is no any side effects. Thank you!

The weather stopped working.

AlexPtushkin commented 1 year ago

nipc? Is it different user on the same Pi or different Pi? Is Peppy running on Pi 3 or Pi 4? Where is minipc user? Is it on Pi 3 or Pi 4?

I made a test PC. Downloaded the image https://www.raspberrypi.com/software/ Screenshot_4 I deployed the OS and attached the display. Executed the commands to install display drivers. Then in the network tab I saw Wi-Fi 2G and 5G. It's strange why Peppy doesn't see my 5G. There are fewer people there and it will work better than 2G.

This is what confuses me. I can’t understand it myself.

project-owner commented 1 year ago

Please make sure that you placed files in correct folders. To restore to the previous files you can download them from here: https://github.com/project-owner/Peppy

AlexPtushkin commented 1 year ago

Please make sure that you placed files in correct folders. To restore to the previous files you can download them from here: https://github.com/project-owner/Peppy

I saved the original files. I put the new files in the specified location. The weather tab does not work (does not show)

Returned original files

AlexPtushkin commented 1 year ago

Your build Linux raspberrypi 5.10.52-v7l+ #1441 SMP Tue Aug 3 18:11:56 BST 2021 armv7l GNU/Linux

I downloaded and deployed: Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux Screenshot_8

Wi-Fi points see more and my 5G

Can everything be assembled on a more recent kernel?

AlexPtushkin commented 1 year ago

I decided to build on a new kernel. I did everything according to your instructions. Executed the commands and settings: sudo apt-get update sudo apt-get upgrade

sudo raspi-config sudo reboot

sudo usermod -a -G tty pi sudo nano /lib/udev/rules.d/50-udev-default.rules

replace from SUBSYSTEM=="tty", KERNEL=="tty[0-9]", GROUP="tty", MODE="0620" to SUBSYSTEM=="tty", KERNEL=="tty[0-9]", GROUP="tty", MODE="0660"

sudo apt-get install python3-pygame

wget https://www.dropbox.com/s/0tkdym8ojhcmbu2/libsdl1.2debian_1.2.15+veloci1-1_armhf.deb sudo dpkg -i libsdl1.2debian_1.2.15+veloci1-1_armhf.deb sudo apt-get -f install rm libsdl1.2debian_1.2.15+veloci1-1_armhf.deb

sudo apt-get install python3-pip

sudo apt-get install vlc pip3 install python-vlc

sudo apt-get install eject sudo apt-get install bluealsa sudo apt-get install sqlite3 sudo apt-get install udisks2 sudo apt install python3-smbus sudo apt-get install python3-serial pip3 install tornado pip3 install RPi.GPIO pip3 install discogs_client pip3 install pynanosvg pip3 install feedparser pip3 install mutagen pip3 install pexpect pip3 install Pillow pip3 install rpi-backlight pip3 install pyudev pip3 install pyowm pip3 install youtube-dl==2020.12.2 pip3 install pafy pip3 install numpy -U pip3 install psutil pip3 install yahooquery pip3 install vosk sounddevice pip3 install beautifulsoup4 pip3 install -U requests pip3 install internetarchive

echo 'SUBSYSTEM=="backlight",RUN+="/bin/chmod 666 /sys/class/backlight/%k/brightness /sys/class/backlight/%k/bl_power"' | sudo tee -a /etc/udev/rules.d/backlight-permissions.rulesecho 'SUBSYSTEM=="backlight",RUN+="/bin/chmod 666 /sys/class/backlight/%k/brightness /sys/class/backlight/%k/bl_power"' | sudo tee -a /etc/udev/rules.d/backlight-permissions.rules

sudo apt-get install git-core

cd /home/pi sudo git clone https://github.com/project-owner/Peppy.git sudo wget https://raw.githubusercontent.com/project-owner/Peppy.doc/master/files/peppy.service sudo mv peppy.service /etc/systemd/system sudo systemctl daemon-reload sudo systemctl enable peppy.service

sudo reboot

Peppy didn't earn any money. Maybe I missed something?

project-owner commented 1 year ago

Hi, those files work for me. Are you sure that you copied them into proper folders and didn't change the content? Could you try one more time and let me know what is the error in the log (if any). Thanks!

Yes, the disk images use pretty old OS version (buster). I was waiting for the new version (bookworm) which they released just a couple days ago: https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-32-bit Switching to the new OS is a big change as I need also to swicth to the new versions of Python, PyGame, video system etc.

Yes, Peppy is a free player. I'm thinking about a commercial version and what should be in it.

Best regards

AlexPtushkin commented 1 year ago

Okay, I understand you. If you change the region to US, the 5G channels will be unlocked until you reboot. The commercial version is interesting. I have something to offer her. I will postpone the new version so as not to waste your attention on analyzing errors. Maybe I'm just doing something wrong. I'm waiting for the power supply. Files that do not work to solve the weather problem.

project-owner commented 1 year ago

OK, if you have any ideas regarding a commercial version please drop me a message using my e-mail which you can find in my profile. I'll close this issue as it becomes too long. If you will face any other issues feel free to open another one.

Best regards