Peppy player

Can you start the player manually from SSH session/terminal (e.g. Putty) so that UI would be displayed in the touchscreen? If it works you can use SSH terminal for console logging.

Regarding the Network, here is the file used by the player to get the network info:
Peppy/wifiutil.py at master * project-owner/Peppy * GitHub
Do you have the file /etc/wpa_supplicant/wpa_supplicant.conf in your system?
It's also using ifconfig and /var/run/wpa_supplicant
 
Last edited:
Oh and the logging:
Sure i can start Peppy with SSH/Putty and then i have the UI on the touchscreen.
But how do i see the log?

I wonder how you do it? I mean the programming...
Are you not working over SSH? And even if you do it directly on the RPi, then you have the UI on the screen and everything behind it?
 
To see the log messages in a console just set the following property to True in the config.txt:
Peppy/config.txt at 87daa889969de9b0215731785318e903b136219e * project-owner/Peppy * GitHub

I develop on Windows and when the feature is ready I test it on Pi. When I'm testing on Pi I usually use the Headless mode as it doesn't need any display connected to the Pi. So I start player from SSH terminal and use Web UI. If the feature needs display attached (which happens rarely) I start the player from SSH session using openvt and use SSH terminal for debugging. Also file logging works for me on Raspberry OS. I'm still not sure why it's not working in your case.
 
Sure console.logging is on.
And if i kill Peppy and the UI is gone i can see it on the scree.

You wrote
so that UI would be displayed in the touchscreen? If it works you can use SSH terminal for console logging.
I start Peppy from Putty with:
Code:
cd /home/haegarthehorrible/opt/Peppy && openvt -s -- python3 peppy.py
and thats it. Then there is nothing more in Putty and i can continue writing stuff there. The console logging stuff happens on the touchscreen behind the UI.
 
Yeah it happens so rarely that I forgot already how I do that :) You are right when you use openvt the logging happens in vt which you open. So I use either file logging or headless mode. The later works fine with or without display attached to Pi. I'm sorry for confusion.
 
No the touchscreen UI is the gone.
Must be another auto start problem. I'm using rc.local now and will look again at that systemd stuff later.

rc.local must be working because peppy is starting. Also I'm logged in if not headless.
Code:
su haegarthehorrible -c 'cd /home/haegarthehorrible/opt/Peppy; openvt -s -- /home/haegarthehorrible/opt/python-3.7.8/bin/python3 peppy.py'
If i enter the password i get:
Code:
ERROR:root:Command ["sudo", "iwlist", "wlp1s0", "scan"] returent non-zero exiz status 255.
I also changed in the wifiutil.py "eth0" to "eno1" and "wlan0" to "wlp1s0"

This network names are also long gone and if i remember right from my last Raspbian installation there also?
Or was it Armbian or DietPi maybe...

EDIT
Does Peppy expect that WiFi and Bluetooth are always on?
Seems like i have to do:
Code:
echo -e 'power on\nquit' | bluetoothctl
and
Code:
sudo ip link set dev wlp1s0 up
before going to network.
 
Last edited:
When you use the Headless mode you can start the player manually:
python3 peppy.py
from your Peppy folder.

Try to run that command manually in the terminal and see what will be the error?
sudo iwlist wlp1s0 scan


Those names are still there in the Raspberry OS
 
Last edited:
Ah OK. If i disable rc.local and start Peppy in Putty i have the console log also in Putty :)

Scanning WiFi works from the console. I tested WiFi and BT before i did install Peppy.

I now see errors that did not show up on the touchscreen.
The location for rfkill is wrong. It should be /usr/sbin
But i don't see a path i could change in the bluetoothutil.py

Code:
pygame 1.9.6
Hello from the pygame community. [URL="https://www.pygame.org/contribute.html"]Contribute - pygame wiki[/URL]
[2020-07-16 01:57:38,366] {bluetoothutil.py:89} DEBUG - Starting bluetoothctl utility...
/bin/sh: 1: rfkill: not found
[2020-07-16 01:57:38,375] {bluetoothutil.py:94} DEBUG - Cannot start bluetoothctl utility: Command 'rfkill unblock bluetooth' returned non-zero exit status 127.
[2020-07-16 01:57:38,376] {bluetoothutil.py:96} DEBUG - bluetoothctl utility started
[2020-07-16 01:57:38,376] {bluetoothutil.py:370} DEBUG - No data for Bluetooth device
[2020-07-16 01:57:38,561] {webserver.py:106} DEBUG - Web Server Started
[2020-07-16 01:57:38,722] {peppy.py:313} DEBUG - Audio Server Started

EDIT
Sorry, i forgot that the rfkill error was already there a view days ago.
 
Last edited:
If i first enable and connect my WiFi, and turn Bluetooth on and then go to Network i see all the information. But playing around there it then hangs at some point.

I don't see in wifiutil.py where wlan is enabled/disabled.
I dont see "ifconfig eth0 up" or "ifup" (the old way).

They way it works in CMD is:
Code:
~$ sudo ip link set dev wlp1s0 up
~$ sudo wpa_supplicant -i wlp1s0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B
~$ sudo dhclient wlp1s0
The commands are:
Code:
~$ sudo ip link set dev wlp1s0 up <<< Enable interface
~$ sudo dhclient wlp1s0           <<< Get IP
~$ sudo iwconfig wlp1s0           <<< Show WLAN info
~$ ip addr show wlp1s0            <<< Show IP
~$ sudo dhclient wlp1s0 -r        <<< Release IP
I guess Peppy does need the old NetworkManager and needs ifup/ifdown and maybe ethtool and nmcli?

Linux ip Command Examples - nixCraft

Its nice that now because of Raspberry so many people now to so much things.
But they should not carry over deprecated stuff from one Raspbian to the other. That way people will use that old stuff forever.

You said you develop on Windows. Python on Windows?
Or do you run a Linux VM? I guess not, because then you would come across this Debian/Ubuntu changes.

PS: I'm not complaining about Peppy or you. I really like Peppy and your focus is the RPi. I know how much work this is. Not that you get something wrong because of my English (bin ja eine echte Kartoffel :D )
 
I did install Turner on a RPi 3B+ and after login i see
Code:
Wi-Fi is currently blocked by rfkill.
Use raspi-config to set the country before use.
Trying to set the country via raspi-config i get: Could not communicate with wpa_supplicant

Adding "country=DE" manually to the wpa_supplicant.conf changes nothing.