Skip to main content

@Chicks, thank you for the port of your touchscreen controller to a view only HDMI code.  

I’ve got your code installed on my Pi Zero W, auto login to shell, the Sonos.py script auto-running and edited to my named speaker group, and it connected to the HDMI on the big-screen.  Unfortunately, the Pi isn’t showing the artwork/music on screen, just the bash prompt after the linux boot menu.

Can you direct me to what I am missing from the auto-run or the python or the output variable for the screen? Is there one more utility to be the front end?  Maybe my systmctrl of the Sonos app isn’t running?

I needed to chmod your utility to executable, so that should be OK now…. Thoughts?

Did you run the install step for the font?

 

sudo apt install ttf-dejavu

 

 


That library was missing. Thank you.  So now I’m getting a crash without details.

pi@raspberrysonos:~/sonos $ python3 sonos.py

Illegal instruction

This could be because of lack of fonts.  When I add the font library, after updating Debian on the Pi I get: E: Unable to locate package ttf-dejavu

Can I use a default system font that is sans, to be more modern?  Did you pick that because it scales to large format better than system fonts?


Actually, I my have documented that incorrectly. Try:

 

sudo apt install libopenjp2-7-dev

 


Ok, so looks like you didn’t do all the install steps from section 8 of the readme, specifically the jpg library install, which is required by PIL. 
 

Starting here:

sudo apt install libopen-jp2-7-dev

sudo apt install libtiff5

sudo apt install ttf-dejavu

pip3 install soco

pip3 install Pillow


Ok, thank you for the insight on the console view.  I’m getting a break at Image.py; which does exist in that directory.  I do not see libopenjp2.so.7 in the directory however.

  File "/home/pi/sonos/sonos.py", line 20, in <module>

    from PIL import Image

  File "/home/pi/.local/lib/python3.9/site-packages/PIL/Image.py", line 89, in <module>

    from . import _imaging as core

ImportError: libopenjp2.so.7: cannot open shared object file: No such file or directory


I don’t have this set up any more, or any Sonos products running at the moment, but a couple of things to check.

Try sudo journalctl -u sonos.service  to see if/why it fails to start.

Run sudo systemctl stop sonos.service, then start it manually from the cmd prompt:

   cd ~ 

   cd sonos

   python3 sonos.py

 

Make sure you’ve done all the steps outlined, including giving the “pi” user membership in video group:

  sudo usermod -a -G video pi

 

Around line 288 in sonos.py: fb = open(“/dev/fb0”, “wb”).  It’s possible that your pi is using fb1 for HDMI vs fb0, especially if there’s another screen installed locally.