LCD ILI9341 screen + websocket API for Volumio2

Hi all,
I had this cheap 320x240 ILI9341 SPI screen laying around for a while, and I thought it would make a nice screen for a new Volumio player. After gathering information on the forum, I’ve found one thread about this kind of screen: https://forum.volumio.org/320x240-tft-control-sabre-es9023-dac-build-t2610.html .
Clipboard02.png
This project was done a long time ago and some improvements needed to be done but as I’m not a programmer and python was a dark mystery to me, this guy got me started, thanks Cobblers! So I hooked up everything on my Nespi case testbench.
IMG_20200425_155446.jpg
I’ve fixed some issues: memory leak of the adafruit library by avoiding the use of display buffer (need-example-usage-getstate-websocket-t5813.html) and not from MPD server.
Clipboard01.png
Also a big deal was CPU consumption, so I’ve made two threads to improve this : the music data collection is an event based thread, and the display thread is basically an infinite loop that run at the incredible speed of 1FPS!

youtu.be/jI1hF4xYoP8

This is a first version on a testbench, and there are a lot of improvements to do: you can see on the video above that the IP is not rendered properly ( there is a char ‘o’ at the end of it) even if the shell script is OK. (IP is displayed properly when I make a print(IP)…)
Also this Adafruit library is outdated, a new one is available using python 3, I tried to use it but it was more CPU resource consuming, and less flexible than the old one, so weird… As a result, the max frame rate I can get using the ‘old’ library is 3FPS and it uses 50% of CPU resources which is not proper. So I was not able to make a smooth enough text scrolling when title and albums are too long for the screen.

I think if I had to start it again or if someone wanted to use such a screen, I would not recommend to use this library, instead I would use one of the notro framebuffer based library, which are sometimes tweaked up to 60FPS ( github.com/juj/fbcp-ili9341) and develop a proper GUI using Pygame or Tkinter, but hey, if I knew at that time, I would have done it differently.

Anyway, thanks again to the Volumio dev team, you’ve done an open source masterpiece!

You can use this driver for lowering CPU consumption. It’s working great with Volumio

github.com/juj/fbcp-ili9341