dupontgu / retro-ipod-spotify-client

The software that powers the sPot: a 4th generation "Click Wheel" iPod with a full Spotify client.
Apache License 2.0
892 stars 90 forks source link

No environmental variables, playback and refresh issues #34

Open trystendsmyth opened 3 years ago

trystendsmyth commented 3 years ago

Greetings! I'm excited about this project and I'm attempting to ensure the software is running smoothly before starting on the hardware. This means I have the raspberry pi zero outputting display to a monitor, and I'm either testing using an attached keyboard or via SSH.

Setup

I followed the base README instructions including the following suggested steps:

  1. Installed GIT and cloned this repo before installing requirements (see #22)
  2. Compiled the click wheel code (see #22)
  3. Created the .cache file when launching "sPot" failed (see #30)
  4. Added export DISPLAY=:0.0 to .bash_profile to stop it complaining about the xset commands in the console 🤷
  5. Added preserve-env argument to the autostart command because ENV variables were not being set (see #21)

In addition I have the following changes:

Problems

So these are already somewhat stated, but I've run into a couple of issues that I can't seem to resolve and I'm open to suggestion. They all seem to be related to authentication, but I'm really not certain.

  1. I only realized by accident that "sPot" was taking 5 minutes (almost exactly) to launch at start. In that time, I could interact with the desktop, so it wasn't frozen. I solved this delay by commenting out spotify_manager.refresh_data(), but this is not a long term solution. My guess is that this request has to time out before the interface displays eventually.
  2. When trying to manually run spotifypod.py from the desktop, I get the error "spotipy.oauth2.SpotifyOauthError: No client_id". I can't run from SSH at all.
  3. When taking a look at openbox environmental variables, I found that they are never set. I doubled checked everything and I could only get the SPOTIPY vars set by sourcing /etc/xdg/openbox/environment manually. Even then, it doesn't seem to affect anything - I get the same client_id error.
  4. I can tell the program is communicating with my Spotify account because it has my albums and such in the menu. That said, when selecting any song, it just sits at 0:00 and doesn't play anything or display the title or display play length.

I feel like I'm close to a correctly functioning program, but I'm just missing a detail or two. Any feedback here would be most assuredly appreciated. Cheers and many thanks to @dupontgu for the challenge!

paulomurray commented 3 years ago

https://github.com/dupontgu/retro-ipod-spotify-client/issues/40 i posted this issue recently

i too have an issue with the environment variables not being set each session basically need to export anew the client ID and env variables for Spotipy

i have other issues as well such as my export DISPLAY=:0.0 being in the .bash_profile (as are the ENV Variables such as CLIENT ID) and yet each session i run into the xset error you mention - and i need to re-export - and then it works once more (for that session)

and finally i have a .cache for spotifypod - providing access token - again - for that session - but i have to basically manually recreate the access token for spotify - as next time it expires -

and further - this token provides null values as the sPOT starts all the arrays such as playlists are empty "return SinglePlaylistPage(self.playlists[index], self) IndexError: list index out of range"

or the spotifypod just spins on "ints"

i feel these are similar issues to yours above - did you make any progress in storing permanently things like the ENV and TOKENS?

hoping you did take care

paulomurray commented 3 years ago

i set the CLIENT_ID in the ETC/ENVIRONMENT - this appears to over-ride every ENV in this system my system never asks for that client_id again i put the other Spotify values in there also as well as DISPLAY=0:0

that solved some of my issues in my last post

i am having issues now with the sPOT not displaying any playlists or artists or anything as appears blank

the error "return SinglePlaylistPage(self.playlists[index], self) IndexError: list index out of range"

i didnt change anything from the spotifypod.py nor view_model.py unclear why i get this error

any ideas

paulomurray commented 3 years ago

STEP 11 in the README will resolve the error "return SinglePlaylistPage(self.playlists[index], self) IndexError: list index out of range"

regarding your issue #4 "I can tell the program is communicating with my Spotify account because it has my albums and such in the menu. That said, when selecting any song, it just sits at 0:00 and doesn't play anything or display the title or display play length."

same issue i had be sure your follow issue #11 in the READ ME exactly that will refresh

but your raspotify may not be communicating the DEVICE correctly to the LIBRESPOT and RUST which will be required

can you confirm that your RASPOTIFY is performing corretly? type this systemctl status raspotify hit enter what errors you get assuming those errors with LIBRESPOT

trystendsmyth commented 3 years ago

@paulomurray thank you for your new information! I'm moving, which is why I haven't responded, but I will take a look at your suggestions as soon as possible and get back to you. Cheers!

XEROxMEXICANO commented 1 year ago

Hello did you ever get the software play music from it, When selecting it with the clickwheel?