Thank you for your donation!


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


Idea: Pirate Audio 240x240 cover display
#31
(03-13-2020, 01:50 AM)exviia Wrote: Thanks for your help but this replace not work for me...  iam put next text in rc.local:



Code:
# start TFT-Moode-CoverArt
/home/pi/TFT-MoodeCoverArt/tft_moode_coverart.sh -s > /dev/null 2>&1
/home/pi/TFT-MoodeCoverArt/tft_moode_coverart.sh -q
sleep 10
python3 /home/pi/TFT-MoodeCoverArt/tft_moode_coverart.py
....iam not programmer, but it work now.

Thanks for help rusconi !!

p.s. and my gpio config for pirate audio, if somebody need it

Glad it's working foe you.

did you need to add the 'sleep 10' command for it to start properly?

If so, it's probably because of the pi zero, and MPD not being fully started when the script starts

I've had to use the sleep command in the past for similar issues.

And thanks form sharing the gpio config


Russ
Reply
#32
(03-13-2020, 02:47 AM)Hi Russoni Thank you for you replying, I have it running now  I used  exviia\s start up code and all seems well when i press play on the Moode Audio interface. Thank you to exviia for sharing  his  work around : Wrote:
Code:
# start TFT-Moode-CoverArt
/home/pi/TFT-MoodeCoverArt/tft_moode_coverart.sh -s > /dev/null 2>&1
/home/pi/TFT-MoodeCoverArt/tft_moode_coverart.sh -q
sleep 10
python3 /home/pi/TFT-MoodeCoverArt/tft_moode_coverart.py
Smile
Reply
#33
Hi! Iam noob in programing. So, i have searched with google "delay script autorun raspbian" and used sleep command, because i needed script working after music started. At same time, in my case, it wasnt working..display was on, but no showed cover.

I hope you guys understand my english..
Reply
#34
(03-13-2020, 06:40 AM)prithesh Wrote:
(03-13-2020, 02:47 AM)Hi Russoni Thank you for you replying, I have it running now  I used  exviia\s start up code and all seems well when i press play on the Moode Audio interface. Thank you to exviia for sharing  his  work around : Wrote:
Code:
# start TFT-Moode-CoverArt
/home/pi/TFT-MoodeCoverArt/tft_moode_coverart.sh -s > /dev/null 2>&1
/home/pi/TFT-MoodeCoverArt/tft_moode_coverart.sh -q
sleep 10
python3 /home/pi/TFT-MoodeCoverArt/tft_moode_coverart.py
Smile
(03-13-2020, 10:25 AM)exviia Wrote: Hi! Iam noob in programing. So, i have searched with google "delay script autorun raspbian" and used sleep command, because i needed script working after music started. At same time, in my case, it wasnt working..display was on, but no showed cover.

I hope you guys understand my english..

Great that it works for both of you now.
The delay can be important, as the display script requires MPD to be running first.

Just some things..

what you have in rc.local
  1. Tries to start the script  - [/home/pi/TFT-MoodeCoverArt/tft_moode_coverart.sh -s > /dev/null 2>&1]
  2. Stops the script - [/home/pi/TFT-MoodeCoverArt/tft_moode_coverart.sh -q]
  3. waits 10 seconds
  4. Starts the script
the first 2 lines seem unnecessary to me.
removing

Code:
/home/pi/TFT-MoodeCoverArt/tft_moode_coverart.sh -s > /dev/null 2>&1
/home/pi/TFT-MoodeCoverArt/tft_moode_coverart.sh -q
or commenting to stop execution
Code:
#/home/pi/TFT-MoodeCoverArt/tft_moode_coverart.sh -s > /dev/null 2>&1
#/home/pi/TFT-MoodeCoverArt/tft_moode_coverart.sh -q

should work for you, although the delay might need to be increased to 12 or 15 seconds without those two script executions.

Removing those lines removes 2 places where things can fail.

and

Code:
python3 /home/pi/TFT-MoodeCoverArt/tft_moode_coverart.py
will be OK as long as it's the last command in rc.local. If you ever want to put anything in rc.local after this you well need to add an & at the end of this line, like ...

Code:
python3 /home/pi/TFT-MoodeCoverArt/tft_moode_coverart.py &

Of course, while it works for you, there's no need to change anything Big Grin

regards

Russ
Reply
#35
In my case..  If I leave only these two lines:


Code:
sleep 10
python3 /home/pi/TFT-MoodeCoverArt/tft_moode_coverart.py

with or without &.... or just leave only:
Code:
python3 /home/pi/TFT-MoodeCoverArt/tft_moode_coverart.py

....I always have a screen alltime like this, with "snow"... (foto).

rusconi  Thank you very much for explaining, I understand something, but things like "> /dev/null 2>&1" I don't understand what it is and why...

Important for me that everything is turned on with a single button to turn on zero pi (I have a battery for zero pi) and it is no longer necessary to have a pc, mobile, etc to see music information that sounds.

I have used google translator this time. Rolleyes Greetings!


Attached Files Thumbnail(s)
       
Reply
#36
@rusconi

Hey, it`s working real great now.

But I have another problem right now. Is it possible to use only the display of the Pirate Audio ? Everytime I changed the audio output to bluetooth, the display doesn`t work anymore. It stuck on the last image and the buttons also doesn`t work. If i switch back to the Pirate Audio, it worked again.
Reply
#37
(03-14-2020, 06:32 PM)juantronik Wrote: @rusconi

Hey, it`s working real great now.

But I have another problem right now. Is it possible to use only the display of the Pirate Audio ? Everytime I changed the audio output to bluetooth, the display doesn`t work anymore. It stuck on the last image and the buttons also doesn`t work. If i switch back to the Pirate Audio, it worked again.

My understanding is that bluetooth audio does not use mpd.

the display script requires mpd and will crash without it. Most song and image display data is obtained from MPD.

It only works with internet radio and the library at this stage.

Russ
Reply
#38
(03-15-2020, 12:55 PM)maartin Wrote: Hi there Russ and others,

my experience so far:

Running the script through ssh, TFT shows volume indicator, moode picture background, etc.
Starting a Radio (via Browser-GUI), sound is running, but no change on TFT-Screen, only volume indicator, moode background, etc.
Changing Station (via Browser-GUI) does not change TFT picture.




To me, this sounds like the script has crashed




Writing
Code:
sleep 10
python3 /home/pi/TFT-MoodeCoverArt/tft_moode_coverart.py

to rc.local and rebooting leeds to noisy TFT, and repeating error messages in browser GUI

Quote:MPD error
JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

So far...

By the way. Can i stop somehow the volume and button indicators, which i do not need.


All the Best
maartin

@maartin 

Do you mean just a cover and artist, title and album/station.?

Making the script more complex is part of me learning python, so I keep adding features Confused 

I'll look at making extras optional at start.

And a simpler script may work best for you.


Russ
Reply
#39
@maartin

I have added script 'coverdisplay-basic.py' that:

Only displays
  1. coverart
  2. Artist
  3. Album/Station
  4. Title
  5.  And only for Internet Radio and your moode library
after getting the update from github. [https://github.com/rusconi/TFT-MoodeCoverArt.git]

edit the rc.local ines to


Code:
# start TFT-Moode-CoverArt /usr/bin/python3
/home/pi/TFT-MoodeCoverArt/coverdisplay-basic.py &
the sleep command may or may not be required

Russ
Reply
#40
(01-11-2020, 07:59 PM)bobr80 Wrote: I've bought one of the Pimoroni Pirate Audio DAC that has a 1.3" IPS colour LCD (240x240px) (ST7789 driver) Pirate Audio: Line-out for Raspberry Pi
Id love to have the Cover artwork displayed on this, but my coding skills arnt up to it
any chance of this being a future feature?

(03-17-2020, 09:08 AM)maartin Wrote: Hi Russ,

i followed your instruction for the basic script. As result i could not see anything on the TFT.

I tried  changing  rc.local

Code:
# start TFT-Moode-CoverArt /usr/bin/python3
/home/pi/TFT-MoodeCoverArt/coverdisplay-basic.py &
to
Code:
# start TFT-Moode-CoverArt /usr/bin/python3
sleep 10
python3 /home/pi/TFT-MoodeCoverArt/coverdisplay-basic.py &

It helped a bit.
Now I see the moOde-logo. But changing stations does not change the TFT-display to show the stations.


I tried the full coverart script as well. Then my playlist, normally loaded on start, two stations, is not loaded. No Logo nor Stations visible on TFT.


Hopefully this does not drive you to crazy.
All the Best
maartin


PS: Instead of changing SPI going to raspi-config dtparam=spi=on can be added to config.txt

@maartin 

Apologies

My proof-reading is terrible.

Code:
#start TFT-Moode-CoverArt /usr/bin/python3
/home/pi/TFT-MoodeCoverArt/coverdisplay-basic.py &

should have read
Code:
#start TFT-Moode-CoverArt
/usr/bin/python3 /home/pi/TFT-MoodeCoverArt/coverdisplay-basic.py &

I'm expecting delivery of a 240*240 ST7789 TFT later this week.
My testing should be more complete after that

Russ
Reply


Forum Jump: