Create a driver for LCD1602 display

Need to create a Mopidy extension to drive the LCD1602 display. This will be based on the Pirate Audio PiDi display. The relevant folders are located under /usr/local/lib/python3.9/disp-packages

/usr/local/lib/python3.9/disp-packages
   |_/mopidy-pidi
   |_/pidi_display_pil
   |_/pidi_display_st7789
   |_/ST7789

Configuration is via the pidi section of mopidi.conf:

...
[pidi]
enabled = true
display = st7789
rotation = 90
...

mopidy-pidi

  • Defines the extension for mopidy.
  • Reads and verifies entries in mopidy.conf
  • Creates class PiDiFrontend that adds callbacks for various Mopidy events, like playlist_changed etc.
  • Implements class PiDi that contains an instance of the display defined in mopidy.config
  • Callbacks from mopidy are passed to the display object.

pidi-display-pil

This is a plugin for a Tk display. Used in the st7789 to do all the layout for the overlay and artwork. Not needed for the text display.

pidi_display_st7789

This is the display plugin for the st7789. This implements the interface required by the pidi display architecture (defined in PiDi Plugin.py) and adds a few extra arguments that can be added to the config file.

ST7789

This is the Adafruit driver for the ST7789 display. Handles all the low level stuff. Imports RP.GPIO to deal with the actual hardware.

New/Replacement modules

mopidy-txtdi

  • Defines the extension for mopidy.
  • Reads and verifies entries in mopidy.conf
  • Creates class TxtDiFrontend that adds callbacks for various Mopidy events, like playlist_changed etc.
  • Implements class TxtDi that contains an instance of the display defined in mopidy.config
  • Callbacks from mopidy are passed to the display object.

txtdi-display-RGB1620

RGB1620

This is Adafruit driver for the RGD1620 display.

Making it work

Mopidy crib  sheet
==================

Location of files: /usr/local/lib/python3.9/dist-packages/...

Stop/Start/Interactive
======================
As a service:
	sudo systemctl enable mopidy
	sudo systemctl stop mopidy
	sudo systemctl start mopidy
	sudo systemctl restart mopidy
	sudo systemctl status mopidy

At a terminal:
	mopidy
	mopidy --help
	
<ctrl>-C to exit.
Config file read from ~/.config/mopidy/mopidy.conf
Debug info goes to terminal


Fix to make files easy to edit:
    sudo su
    find /etc/weewx -exec chmod o+w {} \;
    find /var/www/html -exec chmod o+w {} \;