Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Instruction Guide LCD/OLED display using pydPiper
Please re-post in English.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
Hello there,

Thanks to Remy for this Tutorial Smile

my Pi is working well with moode and pydPiper on my 20x4 LCD via I2C...

But I have no skills in re-programming the pagefile (pages_lcd_20x4.py)

I have tried to modify some, but in result the LCD had no output...

That's why I need help to modify it to have the following output on my LCD:

Line 1: Artist (scrolling if it is too long)
Line 2: Title (scrolling if it is too long)
Line 3: Time 0:00 / 6:00 (elapsed / total) as in picture of 20x4 from Remy here...
Line 4: progress bar (or clock time)

I would appreciate any help... maybe with a suitable pagefile for me??? Rolleyes

Greetings to all !!!
Reply
First post but before I get to the point I would just like to thank Tim and the team for all their work on Moode. I also think its worth me saying thanks to everyone on the forum for asking and answering the many questions us noobs ask, if it wasn't for the likes of members such as TheOldPresbyope, Drone7, TookaFace, adrii, Remy1961 and vinnn I wouldn't have made any progress on this journey. Although I havn't asked anything on the forums I can assure you that you have already answered and helped me indirectly by helping all the previous users with their issues (which I have poored over and learned so much from) and I think it was worth me writing these words just to remind you all, those mentioned and others not, that its appreciated.

Now a small contribution from me that hopefully might help someone else in the future. This is for the people using OLED's who are worried about long term screen burn. Please bear in mind that I am totally new to the raspberry pi, python and coding so I am pretty sure there may be other (possibly better) ways to achieve this, however it works so...


After playing around I realised that I like having the large clock display when Moode is stopped/paused but also in the long term that it will give screen burn, so I needed the clock to show for say 10mins then if no activity have the screen clear. After playing with the code I could get it functioning as I wished apart from pydPiper doesn't reset the timer after each state change, so after the clock being shown it would just blank the screen every subsequent time moode was paused without showing the clock first. Solving that was beyound me so I reached out to pydPiper's creator Dhrone and he kindly supplied a very simple code addition.

In displays/display.py add at line 1253
Code:
        self.end = 0

You'll also have to make a couple of additions/changes in the pages.py file that you use for the display.One is to create the blank canvas and the other is to call it in the correct sequence. In my case because I am using a SH1106 2.42' oled I edited 'pages_ssd1306.py'

First I created a new canvas
Code:
        'display_off': { 'widgets': [  ], 'size':(128,64) },

Then I called it during the 'seqStop' sequence.
Code:
        {
                'name': 'seqStop',
                'canvases': [
                        { 'name':'stoptimetemp_popup', 'duration':9999, 'conditional':"not db['outside_conditions']=='No data'" },
                        { 'name':'stoptime', 'duration':600, 'conditional':"db['outside_conditions']=='No data'" },
                        { 'name':'display_off', 'duration':9999, 'conditional':"db['outside_conditions']=='No data'" },
                ],
                'conditional': "db['state']=='stop' or db['state']=='pause'"
        },

The 'stoptime' 'duration' figure of 600 is what displays the clock, in my case for 600secs (10mins) then if there is no state change from moode the screen is blanked for 9999 secs (set in the display off call) or until a state change is detected. Obviously both these figures can be edited to suit your needs. Note, if you are using the weather screen instead of the clock then you would edit the 'stoptimetemp_popup' duration figure. Everything else would be the same.

As I said this is nothing exciting but it has solved an issue for me me and if I can manage as a complete noob to do these edits then I am hopefull it might help someone else.
Reply
Hi,
How to make the clock larger on a sh1106 128x64?
Thanks
Reply
(10-05-2020, 11:12 PM)Alaini93 Wrote: Hi,
How to make the clock larger on a sh1106 128x64?
Thanks

Assuming you are using the default settings then near the top in pages_ssd1306.py the font for the large clock is

Code:
TRUETYPE_FONTS = {
        'DejaVuSans28': { 'file':'DejaVuSans.ttf', 'size':28 }
}

You could try adjusting the font size or call a completely different font there.


Some formatting of the large clock is controlled by the 'ttime' widget in the same file so if you change the font details make sure you call them correctly in the 'ttime' widget too.  Smile

Code:
        'ttime': { 'type':'ttext', 'format':'{0}', 'variables':['utc|timezone+Europe/London|strftime+%-H:%M'], 'font':'DejaVuSans28', 'just':'right', 'varwidth':True },
Reply
Thanks Steve, I will try that.

Yes it worked, thank you  Big Grin
Reply
Hi everyone, It's a little bit I wasn't here.
I write to ask (if it's possible) to help me to solve this issue.

As you can see on the images below (pages file and picture of the display), using on the Canvas the widget "codec", it shows "var err".
It should be dinsplaying the filetipe (flac, mp3, dsd...) but it doesn't work.

Any suggestion? Using another OS, with te same custom pagefile everything is correct.

Thank you all in advance 


   
   
Reply
Hi
I am wander if somebody try to implement the REPRAP lcd to Moode on RPI board.
https://reprap.org/wiki/RepRapDiscount_F...Schematics

The board have Lcd 128X64, rotary encoder with push switch, sdcard socket. one push button and buzzer, .... and is very cheap.
I think this board is all i nead for standalone Moode audio player, with RPI0.

Thanks.

sorry for my english
Reply
Hi All,
I'm using old version of Moode audio with SSD1306 I2S OLED ( https://github.com/naisema/MoodeAudio-OLED " which works fine and it can display Chinese fonts/ songs title.
I upgraded to Moode 7.01 recently and use this OLED method, ( the above mentioned naisema method can't work with new Moode 7.01) but unfortunately it can't display Chinese fonts.
May I know if it is possible to add Chinese fonts please?
Reply
(01-31-2021, 12:54 PM)bigbulb Wrote: Hi All,
I'm using old version of Moode audio with  SSD1306 I2S OLED  ( https://github.com/naisema/MoodeAudio-OLED " which works fine and it can display Chinese fonts/ songs title.
I upgraded to Moode 7.01 recently and use this OLED method, ( the above mentioned naisema method can't work with new Moode 7.01) but unfortunately it can't display Chinese fonts.
May I know if it is possible to add Chinese fonts please?

What old version? No, wait, on the old version just execute the following from the command line:

Code:
dpkg --get-selections|grep fonts

Here is what I get on a moOde 7.0.1 player

Code:
pi@moode3a:~ $ dpkg --get-selections|grep fonts
fonts-dejavu-core                               install
xfonts-100dpi                                   install
xfonts-75dpi                                    install
xfonts-base                                     install
xfonts-encodings                                install
xfonts-scalable                                 install
xfonts-utils                                    install

If you are seeing Chinese characters being displayed, we should see some additional lines in this output. You'll need to install the same packages on your moOde 7.0.1 player.

Here's what is available in the way of Chinese fonts in the current Raspberry Pi OS repo

Code:
pi@moode3a:~ $ apt-cache search fonts|grep Chinese
fonts-arphic-bkai00mp - "AR PL KaitiM Big5" Chinese TrueType font by Arphic Technology
fonts-arphic-bsmi00lp - "AR PL Mingti2L Big5" Chinese TrueType font by Arphic Technology
fonts-arphic-gbsn00lp - "AR PL SungtiL GB" Chinese TrueType font by Arphic Technology
fonts-arphic-gkai00mp - "AR PL KaitiM GB" Chinese TrueType font by Arphic Technology
fonts-arphic-ukai - "AR PL UKai" Chinese Unicode TrueType font collection Kaiti style
fonts-arphic-uming - "AR PL UMing" Chinese Unicode TrueType font collection Mingti style
fonts-cns11643-kai - Chinese TrueType font, TW-Kai
fonts-cns11643-pixmaps - Chinese TrueType font, PNG 24x24 pixmaps
fonts-cns11643-sung - Chinese TrueType font, TW-Sung
fonts-wqy-zenhei - "WenQuanYi Zen Hei" A Hei-Ti Style (sans-serif) Chinese font
latex-cjk-chinese - Chinese module of LaTeX CJK
task-chinese-s - Simplified Chinese environment
task-chinese-t - Traditional Chinese environment
texlive-lang-chinese - TeX Live: Chinese
texlive-lang-cjk - TeX Live: Chinese/Japanese/Korean (base)
xfonts-intl-chinese - international fonts for X - Chinese
xfonts-intl-chinese-big - international fonts for X - large Chinese
fonts-moe-standard-kai - Chinese TrueType font, standard Kaiti (non-free)
fonts-moe-standard-song - Chinese TrueType font, standard Song (non-free)


If I didn't have the old installation to compare, I'd try installing the complete set of arphic fonts and the appropriate xfonts.

Code:
sudo apt-get install \
fonts-arphic-bkai00mp \
fonts-arphic-bsmi00lp \
fonts-arphic-gbsn00lp \
fonts-arphic-gkai00mp \
fonts-arphic-ukai \
fonts-arphic-uming \
xfonts-intl-chinese \
xfonts-intl-chinese-big

That downloads about 36MB of files which after installation consume 80+MB of disk space.

Might have to reboot to see the fonts take effect.

If that's not enough, you might also have to adjust the locale, in which case the first step is to compare the outputs from executing 'locale -a' commands on the old and new installations.

Regards,
Kent
Reply


Forum Jump: