Moode Forum
[PROBLEM] Use of Metadata file and LCD update engine - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: [PROBLEM] Use of Metadata file and LCD update engine (/showthread.php?tid=5229)



Use of Metadata file and LCD update engine - sergi - 12-07-2022

Hi all,

I am using moode v8.2.2. I have a round display (GC9A01) for which I installed the drivers and created a standalone script to write to it via SPI. All working good.

I want to show current song info in the display. I know the option to enable the Metadata file (stored in /var/local/www/currentsong.txt) but I am not sure how that has to be consumed by the next option (LCD update engine) which is a python script consumed by a shell daemon?

I can do that from a standalone script, even in a loop every 0.5 or 1 seconds. But I did not manage to use the script inside the /var/local/www/commandw/lcd-updater.py, it complains about the import:


Code:
from lib import LCD_1inch28


Output:

Code:
ImportError: cannot import name 'LCD_1inch28' from 'lib' (unknown location)



Thank you so much for any guidance


RE: Use of Metadata file and LCD update engine - sergi - 12-07-2022

OK, I used the rubber duck debugging technique, I needed to fix the path to the driver Smile

Now, a general question about how the lcd-updater daemon still remains.

Is the python file always running? Or is it executed every time the UI changes? I need to know in order to adjust the way to clean/rewrite to the display

Thank you


RE: Use of Metadata file and LCD update engine - Tim Curtis - 12-07-2022

The LCD Updater daemon uses "inotifywait -e close_write" to detect a change in the currentsong.txt file and then run the python script. The currentsong.txt file is updated by worker.php within 3 seconds of a change in the UI.

The python script does not need its own timing loop since thats being done externally by the LCD Updater engine. The engine only calls the script when there has been a change to currentsong.txt. The script simply needs to parse currentsong.txt and write to the screen.

Also, IIRC the LCD Update engine won't be the right solution if side-scrolling text is desired because the timing loops needed for side-scrolling conflict with the external loop in the LCD updater. In this case you will need to write a dedicated script with its own timing loop and side-scrolling loop(s). Something like that.


RE: Use of Metadata file and LCD update engine - sergi - 12-07-2022

(12-07-2022, 04:01 PM)Tim Curtis Wrote: Also, IIRC the LCD Update engine won't be the right solution if side-scrolling text is desired because the timing loops needed for side-scrolling conflict with the external loop in the LCD updater. In this case you will need to write a dedicated script with its own timing loop and side-scrolling loop(s). Something like that.

Thank you

Exactly, what I had in mind with my last question was about that scroll I want to use. So basically, I have to keep the metadata option on, but lcd updater off. And then a script has to be run on start and basically be a loop. I guess.

Is there a file I can edit to specify the script I want to run on init?