Some news.
First, I dropped (for now) the power management, as having a Marlin UI plugin that manages the PSU makes no sense at all !
Repository reorganization :
PCBs and firmware : GitHub - yet-another-average-joe/MarlinOctoHat
Plugin : GitHub - yet-another-average-joe/OctoPrint_MarlinOSD_Plugin
Service : GitHub - yet-another-average-joe/OctoPrint_MarlinOSD_Service
Also, it is now possible to have a preview, and play with the Marlin UI appearance without electronics ; the demo mode is activated by default, and will display the typical blinking 12864 LCD. It is also displayed if something goes wrong with SPI (never happened, except after removing the BluePill form it's socket !)
Of course, the service has to be compiled and installed first !
Warning : SPI1 has to be free ! Pins GPIO16, GPIO19, GPIO20 and GPIO21 (= 36, 35, 38 and 40 on the header) !
This is made easy with the included makefile, after cloning the repository using the SSH terminal ; then change directory to the clone repo.
3 options :
Typing just make
will build the service : "marlin_osd.svc".
Typing make install
will build the executable, copy it to /root/run/systemd/system, then create the etc file in /root/etc/systemd/system, "register" the service, and start it.
Typing make uninstall
will completely undo what "make install" did, removing the files from the system directories.
Installing the service isn't even needed. just make and run ("./marlin_osd.svc"). There will be an error message about the SPI overay, it is normal.
Will also work with VNC :
sudo nano /root/.vnc/config.d/vncserver-x11
add BY HAND :
CaptureTech=raspi
IdleTimeout=0
(never worked for me copying/pasting from my notes )
(assuming you have a display defined in config.txt, X11, a window manager and a browser installed on your server !)
Currently learning how to add the service sources to the distro, and compile it : analyzing Octolapse's setup.py and directories structure !