Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No environmental variables, playback and refresh issues #34

Open
trystendsmyth opened this issue Apr 16, 2021 · 5 comments
Open

No environmental variables, playback and refresh issues #34

trystendsmyth opened this issue Apr 16, 2021 · 5 comments

Comments

@trystendsmyth
Copy link

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:

  • SPOTIPY_REDIRECT_URI is set to http://127.0.0.1 with no port specified because I can't determine what else is correct.
  • I replaced spotify_manager.refresh_devices() with spotify_manager.refresh_data() in view_model.py as the instructions suggested, but found out that this caused "sPot" to take exactly 5 minutes to start at launch! SO - I commented out both commands for now.

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
Copy link

#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
Copy link

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
Copy link

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
Copy link
Author

@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!

@xenon0054
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants