How I got everything working

Installing SpotifyPod (The code is modified for Ricardo's Alternate Build)
What you need to do before installing SpotifyPod
You need raspberry pi lite os legacy version We will also be using raspotify version 0.14 which we will be installing later
IMPORTANT This code works 2inch LCD Module ST7789V controller 240 x 320 Pixels For more hardware instructions please follow Ricardo's Alternate Build)
Installing updates
sudo apt-get update -y
sudo apt-get upgrade -y

Install Required Packages
sudo apt install python-setuptools python3-setuptools -y

sudo apt install python3-pip -y

sudo wget https://github.com/dtcooper/raspotify/releases/download/0.14.0/raspotify_0.14.0.librespot.20200130T014147Z.3672214_armhf.deb

sudo apt-get install python3-tk -y

sudo apt-get install redis-server -y

sudo apt-get install openbox -y

sudo apt install xorg -y

sudo apt-get install lightdm -y

sudo apt-get install x11-xserver-utils -y

sudo apt-get install git -y

Change directory to home
cd ~

Clone this repo and Install Dependencies
sudo dpkg -i raspotify_0.14.0.librespot.20200130T014147Z.3672214_armhf.deb

git clone https://github.com/dupontgu/retro-ipod-spotify-client

cd retro-ipod-spotify-client/frontend

pip3 install -r requirements.txt

Installing Pi-btaudio
git clone https://github.com/bablokb/pi-btaudio.git

cd pi-btaudio

sudo tools/install

Install PigPio
wget https://github.com/joan2937/pigpio/archive/master.zip

unzip master.zip

cd pigpio-master

make

sudo make install

Setup spotify API
Create a Spotify Developer Account, then create an app where you will get your Client ID, Client Secret, and create a Redirect URI
https://developer.spotify.com/dashboard/applications/

Add an app name and description can be anything

Save Client id and Save Secret id

Disable screen blanking
sudo raspi-config
Display Option > Screen Blanking > OFF / Disable

Disable Cursor and Screen Savers
Add or Create and Add this:
sudo nano ~/.bash_profile

Then:
'#!/bin/bash'

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor

# Disable any form of screen saver / screen blanking / power management

xset s off

xset s noblank

export SPOTIPY_CLIENT_ID='your_SPOTIPY_CLIENT_ID'

export SPOTIPY_CLIENT_SECRET='your_SPOTIPY_CLIENT_SECRET'

export SPOTIPY_REDIRECT_URI='http://localhost:8080'

export DISPLAY=:0.0

Configure Xintric
sudo nano /etc/X11/xinit/xinitrc

#!/bin/sh

# /etc/X11/xinit/xinitrc
# global xinitrc file, used by all X sessions started by xinit (startx)
# invoke global X session script
#. /etc/X11/Xsession'

exec openbox-session #-> This is the one that launches Openbox ;)`

Run "spotifypod.py" with Autostart
sudo nano /etc/xdg/openbox/autostart

Then paste this before exit
#cd /home/pi/retro-ipod-spotify-client/frontend/
#sudo -H -u pi --preserve-env=SPOTIPY_REDIRECT_URI,SPOTIPY_CLIENT_ID,SPOTIPY_CLIENT_SECRET python3 spotifypod.py &
#sudo /home/pi/retro-ipod-spotify-client/clickwheel/click &

Please comment this out until I remind you to uncomment it, save the file and exit, then we are now going to make the the program that makes the clickwheel work an executable
cd /home/pi/retro-ipod-spotify-client/clickwheel
nano click.c

change #define DATA_PIN 25 to #define DATA_PIN 5
gcc -Wall -pthread -o click click.c -lpigpio -lrt

when were running "gcc -Wall -pthread -o click click.c -lpigpio -lrt" just leave it alone till you see a blinking text box
sudo chmod +x click

Spotify credentials
sudo nano /etc/xdg/openbox/environment

export SPOTIPY_CLIENT_ID='your_SPOTIPY_CLIENT_ID'

export SPOTIPY_CLIENT_SECRET='your_SPOTIPY_CLIENT_SECRET'

export SPOTIPY_REDIRECT_URI='http://localhost:8080'

Synchronize Spotify Data
Synchronizing Spotify data! Last but not least, if you want to make sure all your playlists artists, etc are synchronized every time you turn on your Spotypod, you can simply modify the script view_model.py
sudo nano view_model.py

go to line 16
#spotify_manager.refresh_devices()

spotify_manager.refresh_data()

Configure Raspotify
sudo nano /etc/default/raspotify

Uncomment and fill the following line:
OPTIONS="--username XXXXXXXX --password XXXXXXXXX"

Enter your spotify login details, In the first XXX add your email address, and in the second XXX add your password
Ex:
OPTIONS="--username<EMAIL_ADDRESS>--password thisismypassword"

Paste the following
# The displayed device type in Spotify clients.
# Can be "unknown", "computer", "tablet", "smartphone", "speaker", "tv",
# "avr" (Audio/Video Receiver), "stb" (Set-Top Box), and "audiodongle".
DEVICE_TYPE="smartphone"

Entering Device id
To obtain your device id you first have to go to https://developer.spotify.com/console/get-users-available-devices/
when you go the the website your ipod may not appear connect to it using the spotify app on the device list then retry the website and it should show up
cd /home/pi/retro-ipod-spotify-client/frontend/

nano spotify_manager.py

Go to line 173 using ctrl+shift+_ and type 173 You can comment out the entire refresh_device def and replace it with
def refresh_devices():
    device = UserDevice('xxxxxxxxxxxxxxxxxxxxxxxxxxxxx','raspotify', True)
    DATASTORE.setUserDevice(device)

Replace the XXXXXXX with your device id
Ex:
def refresh_devices():
device = UserDevice(‘123456789','raspotify', True)
DATASTORE.setUserDevice(device)
After that you want to go save and exit the file then
cd ~/.local/lib/python3.7/site-packages/spotipy/

nano client.py

Go to line 1734 using ctrl+shift+_
Paste this in:
data = {"device_ids": ["xxxxxxxxxxxxxxxxxxxxxxxxxx"], "play": force_play}
    return self._put("me/player", payload=data)

Replace the xxxxxx with your device id
Post Install
Generate .cache files
sudo apt install midori

cd ~

git clone https://github.com/perelin/spotipy_oauth_demo

cd ~/spotipy_oauth_demo

sudo apt-get install python-pip python-dev

sudo apt-get install python3-pip python-dev

pip install -r requirements.txt

Before running it modify the client id and secret also your scopes  in with:
nano spotipy_oauth_demo.py

Scope:
SCOPE = "user-follow-read," \
        "user-library-read," \
        "user-library-modify," \
        "user-modify-playback-state," \
        "user-read-playback-state," \
        "user-read-currently-playing," \
        "app-remote-control," \
        "playlist-modify," \
        "playlist-read-private," \
        "playlist-read-collaborative," \
        "playlist-modify-public," \
        "playlist-modify-private," \
        "streaming," \
        "user-follow-modify," \
        "user-follow-read"

Now you can save and exit the file
before reboot do the following:
sudo raspi-config

system options --> boot / auto login --> console autologin

Turn on vnc or connect a mouse to the pi, then reboot
Then you can run this program:
python spotipy_oauth_demo.py

Recommend using a Pi 4 or anything faster than a zero w, but if this is the only pi you have you should be fine but it will take a while.  Once you did that go to http://localhost:8080/ There should be a spotify sign in page, sign in, once signed in it should redirect you to a page with gibberish code and spotify credits. Once you're on that screen exit the page and in your terminal stop running the program.
Now move your cache file to the one in spotifypod
cp ~/spotipy_oauth_demo/.spotipyoauthcache ~/retro-ipod-spotify-client/frontend/.cache

chmod 777 ~/retro-ipod-spotify-client/frontend/.cache

Once your done you can turn off vnc
If you get ERNO98 already in use go to issue 30
Install Display code
ssh into the pi and edit the config file
sudo nano /boot/config.txt

Add the code below:
DIsplay code
hdmi_group=2
hdmi_mode=87
hdmi_cvt=320 240 60 1 0 0 0
hdmi_force_hotplug=1
Also you have to comment out this code:
dtoverlay=vc4-kms-v3d

Then save it, after that download the display code:
sudo apt install cmake git
cd ~
git clone https://github.com/juj/fbcp-ili9341.git
cd fbcp-ili9341

Then we want to change the native resolution to take advantage of the whole display.
nano st7735r.h

Go to line 18 which is ST7789
Change DISPLAY_NATIVE_HEIGHT from 240 to 320
After that save it and then nano into st7735r.cpp
nano st7735r.cpp

Go to line 95 with ctrl+shift+_
Comment out the line beginning with SPI_TRANSFER with // then below it add this:
SPI_TRANSFER(0x37, 0, 0);

Then exit the file then run this command:
mkdir build

cd build

cmake -DST7789=ON -DGPIO_TFT_DATA_CONTROL=24 -DGPIO_TFT_RESET_PIN=25 -DSPI_BUS_CLOCK_DIVISOR=30 -DSTATISTICS=0 -DDISPLAY_BREAK_ASPECT_RATIO_WHEN_SCALING=ON -DUSE_DMA_TRANSFERS=OFF ..

Once finished run:
make -j

After that is finished we want to make it run on boot:
sudo nano /etc/rc.local

Enter this before exit:
sudo /home/pi/fbcp-ili9341/build/fbcp-ili9341 &

Uncomment the Autostart things:
sudo nano /etc/xdg/openbox/autostart

cd /home/pi/retro-ipod-spotify-client/frontend/

sudo -H -u pi --preserve-env=SPOTIPY_REDIRECT_URI,SPOTIPY_CLIENT_ID,SPOTIPY_CLIENT_SECRET python3 spotifypod.py &

sudo /home/pi/retro-ipod-spotify-client/clickwheel/click &

Bluetooth
For bluetooth I these instructions:
To install blue-alsa link
To set up auto connect link
Use this to pair bluetooth device:

Please only follow the configuration instructions you already downloaded it in the previous link. link
When Done
Reboot and whenever you need to use the pod connect to it from your phone/ computer on the device list as if it were a speaker. It might take a while but it should connect eventually then you're free to exit the app and play songs from the pod.
Issues
Trying to recreate the Bluetooth settings (If you want to try and figure it out, I suggest going to #66 near the bottom there should be some links doris put)
If you have any issues please feel free to comment them below 😄
Resources:
Couldn't have done this without doris, they've helped me out so much.
https://hackaday.io/project/177034-spot-spotify-in-a-4th-gen-ipod-2004
https://github.com/dupontgu/retro-ipod-spotify-client
https://www.youtube.com/watch?v=KciKqGX8g94
https://github.com/dupontgu/retro-ipod-spotify-client/issues/41
https://github.com/dupontgu/retro-ipod-spotify-client/issues/22
https://github.com/dupontgu/retro-ipod-spotify-client/issues/34
https://github.com/dupontgu/retro-ipod-spotify-client/issues/65
https://github.com/dupontgu/retro-ipod-spotify-client/issues/23
https://github.com/dupontgu/retro-ipod-spotify-client/issues/66
http://rsflightronics.com/spotifypod
https://sigmdel.ca/michel/ha/rpi/bluetooth_n_buster_01_en.html
https://github.com/dtcooper/raspotify/wiki/Play-via-Bluetooth-Speaker
https://github.com/bablokb/pi-btaudio

Did you use Adafrit Display with composite video?

No he used the waveshare display

Hi, XEROxMEXICANO, thank you for your detailed instructions!
I have been tinkering this week on trying to get the pi to work as it should for this project and it has been allot of fun. I had not really used linux before so learning as I go.
I use an newer version of raspotify that seems to run smoothly https://github.com/dtcooper/raspotify/releases/tag/0.31.3
I previously had a 2inch screen running but found it easier to try to get it to work on a big screen and now have sPOT running and autostarting on my hdmi screen!
Thank you for showing the detailed way you can get your Device id from spotify and where to type them in the spotify_manager.py and client.py files, also learning the keyboard shortcuts to get to a certain line in nano is very helpful :)
I have a thing that I really don't really understand though when starting spotifypod.py
When I use sudo -H -u pi python3 spotifypod.py & (or the line with all the variables in it, makes no difference in my case)
I do get spotipy.oauth2.SpotifyOauthError: No client_id. Pass it or set a SPOTIPY_CLIENT_ID environment variable.
If I use sudo python3 spotifypod.py &
I get a ModuleNotFoundError on import spotipy . Which has something to do with PATH and maybe not installing python with sudo?  (I really understand this part)
And when I use python3 spotifypod.py & I get no error message and the program runs fine.
Could this mean I might have not intsalled python3 under sudo?
If I leave the sudo command out of the /etc/xdg/openbox/autostart It boots up fine, but I am still curious what I did wrong here. Hoping to learn what this could be.
Thanks again for putting so much effort in how you got everything to work, it is really appreciated.
Greetings!

Hi, XEROxMEXICANO, thank you for your detailed instructions! I have been tinkering this week on trying to get the pi to work as it should for this project and it has been allot of fun. I had not really used linux before so learning as I go.
I use an newer version of raspotify that seems to run smoothly https://github.com/dtcooper/raspotify/releases/tag/0.31.3
I previously had a 2inch screen running but found it easier to try to get it to work on a big screen and now have sPOT running and autostarting on my hdmi screen!
Thank you for showing the detailed way you can get your Device id from spotify and where to type them in the spotify_manager.py and client.py files, also learning the keyboard shortcuts to get to a certain line in nano is very helpful :)
I have a thing that I really don't really understand though when starting spotifypod.py When I use sudo -H -u pi python3 spotifypod.py & (or the line with all the variables in it, makes no difference in my case) I do get spotipy.oauth2.SpotifyOauthError: No client_id. Pass it or set a SPOTIPY_CLIENT_ID environment variable.
If I use sudo python3 spotifypod.py & I get a ModuleNotFoundError on import spotipy . Which has something to do with PATH and maybe not installing python with sudo? (I really understand this part)
And when I use python3 spotifypod.py & I get no error message and the program runs fine. Could this mean I might have not intsalled python3 under sudo?
If I leave the sudo command out of the /etc/xdg/openbox/autostart It boots up fine, but I am still curious what I did wrong here. Hoping to learn what this could be.
Thanks again for putting so much effort in how you got everything to work, it is really appreciated.
Greetings!

Hi  fisjingtool:
May I ask

Which version of Raspberry Pi OS your using?
Is your "Spot working and playing Tracks"?

Thanks

Hi Doris,
I am using Buster 10 (installed the lite images)
My sPot is indeed working and playing (full) tracks. The sound was over hdmi on my monitor.
But only if I leave out the sudo command..
I am now trying to get bluetooth to work using all the helpful pages you provided.
Thanks

Is that the recent Legacy Raspbian Buster 10?

the image is from
2021-01-11-raspios-buster-armhf-lite is see now there is a newer one from 22-nov 2022, but I didn't use that one
pi@raspberrypi:~$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
pi@raspberrypi:~$ cat /proc/version
Linux version 5.10.103+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1529 Tue Mar 8 1                      2:19:18 GMT 2022

In Autostart I use:
sudo -H -u pi --preserve-env=SPOTIPY_REDIRECT_URI,SPOTIPY_CLIENT_ID,SPOTIPY_CLIENT_SECRET
sudo /home/pi/retro-ipod-spotify-client/clickwheel/click &
cd /home/pi/retro-ipod-spotify-client/frontend/
python3 spotifypod.py &

the image is from 2021-01-11-raspios-buster-armhf-lite is see now there is a newer one from 22-nov 2022, but I didn't use that one
pi@raspberrypi:~$ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=raspbian ID_LIKE=debian
pi@raspberrypi:~$ cat /proc/version Linux version 5.10.103+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1529 Tue Mar 8 1 2:19:18 GMT 2022

Thank You ... I wasn't ever able to get raspotify 0.31.3 to work perhaps it was because I was usingb the newer Legacy Buster v10
when you "Spot" is it ready to play music or do ytou have to first Authenticate with your phone/computer Spotify App.?

I tried this yesterday two or three times, I have go to my spotifyApp on my phone and select raspotify, it would then begin to play on spot pretty fast.
It is possible to let the sPot autoconnect to the SpotifyConnect server? I didn't think about this yet, to happy to see a screen after 3 days ;) I will start it up to see if it autoconnects now.

I tried this yesterday two or three times, I have go to my spotifyApp on my phone and select raspotify, it would then begin to play on spot pretty fast. It is possible to let the sPot autoconnect to the SpotifyConnect server? I didn't think about this yet, to happy to see a screen after 3 days ;) I will start it up to see if it autoconnects now.

I cannot auto connect either checkout issue #41

Hi,
I just checked this, it does autoconnect for me. Strangely yesterday I was able to play full songs but they stop now after a few seconds. I have been reading this somewhere in the issues as well.
I'll try to connect with my phone first to see if this helps solve the 2 seconds playing issue.
My idea was to use the newest raspotify version possible to avoid maybe these kinds of issues, not sure if it matters
thanks

Read completely issue #66 in regards to the 2- or 3-seconds play issue!

running and authenticated, no errors.  I see now that when I exit my SpotifyApp on the phone, the sPot stops/pauses so I will try to autoconnect first.
When I stop sPot (sudo killall python3) I see a 404 code.  https://api.spotify.com/v1/me/player/play?device_id=(my-device id):Device not found, reason: None. That would be the issue I think

Can you try booting your "Spot" from off and then   at the command prompt in terminal type "sudo systemctl status raspotify" without the quotes press enter what returns do you get?

● raspotify.service - Raspotify (Spotify Connect Client)
Loaded: loaded (/lib/systemd/system/raspotify.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2022-12-11 15:10:09 GMT; 1min 48s ago
Docs: https://github.com/dtcooper/raspotify
https://github.com/librespot-org/librespot
https://github.com/dtcooper/raspotify/wiki
https://github.com/librespot-org/librespot/wiki/Options
Main PID: 669 (librespot)
Tasks: 2 (limit: 2059)
CGroup: /system.slice/raspotify.service
└─669 /usr/bin/librespot --name raspotify --device-type smartphone --backend alsa --bitrate 160 --disable-audio-cache --enable-volume-normalisation --volume-ctrl linear --initial volume 100
Dec 11 15:10:09 raspberrypi systemd[1]: Started Raspotify (Spotify Connect Client).
Dec 11 15:10:09 raspberrypi librespot[669]: [2022-12-11T15:10:09Z INFO  librespot] librespot 0.3.1 bbd575e (Built on 2021-11-26, Build ID: a6e0Ery3, Profile: release)
Dec 11 15:10:09 raspberrypi librespot[669]: [2022-12-11T15:10:09Z WARN  libmdns] Failed to register IPv6 receiver: Os { code: 97, kind: Uncategorized, message: "Address family not supported
Dec 11 15:10:09 raspberrypi librespot[669]: [2022-12-11T15:10:09Z INFO  librespot_core::session] Connecting to AP "ap-gew4.spotify.com:4070"
Dec 11 15:10:10 raspberrypi librespot[669]: [2022-12-11T15:10:10Z INFO  librespot_core::session] Authenticated as "fisjingtool" !
Dec 11 15:10:10 raspberrypi librespot[669]: [2022-12-11T15:10:10Z INFO  librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Linear
Dec 11 15:10:10 raspberrypi librespot[669]: [2022-12-11T15:10:10Z INFO  librespot_playback::convert] Converting with ditherer: tpdf
Dec 11 15:10:10 raspberrypi librespot[669]: [2022-12-11T15:10:10Z INFO  librespot_playback::audio_backend::alsa] Using AlsaSink with format: S16
Dec 11 15:10:10 raspberrypi librespot[669]: [2022-12-11T15:10:10Z INFO  librespot_core::session] Country: "NL"
~

No i didn't need to do that, it loads playlists etc. but stops playback after 2 seconds. I seems to me that the raspotify on the pi is doing what it should.

You still have the same problem, that the sPot wil only play two seconds or so? And you can't autoconnect?

No my spot plays perfectly all tracks however only after I select "raspotify" via my phone or computer and that takes many tries, once I'm successful I can close the app. and use my "Spot" without any issues!

I'm using the Zero 2W my spot is closed and finished in its case, I just would like to not need to select with the Spotify app. first like you!

http://debian.rutgers.edu/raspios_images/raspios_lite/raspios_lite_armhf-2021-01-12/
this is it, despite the link the os is from 2021-01-11

Thank You so much ... I'll let you know if it works! 😊✅

no problem, hopefully it does, it means strarting from (almost) scratch again right? I hope you make an image copy of your sd to fall back to?

I've done it so much that I'm extremely fast at doing it from scratch!

did you ever try any of the newer versions of Raspotify?

No, i read that this was the last version with the same file in #61  raspotify no longer supported
I figured out this part. you need to use a much older version of Raspotify, I used this one:
raspotify_0.31.3.librespot.v0.3.1-19-gbbd575e_armhf.deb
It looks like they changed the file structure in the newer one. /etc/default/raspotify does not exist.

Correct I know that however the new config should work in the zero 2W and your 3 not the zero 1W

Ah yes i see what you mean, but I only swapped it out temporarily for speed purpose ;)

However the neweer versions of Raspotify may require a 64bit rpi os which seem to create a dependency problem with the "Spot App."!

Ah yes, I get it now, the sPot app is not for 64bit os

a host of dependencies were updated in November of 2021 that the Spot couldn't keep up with, which is why Buster 10 and Raspotify 14. 15. and 16 were recommended all three have the   /etc/default/raspotify  configuration  so does 0.31.3 and 0.31.8 howeverI could not get these to work on the 1W or the 2W I was surprised that you could ... probably because of the version of buster that your using it works!

0.31.4 is a breaking release. It is not compatible with previous versions of Raspotify. Special care needs to be taken when updating from updating from =< 0.31.3 to 0.31.4+ or Raspotify may end up in a broken state.
Beginning with version 0.31.4 Raspotify will take advantage of librespot's ability to parse environment variables. The most obvious user facing change is that Raspotify's configuration file will change places (from /etc/default/raspotify to /etc/raspotify/conf) and change formats. Where as before the sections were basically "arg dumpsters" that you could put pretty much anything into, the new conf format will be closer to a traditional configuration file that sets environment variables that map 1 to 1 to librespot's options and flags.
After you take note of your old config values and/or back your old config to a new location you should run sudo apt purge raspotify to completely remove purge Raspotify and then reinstall with sudo apt install raspotify.
You can than migrate your settings to the new config.
/etc/raspotify/conf will contain a non-exhaustive list of librespot options and flags. If you don't see the option or flag that you normally use you can add it and so long as it's valid it will work. To avoid name collisions environment variables must be prepended with LIBRESPOT_, so option/flag foo-bar becomes LIBRESPOT_FOO_BAR. If you look at the rest of /etc/raspotify/conf it should not be difficult to understand.

I see that I  now also have trouble connecting to raspotify as well from my phone, so I am doubtfull  that it is the version :(
I don't know how this happened, and what I changed (as I did many things) but as I recall yesterday it worked (via hdmi speaker on monitor)

So are you suggesting that I don't bother with the reinstall?

Yes, mainly because it sounds like the same problem.. Maybe a difference is that when I am (finally) connected to raspotify and press play on my phone it disconnects..
eventually I get this
Process: 1163 ExecStart=/usr/bin/librespot --name ${DEVICE_NAME} --device-type ${DEVICE_TYPE} $BACKEND_ARGS --bitrate ${BITRATE} $CACHE_ARGS $VOLUME_ARGS $OPTIONS (code=exited, status=1/F
Main PID: 1163 (code=exited, status=1/FAILURE)

Yeah, that's what I get failure code 101 and until I don't, I can't use the "Spot"!

Ok, so now when I finally connect to rapsotify and press play on my phone (i have not executed sPot) it disconnects.. That is the main(only?) problem now. But when you eventually connect everything works, right? I am confused, and also think about starting again with the software and first focus on raspotify  + bluetooth and getting that to function properly  and build from that?

You can try first getting a track playing on your phone before you select raspotify from the Spotify-Connect device list, then try using your "Spot that usually works for me however only after I see vthgat I have authenticated with - sudo systemctl status raspotify

Ah yes, clear now, so getting raspotify to function correctly is the main goal. Learning allot :) thanks!

You're Welcome ... keep me updated, Thanks!

will do! I 'd like to hear your updates too. I had the week off so will have less time, but to be continued :)

I glad you stopped me before I tried the O1-11-21 Buster install it would have been a waste ... however I still wonder how you got Raspotify 0.31.3 to work I am using Raspotify 0.14.0?🤔

I am now installing only raspotify (the version i used before) to work with the latest buster (legacy) usingthe raspberry pi imager (2022-09-22)

Okay great 😊

Sorry XEROxMEXICANo (Michael) I forgot to mention what a great job you did perfecting the "Spots" install instructions however I think you may need to mention in these instructions that the code will need to be recompiled accordingly to the needs of the click wheel wiring based on the screen that the user decides to use ... Great Job!

Does it work immediately and repeatedly from boot?

fisjingtool:
Your still using version 0.31.3? on the Pi3?

Hi, Yes I only used the latest image of buster from pi imager and updated and installed git
used this version of raspotify
curl -O -sL https://github.com/dtcooper/raspotify/releases/download/0.31.3/raspotify_0.31.3.librespot.v0.3.1-19-gbbd575e_armhf.deb
sudo apt install ./raspotify_0.31.3.librespot.v0.3.1-19-gbbd575e_armhf.deb
works steadily

The problem with going with the Zero 2W is "Power Consumption"

Please bear with me can you correctly conclude that you have no issues selecting raspotify from the Spotify Apps. device list and get immediately authenticated and ready to play tracks without the need to keep trying to select?
And can you reboot and obtain the same smooth selecting response?

no on reboot i have the same issue.. keep trying to select raspotify on the spotify phone app and it does not work, but I was trying to install BT audio as well so I am starting over just os + raspotify + reboot to see if it still works
yes i can imaging that the battery drains quite fast with a zero 2w

Thank You for your complete and accurate answers it sure helps me in the troubleshooting process !!!

To be honest I was not that far in the process, and percieved it to be that you still have to connect once with your phone/pc, but again not sure..
I has not worked for you right?
I now have only raspotify installed (and git) and after many reboots, it works perfectly. I have a feeling that I "break" something when introducing bluetooth audio, but that will be another day, thank you for your help!

! have a 1W and a 4B that and plenty of SD cards so yeah, I will have some fun !!!
70 years old Retired with lots of time! :)

I used the 60 gigabyte 4th generation iPod which is really deep, so I had plenty of room to spare

Nice :) I had the week off so enjoyed the spare time doing stuff like this :)

So once again I ask your "Spot boots up and is ready to play tracks without the need to first select raspotify from your phones or computer's Spotify App. device list correct?

No, I am not sure anymore as it worked yesterday (when I just had my hmdi audio from the monitor and had not bothered with BT) but I also did not pay close attention to it. I do know that connecting to raspofty via de app was instant, not like it is now in my install. That is why is am also trying to start over to find out when raspotify breaks

Oh, understand that sometimes connecting to raspotify  in the apps. device list is quick upon booting still need to select from the Spotify apps. device list however never automatic upon booting ... I always need to select from the Spotify connect device list.

Good Morning fisjingtool:
What part of the below are you not going to install in your experiment?
I'd like to try it as well!
sudo apt install python-setuptools python3-setuptools
sudo apt install python3-pip
sudo wget https://github.com/dtcooper/raspotify/releases/download/0.14.0/raspotify_0.14.0.librespot.20200130T014147Z.3672214_armhf.deb
sudo apt-get install python3-tk
sudo apt-get install redis-server
sudo apt-get install openbox
sudo apt install xorg
sudo apt-get install lightdm
sudo apt-get install x11-xserver-utils
sudo apt-get install git

Hi,
I installed all of the above, except installed Raspotify version 0.14.
I was able to get a cache file from
Midori https://accounts.spotify.com/authorize?client_id=clientid&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8080&scope=user-read-playback-state user-modify-playback-state user-read-currently-playing **    app-remote-control%20streaming%20playlist-modify-public%20playlist-modify-private%20playlist-read-private%20playlist-read-collaborative
This happenend after starting sPot for the first time. The browser refreshed and I got an authentication + .cache file, nice!
Rapotfiy runs with no errors (and instant connection from my phone)
I put in the device id in spotifymanager and client.py.
Spot runs, but I can't get it to "take over" controls of the raspotify connect.
In the log of Spotifypod.py I  see that when I try to play a song I get an API 404 error

I'm confused ... yesterday when you said that you only installed Buster 10, Raspotify 0.31.3 and git did you mean that you only installed (3) of the items on the above list ... that's what I wanted to try?

oh yes that is true, that worked perfectly, but when I go further it breaks, so  For that i needed only git and raspotify

Did using Raspotify 0.14.0 make all the positive difference for you?

Has to be a configuration issue

problably, but I  am at a loss where at the moment

Can you post your:
client.py line 1726  ... where you inserted your device ID
spotify_manager.py 176 ... where you inserted your device ID
and
Is your /etc/default/raspotify configured correctly?

okay so we are discarding 0.31.3 from now on?

spotifymanager:
def refresh_devices():
device = UserDevice('73cb47ef5a6xxxxxxb2c0ab4167','raspotify$
DATASTORE.setUserDevice(device)
client.py
def transfer_playback(self, device_id, force_play=True):
""" Transfer playback to another device.
Note that the API accepts a list of device ids, but only
actually supports one.
        Parameters:
            - device_id - transfer playback to this device
            - force_play - true: after transfer, play. false:
                           keep current state.
    """
    data = {"device_ids": ["73cb47ef5a6xxxxxxxxx2c0ab4167"], "pl$
    return self._put("me/player", payload=data)

OPTIONS="--username f --password pw"
yes, i figured I this is how you got it to work it is worth a try.

Your "Device ID" looks to be the same as "Mine" how can that be possible???

username and password inside greater and less than symbols <  >

Of course, somehow you have my device ID!!!!
and your authentication. cache file is not jibing with it so of course the credentials are bad ... how did you get my device ID???

I see nothing in XEROXMEXICANO'S instructions that could have caused you do get my device ID this is very strange!!!

Exactly what processs did you take when attempting to obtain your "Spot's" device ID?
you could just return client.py and spotify_manager.py to their original state and reboot ... things should work as long as your 'Spot's" developer app. name is exactly the same as the device name in sudo nano /etc/default/raspotify.

Is everything Okay?

Yes ,I 'will look at it tomorrow we have time difference , it is night :)
Op di 13 dec. 2022 00:06 schreef doris1347 @.***>:

Is everything Okay?
—
Reply to this email directly, view it on GitHub
https://github.com/dupontgu/retro-ipod-spotify-client/issues/69#issuecomment-1347466341,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/A4VRPMVI72WD45JBVUXQ3JTWM6VYLANCNFSM6AAAAAAS2DTOD4
.
You are receiving this because you commented.Message ID:
@.***>

Where are you?

I live in the Netherlands,you?
On Tue, Dec 13, 2022 at 4:34 AM doris1347 @.***> wrote:

Where are you?
—
Reply to this email directly, view it on GitHub
https://github.com/dupontgu/retro-ipod-spotify-client/issues/69#issuecomment-1347697755,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/A4VRPMV6773G4FZJJ3RIJEDWM7VFBANCNFSM6AAAAAAS2DTOD4
.
You are receiving this because you commented.Message ID:
@.***>

New York, USA

Hi,
yes I will check the #66 issue tommorrow. Maybe almost (or even exact _) device id's  is not that strange. I certainly did not copy it from you or anyone esle.

Note: "A Device ID is unique and persistent to some extent (and for some clients). However, this is not guaranteed and any cached device_id should periodically be cleared out and re-fetched as necessary."

Glad to hear that all worked for you and that all the the post in this thread will most help many other "Spot" builders Thanks Again to XEROxMEXICANO and yourself for your time!
Have a Happy New Year as well.

TO ALL "sPoT" BUILDER/USER'S "DORIS" HAS GREAT NEWS ...
THE RESULT IS the "sPot" NOW AUTO CONNECTS & AUTO AUTHENTICATES !!!
NO NEED TO USE YOUR PHONE/COMPUTER OR MAKE AN HTTP REQUEST !!!
This would mean that the suggested fix in issue #41 is and has always been correct !!!
THIS IS GREAT NEWS !!!!
Merry Christmas Guys & Gals!

	I even got a e-Mail from Spotify:

New login to Spotify
We noticed you logged in from a new device. If this was you, there’s nothing for you to do right now.
Location United States
Time December 16, 2022 at 1:04:39 PM EST
Not you?
Take a few minutes to secure your account.
SECURE ACCOUNT
Make sure this email is from Spotify: support.spotify.com/article/suspicious-email/
😊✅

Okay so I tried the above with  2021-01-11 Raspbian Pios Buster and Raspotify 0.31.3 it does connect & authenticate automatically however it still disconnects when pressing "PLAY" ... not sure if I will bother with trying Legacy Buster 10 or higher versions of Raspotify or Raspberry PiOs Bullseye ... if any of you guys wants to try be my guest just please post your results!
Thanks!

FYI ... I now have Legacy Buster 10 and Raspotify v.0.31.3 running perfectly on my Raspberry Pi Zero 2W.
I installed version 0.16.0 over 0.14.0 then 0.31.3 over version 0.16.0.   all is well.

FYI ... I now have Legacy Buster 10 and Raspotify v.0.31.3 running perfectly on my "sPot's" Raspberry Pi Zero 2W. ✅
I installed version 0.16.0 over 0.14.0 then 0.31.3 over version 0.16.0. ... all works well! ✅
I tried <IP_ADDRESS> and above with Buster without success. 😞
Further I tried Bullseye with v. 0.31.3 without success. 😞

FYI:
Note: From Spotify "A Device ID is unique and persistent to some extent (and for some clients). However, this is not guaranteed and any cached device_id should periodically be cleared out and re-fetched as necessary."
My guess is you created a syntax error while handling the code in both places.
After many attempts using 2021-01-11 Raspbian Pios Buster and Raspotify 0.31.3 ... I had no success (same disconnect issues). best to use Raspotify 0.14 or 0.16 only with Raspbian Legacy Buster 10 do not use bullseye!
TO ALL "sPoT" BUILDER/USER's "DORIS" HAS Good News...
A THOUGHT CAME ACROSS MY MIND TO REMOVE THE LESS THAN/GREATER THAN BRACKETS "< >" FROM THE USER ID & PASSWORD ENTRY FILEDS OF THE ... SUDO NANO /ETC/DEFAULT/RASPOTIFY CONFIGURATION FILE!!!
THE RESULT IS UPON BOOT the "sPot" NOW AUTO CONNECTS & AUTO AUTHENTICATES!!! NO NEED TO USE YOUR PHONE/COMPUTER's Spotify app. to authenticate.
When you make a selection with the "sPot" you will see it as being selected in the Spotify app. device list (and it will start playing) as long as your audio endpoint is working.
Be sure to use your email address as your USER ID not the 10 Digit numeric code!
When checking status of Raspotify using sudo systemctl status raspotify you can reset to your prompt by using the ctrl+ "c" keys of your keyboard.
I have verified the above working with multiple reboots as well!
This would mean that the suggested fix of "Tomaculum" in issue #41 on May 27, 2021, is and has always been correct and explains how Ricardo Sappia's "sPot" worked as above!
This totally works and resolves that issue of having to first use my iphone or desktop to SELECT the Spotify Connect iPod device with this hard-coding - it goes to the "sPot" raspotify device straight away !!!
I just received an e-Mail from Spotify that reflects on the above read below
New login to Spotify We noticed you logged in from a new device. If this was you, there’s nothing for you to do right now. Location United States Time December 16, 2022, at 1:04:39 PM EST Not you? Take a few minutes to secure your account.
_I never received such an e-mail from Spotify regarding the "sPot" previously The referred new device is the "sPot' and now that it is blessed by Spotify it boots and behaves like any other Spotify Connect Device!.
Legacy Buster with Raspotify 0.14.0 connects & authenticates automatically and works perfectly!
Merry Christmas! 🎄🎄🎅
& Have a Happy New Year Enjoy!😊

Brilliant, Thank you for sharing this, I applied it with great success. I will be adding it to the instructions. Thank you!!

Hi All, Doris has another Christmas Gift for you below … it is a way to safely shutdown your “sPoT” you can wire the hold switch to do the below or get creative like me … what I did Guy DuPont would frown on but I’ve always been a practical Guy (no pun intended) I found a really good looking spst momentary chrome micro switch on eBay and drilled a small hole in the rear bottom of the iPod chrome case that serves as the safe shutdown switch … I use the iPod’s hold switch to remove power from the Adafruit screen to conserve power when listening and not selecting tracks!
Works Great! 😊✅
https://howchoo.com/g/mwnlytk3zmm/how-to-add-a-power-button-to-your-raspberry-pi#building-the-sleep-functionality
https://www.ebay.com/itm/303979820222?mkcid=16&mkevt=1&mkrid=711-127632-2357-0&ssspo=OAB-B00GSEG&sssrc=2349624&ssuid=nRkUJ5ohS3G&var=&widget_ver=artemis&media=EMAIL

Will use the below to completely remove power from the battery:
https://www.ebay.com/itm/253956039260?mkcid=16&mkevt=1&mkrid=711-127632-2357-0&ssspo=3KBUrm8CQFe&sssrc=2349624&ssuid=nRkUJ5ohS3G&var=&widget_ver=artemis&media

FYI ... I now have Legacy Buster 10 and Raspotify v.0.31.3 running perfectly on my "sPot's" Raspberry Pi Zero 2W. ✅
I installed version 0.16.0 over my previous 0.14.0 my then 0.31.3 over my previous version 0.16.0. positive results all works well! ✅
Raspotify v.0.31.3 was the last version where /etc/default/raspotify exist!
Newer versions use /etc/raspotify/conf. And is totally different!
I tried <IP_ADDRESS> and above versions with Legacy Buster negative results! 😞
Further I tried Bullseye with v. 0.31.3 negative results! 😞

Xero, to avoid confusion you probably should close issue #66.

FYI ... I now have Legacy Buster 10 and Raspotify v.0.31.8 running perfectly on my "sPot'.✅
You have to upgrade in (to avoid withheld dependencies) stages however no rebooting was required the configuration file is at /etc/raspotify/conf must you must disable discovery and enter your login credentials!

Hi All, "Doris here" I have another Christmas Gift for you all below: …
Here is a way to Safely Shutdown your “sPoT” you can wire the hold switch to do the below or get creative like me … what I did "Guy DuPont" would surely frown on however I’ve always been a practical "Guy" (no pun intended) I found and purchased a very attractive S.P.S.T. Momentary Chrome Mini Micro Switch off eBay and drilled a small 8mm hole 😯 in the lower rear corner of the iPod's back rear chrome case that serves as the safe shutdown switch … I use the iPod’s hold switch connected in series with the +5volt line of the Adafruit screen to remove power from the screen to conserve power when listening however not selecting tracks!
I was able to do this since I have the thick (deeper) 60gb iPod rear case, the 40gb iPod is the same and just as deep!!
I will use a S.P.S.T. "Latching" Switch 8mm or less mounting hole that I will use in series with the "sPoT's" -battery line to completely remove power following safe shutdown that I will then mount in the other lower rear back corner!
Works Great! 😊✅
Remember using the "EN" terminal of the charge/boost module as a kill switch does not do a safe shutdown and could ultimately lead to a corrupt "sPoT" SD card !!!
Github The easy way scripts Link:
https://github.com/Howchoo/pi-power-button
Full Procedure Link:
https://howchoo.com/g/mwnlytk3zmm/how-to-add-a-power-button-to-your-raspberry-pi#building-the-sleep-functionality
S.P.S.T. Momentary Chrome Mini Micro Safe Shutdown Switch Link:
https://www.ebay.com/itm/284806431517?mkcid=16&mkevt=1&mkrid=711-127632-2357-0&ssspo=s7d9was-qsy&sssrc=2349624&ssuid=nRkUJ5ohS3G&var=&widget_ver=artemis&media
S.P.S.T. Latching Micro switch to completely remove power from the battery Link:
https://www.ebay.com/itm/253956039260?mkcid=16&mkevt=1&mkrid=711-127632-2357-0&ssspo=3KBUrm8CQFe&sssrc=2349624&ssuid=nRkUJ5ohS3G&var=&widget_ver=artemis&media
Thick (deep) case back iPod 4th Gen. 40gb Link:
https://www.ebay.com/itm/333947908909?mkcid=16&mkevt=1&mkrid=711-127632-2357-0&ssspo=hev09R3dRza&sssrc=2349624&ssuid=nRkUJ5ohS3G&var=&widget_ver=artemis&media
Good Bluealsa Installation Instructions Link:
https://introt.github.io/docs/raspberrypi/bluealsa.html
Interesting Bluetooth Audio Stuff below !!! Link:
introt/docs#5
FYI ... I now have Legacy Buster 10 and Raspotify v.0.31.8 running perfectly on my "sPoT's" Raspberry Pi Zero 2W. ✅
I installed version 0.16.0 over my previous 0.14.0 then 0.31.3 over my previous version 0.16.0. and on up (4,5,6.7) to 0.31.8 could not go further then 0.31.8 (<IP_ADDRESS> and above wouldn't install) because of unmet dependencies (using old stable Legacy Buster 10) ... with Positive Results, all works well! ✅
Raspotify v.0.31.3 was the last version where /etc/default/raspotify exist!
Newer versions use /etc/raspotify/conf. and is Totally Different and improved I'm using that now much prefered!
The new configuration allows for pre-gain adjustment which is great!
It was difficult getting Bluetooth working!
Further I tried Bullseye with v. 0.31.3 and the latest 0.43.20 with Negative Results (sPoT wouldn't control tracks ) ! 😞
Do Not Use new stable Bullseye 11 (the sPoT software would need to be upgraded) stay with old stable Legacy Buster 10 !!!
Have Fun!

FYI: It isn't necessary to insert "Device ID's" in the code!
Just be sure Guy Dupont's "Instructions Step 12" and the below are correct and bluetooth is working and ready!:
def refresh_devices():
device = UserDevice('id,'name', is_active)
DATASTORE.setUserDevice(device)
for _, item in enumerate(results['devices']):
if "Spotifypod" in item['name']:
print(item['name'])
device = UserDevice(item['id'], item['name'], item['is_active'])
DATASTORE.setUserDevice(device)
Substitute your sPot's name for "Spotifypod"!
I removed all device ID's from the code.
Still works correctly!

I managed to upgrade Raspotify 0.31.8 To "Bullseye" any higher then 0.31.8 and the "sPoT" couldn't find "sPotiPy".

Dear all,
I do not get the point with the deviceID:
"Entering Device id
To obtain your device id you first have to go to https://developer.spotify.com/console/get-users-available-devices/
when you go the the website your ipod may not appear connect to it using the spotify app on the device list then retry the website and it should show up"
Can you please give any more information what should be done here?
Thanks so much,
Marcus

When trying to install
sudo apt-get install python-pip python-dev
I got this:
reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'python-dev-is-python2' instead of 'python-dev'
Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python3-pip
E: Package 'python-pip' has no installation candidate
The next two lines work fine:
sudo apt-get install python3-pip python-dev
pip install -r requirements.txt
But when running:
python spotipy_oauth_demo.py
I got this message:
Traceback (most recent call last):
File "spotipy_oauth_demo.py", line 4, in
from bottle import route, run, request
ImportError: No module named bottle
Is this related to the first python error?
This is what I am running:
cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian

When trying to install
sudo apt-get install python-pip python-dev
I got this: reading package lists... Done Building dependency tree... Done Reading state information... Done Note, selecting 'python-dev-is-python2' instead of 'python-dev' Package python-pip is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: python3-pip
E: Package 'python-pip' has no installation candidate
The next two lines work fine: sudo apt-get install python3-pip python-dev pip install -r requirements.txt
But when running: python spotipy_oauth_demo.py
I got this message: Traceback (most recent call last): File "spotipy_oauth_demo.py", line 4, in from bottle import route, run, request ImportError: No module named bottle
Is this related to the first python error?
This is what I am running:
cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)" NAME="Raspbian GNU/Linux" VERSION_ID="11" VERSION="11 (bullseye)" VERSION_CODENAME=bullseye ID=raspbian ID_LIKE=debian

I found this now:
Current python:
pi@spotipod:~/spotipy_oauth_demo$ python -V
Python 2.7.18
pi@spotipod:~/spotipy_oauth_demo$ alias python='/usr/bin/python3'
Now I was able to run:
python spotipy_oauth_demo.py

henschelm,
You are going to FAIL you are not reading the instructions correctly regarding the required version of Raspberry Pi OS !
You really dot need to use a device ID!
When editing bash profile ... '#!/bin/bash' should be #!/bin/bash without the accent marks !!!
sudo nano ~/.bash_profile
Run ... pip3 install -r requirements.txt ... from the frontend folder
cd retro-ipod-spotify-client/frontend
Be sure to remove <> from  your user name and password credentials
OPTIONS="--username XXXXXXXX --password XXXXXXXXX"
sudo nano /etc/default/raspotify
Good Luck.

Hi Doris,

1. You really do not need to obtain, enter and use a device ID!

This means that I can pick a random device ID? Like: 123456789?

2. You are going to FAIL you are not reading the instructions correctly regarding the required version of Raspberry Pi OS  and perhaps raspotify version !

I used the one as described in the instruction here.

When editing bash profile ... '#!/bin/bash' should be #!/bin/bash without the accent marks !!! sudo nano ~/.bash_profile
yep, already found this typo and corrected it in my setup

Be sure to run ... pip3 install -r requirements.txt ... from the frontend folder cd retro-ipod-spotify-client/frontend
Yes, did it.

Be sure to remove the <> symbols from your user name and password credentials sudo nano /etc/default/raspotify OPTIONS="--username XXXXXXXX --password XXXXXXXXX"
Yes, did it as described in the instruction.

You really do not need to obtain, enter and use a device ID!
You do need to keep your device name consistent in sudo nano /etc/default/raspotify and cd /home/pi/retro-ipod-spotify-client/frontend/

nano spotify_manager.py
Go to line 173 using ctrl+shift+_ and type 173

Read Above!

Do Not Use Bullseye 11 or Raspotify past 0.31.8 (the sPoT software would need to be upgraded) stay with Legacy Buster 10 and Raspotify below v. 14.0 !!!

I liked 14 better then 16 (it gave more info when doing sudo nano /etc/default/raslotify!
However I am now using Legacy Buster 10 with raspoitify 0.31.8 if you want to upgrade to this raspotify version you must upgrade in stages or you will experience unmet dependency issues !!!

I installed version 0.16.0 over my previous 0.14.0 then 0.31.3 over my previous version 0.16.0. and on up (0.31.4,.5,.6,.7) to 0.31.8 could not go further then 0.31.8 (<IP_ADDRESS> and above wouldn't install) because of unmet dependencies (Bullseye required):
"Raspotify recently updated to <IP_ADDRESS> which added minimum dependencies. This error probably means your OS isn't compatible with Raspotify (e.g. running debian buster when you need debian bullseye). If raspotify was working for you before, try downgrading manually to 0.31.8 (it wont throw any errors installing, but might not work once installed)".
(I'm using old stable Legacy Buster 10) ... with Positive Results, all works well!
Raspotify v.0.31.3 was the last version where /etc/default/raspotify exist!
Newer versions use /etc/raspotify/conf. and is Totally Different and improved I'm using that now much prefered!
The new configuration allows for pre-gain adjustment which is great!

Marcus,
Let me know how it all works out for you?😊

Short question meanwihle. I connected the 2inch LCD Module ST7789V controller 240 x 320 as described in Ricardo's Alternate Build (http://rsflightronics.com/spotifypod)) the PI zero. So I left the clickwheel, etc. out so far. When I configure everything correctly, should I get the output of menue on the screen? I can see the bootprocess of the os on the screen already, but after that it turns black.

Marcus, Let me know how it all works out for you? 🤔
You should be installing 32bit versions of Pi os and Raspotify!

Yeah. I downloaded this version: 2022-09-22-raspios-buster-armhf-lite.img.xz
and:
uname -m
armv6l
Should be 32bit, right?

Use the imager below and select Legacy Buster 10 lite 32bit:
https://www.raspberrypi.com/software/

https://www.raspberrypi.com/software/

Yes, I use this one already.
And I took this version:
Raspberry Pi OS Lite (Legacy)
Release date: September 22nd 2022
System: 32-bit
Kernel version: 5.10
Debian version: 10 (buster)
Size: 284MB

After installing the OS do all the updates immediately!

Yes, I also did this.

Which Raspberry Pi Zero do you own?

cat /proc/device-tree/model
Raspberry Pi Zero W Rev 1.1pi@spotifypod:~/retro-ipod-spotify-client/frontend$

Perfect! 😊✅

Let me know how it all works out for you? 🤔

Let me know how it all works out for you? 🤔

So I went trough the config again and again. I tried to start this manually:
cd /home/pi/retro-ipod-spotify-client/frontend/
sudo -H -u pi --preserve-env=SPOTIPY_REDIRECT_URI,SPOTIPY_CLIENT_ID,SPOTIPY_CLIENT_SECRET python3 spotifypod.py
This seems not to run. I always get this output:
raceback (most recent call last):
File "spotifypod.py", line 12, in
from view_model import *
File "/home/pi/retro-ipod-spotify-client/frontend/view_model.py", line 1, in
import spotify_manager
File "/home/pi/retro-ipod-spotify-client/frontend/spotify_manager.py", line 1, in
import spotipy
File "/home/pi/.local/lib/python3.7/site-packages/spotipy/init.py", line 2, in
from .client import *  # noqa
File "/home/pi/.local/lib/python3.7/site-packages/spotipy/client.py", line 1736
data = {"device_ids": ["03d1cf13214893bd791af2ea8c28c77d4d94e53c"], "play": force_play}

Can you upload photo's of your below files:
sudo nano /etc/xdg/openbox/environment
sudo nano /etc/xdg/openbox/autostart
sudo nano /etc/X11/xinit/xinitrc

and
Your output of sudo systemctl status raspotify
Block out anything that's private !!!

File "/home/pi/.local/lib/python3.7/site-packages/spotipy/client.py", line 1736
data = {"device_ids": ["03d1cf13214893bd791af2ea8c28c77d4d94e53c"], "play": force_play}
Remove the device ID and return line 1736 to it's default state!

Can you post photo's of your below files:
sudo nano /etc/xdg/openbox/environment
sudo nano /etc/xdg/openbox/autostart
sudo nano /etc/X11/xinit/xinitrc

Also Post:
Your output of ... sudo systemctl status raspotify
Block out anything that's private !!!
File "/home/pi/.local/lib/python3.7/site-packages/spotipy/client.py", line 1736 data = {"device_ids": ["03d1cf13214893bd791af2ea8c28c77d4d94e53c"], "play": force_play}
Remove the device ID and return line 1736 to it's default state!

You could be Hacked if you don't remove them !!!

Do the below for your autostart:
sudo nano /etc/xdg/openbox/autostart
cd /home/pi/retro-ipod-spotify-client/frontend/
sudo -H -u pi --preserve-env=SPOTIPY_REDIRECT_URI,SPOTIPY_CLIENT_ID,SPOTIPY_CLIENT_SECRET
python3 spotifypod.py &
sudo /home/pi/retro-ipod-spotify-client/clickwheel/click &

Your Spotify account could be Hacked if you don't remove them from showing on this github forum!!!

delete your post with the environment !!!!

Delete the below post:
sudo nano /etc/xdg/openbox/environment

Very good !!!

Can you post photo's of your below files:
sudo nano /etc/xdg/openbox/environment
sudo nano /etc/xdg/openbox/autostart
sudo nano /etc/X11/xinit/xinitrc
sudo nano ~/.bash_profile

Block out anything that's private !!!
Also Post:
Your output of ... sudo systemctl status raspotify
File "/home/pi/.local/lib/python3.7/site-packages/spotipy/client.py", line 1736 data = {"device_ids":

["03d1cf13214893bd791af2ea8c28c77d4d94e53c"], "play": force_play}
Remove the device ID and return line 1736 to it's default state!

Also Post the below data:

cd /home/pi/retro-ipod-spotify-client/frontend/ nano spotify_manager.py Go to line 173 using ctrl+shift+_ and type 173 ... post the result

Excellent!
Did you name your Spotify developer app. Spotifypod?

sudo nano /etc/xdg/openbox/autostart

Ok, done. The difference is only that "python3 spotifypod.py &" gets in a new line?

Did you name your Spotify developer app. Spotifypod?

Excellent! Did you name your Spotify developer app. Spotifypod?

yes

Did you remove the device id from line 1736 and return that line to it';s default?

Did you remove the device id from line 1736 and return that line to it';s default?

yes. When I run the command "sudo -H -u pi --preserve-env=SPOTIPY_REDIRECT_URI,SPOTIPY_CLIENT_ID,SPOTIPY_CLIENT_SECRET python3 spotifypod.py" no errors!

Did you enter the name spotifypod in sudo nano /etc/default/raspotify

Only run:
python3 spotifypod.py &
from the frontend folder

However you should not need too

sudo nano /etc/default/raspotify

yes, but i commented it out. should I uncomment?

autostart should be working now!

YES

done!

reboot

Synchronize Spotify Data
Synchronizing Spotify data! Last but not least, if you want to make sure all your playlists artists, etc are synchronized every time you turn on your Spotifypod, you can simply modify the script view_model.py
instead of calling refresh_device, you can execute refresh_data. This will sync all your data and then will execute refresh.devices. This will make the boot up way slower! but it will synchronize every single time you switch on :).
If you dont run at least once refresh_data() no playlist, artist or anything related with your account will be displayed!
cd retro-ipod-spotify-client/frontend
Then
sudo nano view_model.py
go to line 16
#spotify_manager.refresh_devices()
spotify_manager.refresh_data()
Comment out the first existing below line:
#spotify_manager.refresh_devices()
add a second non existing below line un-commented:
spotify_manager.refresh_data()
Then reboot!
Be sure you throughly read issue 21 & 69.
Have Fun! 😊✅
Another suggestion is to create a file called testit.py with the following 3 lines:
import spotify_manager
from functools import lru_cache
spotify_manager.refresh_data()
Place it in the frontend folder,
and then run it from the command line:
cd retro-ipod-spotify-client/frontend
Then
python3 testit.py
This will only work if you created a .cache file, But if you're good to go you should see output to the screen as it downloads playlists, artists, etc.
Good Luck! 😊✅
FYI:
When you make a track selection (http request) with the "sPoT" you will see it as being selected in the Spotify app. device list of your phone or computer (and your selection will start playing) ### as long as your audio endpoint (bluetooth) is configured and working if not your selected track will only increment 3 seconds and dropout. the same will happen if you first select your device using another authorized Spotify client, if your audio endpoint (Bluetooth) isn't up and running your connection will dropout after approx. 3 seconds!

However you should not need too ... autostart should be working now!

The file looks like this now:

OK?

correct

correct

ok, I will reboot. :-)

Excellent!

Excellent!

Ok, done. But the screen is still black. any checks that I can do?

If you right mouse click on the screen ... what happens ???

SSH into your pi and from the frontend folder run:
python3 spotifypod.py &

If you right mouse click on the screen ... what happens ???

That is what I am expecting
My setup looks like this right now:

use a computer and:
SSH into your pi and from the frontend folder run:
python3 spotifypod.py &

python3 spotifypod.py &

I can start it but it exits ...

Post 15 lines of your view_model.py

Post 15 lines of your view_model.py

Only line 15 ?
#spotify_manager.refresh_devices()
spotify_manager.refresh_data()
class LineItem():
def init(self, title = "", line_type = LINE_NORMAL, show_arrow = False):
self.title = title
self.line_type = line_type
self.show_arrow = show_arrow

No I want to see the first 15 lines

Disregard I see what I wanted to see

No I want to see the first 15 lines

import spotify_manager
import re as re
from functools import lru_cache
MENU_PAGE_SIZE = 6
Screen render types
MENU_RENDER_TYPE = 0
NOW_PLAYING_RENDER = 1
SEARCH_RENDER = 2
Menu line item types
LINE_NORMAL = 0
LINE_HIGHLIGHT = 1
LINE_TITLE = 2
#spotify_manager.refresh_devices()
spotify_manager.refresh_data()

I am at a lost

You may need to connect an HDMI monitor to troubleshoot!

You may need to connect an HDMI monitor to troubleshoot!

sure I can do. should I see the ipod menue on the monitor als well? Do I need to uncomment the lines in /boot/config.txt?

Again I do not use the Waveshare display screen I use the ADAfruit display with simple composite video output no drivers required!

Yes you should see the Menu on an HDMI monitor !
You may need to configurfe in raspi-config

You could try connecting a keyboard and mouse and right click on the screen

Again I do not use the Waveshare display screen I use the ADAfruit display with simple composite video output no drivers required!

can you provide a link to display screen?

https://www.adafruit.com/product/911

Yes you should see the Menu on an HDMI monitor ! You may need to configure in raspi-config You could try connecting a keyboard and mouse and right click on the screen then open a terminal window and: From the frontend folder run: python3 spotifypod.py & Good Luck! 😞✅

Greetings to NY :-)
I have it now runnig with my monitor and USB Mouse + USB keyboard. Terminal window is running the python3 spotifypod.py & command in the frondend folder. But I receive the same error message as before...
Any further ideas?

Now I got the menue on the screen (on both now Monitor and the LCD connected to the Pi). I did this in the view_model.py file in the frontend folder:
spotify_manager.refresh_devices()
#spotify_manager.refresh_data()

Congratulations!

Now try the below and see if it still works !!!
#spotify_manager.refresh_devices()
spotify_manager.refresh_data()

Congratulations!
Now try the below and see if it still works !!!
#spotify_manager.refresh_devices()
spotify_manager.refresh_data()
Give the reboot at least 5 minutes to display the menu screen !!!
Refresh data takes longer!

Congratulations!
Now try the below and see if it still works !!!
#spotify_manager.refresh_devices() spotify_manager.refresh_data()
Give the reboot at least 5 minutes to display the menu screen !!!
Refresh data takes longer!

no, it exits with the same error...

Interesting 🤔
Post your:
sudo nano ~.bash_profile
You may need to input the correct device ID's in the two locations

Interesting 🤔
Post your: sudo nano ~.bash_profile
You may need to input your correct device ID's in the two locations

#!/bin/bash
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor
Disable any form of screen saver / screen blanking / power management
xset s off
xset s noblank
export SPOTIPY_CLIENT_ID='1234'
export SPOTIPY_CLIENT_SECRET='5678'
export SPOTIPY_REDIRECT_URI='http://localhost:8080'
export DISPLAY=:0.0

Okay,
Try to input your correct device ID's in the two previous locations.
That's it I'm Done!
😊✅

Okay,
Try to input your correct device ID's in the two previous locations.
That's it I'm Done! 😊✅

what do you mean by this?

Entering Device id
To obtain your device id you first have to go to https://developer.spotify.com/console/get-users-available-devices/
when you go the the website your ipod may not appear connect to it using the spotify app on the device list then retry the website and it should show up
cd /home/pi/retro-ipod-spotify-client/frontend/
nano spotify_manager.py
Go to line 173 using ctrl+shift+_ and type 173 You can comment out the entire refresh_device def and replace it with
def refresh_devices():
device = UserDevice('xxxxxxxxxxxxxxxxxxxxxxxxxxxxx','raspotify', True)
DATASTORE.setUserDevice(device)
Replace the XXXXXXX with your device id
Ex:
def refresh_devices():
device = UserDevice(‘123456789','raspotify', True)
DATASTORE.setUserDevice(device)
After that you want to go save and exit the file then
cd ~/.local/lib/python3.7/site-packages/spotipy/
nano client.py
Go to line 1734 using ctrl+shift+_
Paste this in:
data = {"device_ids": ["xxxxxxxxxxxxxxxxxxxxxxxxxx"], "play": force_play}
return self._put("me/player", payload=data)
Replace the xxxxxx with your device id

You probably errored somewhere in the installation !!!
Good Luck
and
Goodbye From NY! 😊✅

Entering Device id
To obtain your device id you first have to go to https://developer.spotify.com/console/get-users-available-devices/ when you go the the website your ipod may not appear connect to it using the spotify app on the device list then retry the website and it should show up
cd /home/pi/retro-ipod-spotify-client/frontend/
nano spotify_manager.py Go to line 173 using ctrl+shift+_ and type 173 You can comment out the entire refresh_device def and replace it with
def refresh_devices(): device = UserDevice('xxxxxxxxxxxxxxxxxxxxxxxxxxxxx','raspotify', True) DATASTORE.setUserDevice(device) Replace the XXXXXXX with your device id Ex: def refresh_devices(): device = UserDevice(‘123456789','raspotify', True) DATASTORE.setUserDevice(device) After that you want to go save and exit the file then
cd ~/.local/lib/python3.7/site-packages/spotipy/
nano client.py Go to line 1734 using ctrl+shift+_ Paste this in:
data = {"device_ids": ["xxxxxxxxxxxxxxxxxxxxxxxxxx"], "play": force_play} return self._put("me/player", payload=data) Replace the xxxxxx with your device id

Looks like this now:
else:
tlist = [self._get_id("track", t) for t in tracks]
results = self._get("audio-features/?ids=" + ",".join(tlist))
data = {"device_ids": ["03d1cf13214893bd791af2ea8c28c77d4d94e53c"], "play": force_play}
return self._put("me/player", payload=data)
OK?

data = {"device_ids": ["03

or did I put it on the wrong place in the code?

Your all set and correct!

If I use the link:  https://developer.spotify.com/console/get-users-available-devices/ - Then create a token, select the scope "user-read-playback-state" and push the "try it" button I see the spotifypod with this output:
{
"id": "03d1cf13214893bd791af2ea8c28c77d4d94e53c",
"is_active": true,
"is_private_session": false,
"is_restricted": false,
"name": "raspotify (spotifypod)",
"type": "Speaker",
"volume_percent": 100
}
I am wondering of the typ "Speaker". I configured due to the "sudo nano /etc/default/raspotify" DEVICE_TYPE="smartphone" shouldn't it be smarphone here?

It doesn't matter!!!

It doesn't matter!!! That entry only works properly with Raspotify versions 0.16.0 and above, and it still wouldn't matter!

Could you please paste the code in the client.py? I tried the whole day and everytime I come the this file spotifpod.py does not run anymore.
maybe the 3 lines before and the 3 line after:
...
...
...
data = {"device_ids": ["fafe2346e2b7f65d6630e6dc08ed18e780ea0f84"], "play": force_play}
return self._put("me/player", payload=data)
...
...
...

You don't need it delete it and return the code to its default !!!

You don't need it delete it and return the code to its default !!!

Ok great! Bluetooth is running, too. the connected to the bose box. But when I start playing a song from the pod, no soud at all. I there some place where I can control the volume?

No

Does the the Timelapse counter increment upwards consistently or does it stop at a few seconds?

Does the Timelapse counter increment upwards consistently or does it stop at a few seconds? 🤔

Yes, everything is working now. I made a mistake in the /etc/asound.conf. Now the music is playing through bluethoot. GreaT!

Regarding the clickwheel:
When I compile with "gcc -Wall -pthread -o click click.c -lpigpio -lrt" I got this output:
click.c:160:5: warning: first argument of 'main' should be 'int' [-Wmain]
int main(void *args){
^~~~
click.c:160:5: warning: 'main' takes only zero or two arguments [-Wmain]
Is this ok? Because when I run ./click to see any results nothing i shown on the output of click

You don't even say Thank You, you just keep practically demanding support!

Not once did you post a Thank You, you just continue to practically demand support!
See the below Pull Request:
#43
and the below closed issue:
#44

Not once did you post a Thank You, you just continue to practically demand support!
Hi Doris1347,
you are absolutely right. I checked and i did not say thanks to your outstanding support in this case! I feel really sorry, but believe me I really appriciate your time and your efforts! Many thanks! :-)

I will check #43 and #44

Apology accepted! 😊✅

Update:
Added a (2500mAh) battery as per Tanagram27 to my Zero 2W works great with extended power availability & longevity!
I used a thick 60gb 4th generation iPod  back case cover and a Adafruit usb “C” charger with the Adafruit powerboost 1000 boost module and the below battery from Amazon:
AKZYTUE 3.7V 2500mAh 653496 Lipo Battery Rechargeable Lithium Polymer ion Battery with PH2.0mm JST Connector（Actually 1800mAh).
Thanks Again Tanagram27 !!! 😊✅

Dear all,
is it possible instead of sending music to a bluetooth box sending the music to an airplay box? Has anyone tried this so far?
Cheers,
Marcus

Hello All!
After lots of troubleshooting (a HUGE thank you to all the effort of the folks in this thread), I've gotten to the point of trying to login to Spotify through Midori browser.
Using VNC I'm able to get my ID/PW in but when attempting to login, I get an error (see image). I've double checked the device ID is correct, and ensured the proper client ID and secret are in all the places mentioned above.
Any ideas? Happy to provide any printouts that may be of use.

Hello Jacob Madian,
You should be using your:
Spotify username and password
To login to Spotify.
It's unclear to me where you might be having a problem? 🤔

Hi Doris,
Thanks for the feedback. I've re-attempted a fresh install with Legacy Buster 10 (both lite and normal), but only to have the same Spotify login issue after following all your feedback above. A few questions to ensure I'm doing everything correctly:

Should Pi-btaudio & PigPio be installed in retro-ipod-spotify-client/frontend? Based on the instructions it seems Pi-btaudio would be installed in/frontend, then PigPio be installed in /pi-btaudio.

After modifying click.c and running the gcc command, I get a warning (image attached), is this expected?

I am able to see the raspotify device in Spotify API step, and successfully access "login to spotify page". I'm also attaching the printout from the spotipy_oauth_demo.py when accessing the spotify login in case this adds any context.
Any further help would be greatly appreciated.
Thanks!
Jake

See the below - Pull Request:
https://github.com/dupontgu/retro-ipod-spotify-client/pull/43
click.c fix - Wmain warnings
and the below - Closed Issue:
https://github.com/dupontgu/retro-ipod-spotify-client/issues/44
High click.c CPU usage
__Your Relevant "click.c" Lines should look like the below: ____________________________________________________________
dataBit = level;

}
int main(int argc, char** argv){
// Creating socket file descriptor
if ( (sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0 ) {
    perror("socket creation failed");
    exit(EXIT_FAILURE);
}

memset(&servaddr, 0, sizeof(servaddr));

servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(PORT);
servaddr.sin_addr.s_addr = INADDR_ANY;

if (gpioInitialise() < 0) {
   exit(1);
}

// haptic waveform - just a simple on-off pulse
gpioSetMode(HAPTIC_PIN, PI_OUTPUT);
gpioPulse_t pulse[2];
pulse[0].gpioOn = (1<<HAPTIC_PIN);
pulse[0].gpioOff = 0;
pulse[0].usDelay = 8000;

pulse[1].gpioOn = 0;
pulse[1].gpioOff = (1<<HAPTIC_PIN);
pulse[1].usDelay = 2000;

gpioWaveAddNew();

gpioWaveAddGeneric(2, pulse);

hapticWaveId = gpioWaveCreate();
gpioSetPullUpDown(CLOCK_PIN, PI_PUD_UP);
gpioSetPullUpDown(DATA_PIN, PI_PUD_UP);
gpioSetAlertFunc(CLOCK_PIN, onClockEdge);
gpioSetAlertFunc(DATA_PIN, onDataEdge);

while(1) {
 sleep(10000);
};
gpioTerminate();

}

pi@sPoT:~/retro-ipod-spotify-client/clickwheel$ cd pigpio-master
pi@sPoT:~/retro-ipod-spotify-client/clickwheel/pigpio-master$ ls -a
.		command.h	 .gitignore	      libpigpio.so.1  pig2vcd.o  pigpiod_if2.3	pigpiod_if.h  pigs    README.md   x_pigpio.c	   x_pigpiod_if.o
..		command.o	 libpigpiod_if2.so    Makefile	      pigpio.3	 pigpiod_if2.c	pigpiod_if.o  pigs.1  setup.py	  x_pigpiod_if	   x_pigpio.o
build		CONTRIBUTING.md  libpigpiod_if2.so.1  MakeRemote      pigpio.c	 pigpiod_if2.h	pigpiod.o     pigs.c  SUPPORT.md  x_pigpiod_if2    x_pigpio.py
cmake		custom.cext	 libpigpiod_if.so     pig2vcd	      pigpiod	 pigpiod_if2.o	pigpio.h      pigs.h  UNLICENCE   x_pigpiod_if2.c  x_pigs
CMakeLists.txt	DOC		 libpigpiod_if.so.1   pig2vcd.1       pigpiod.1  pigpiod_if.3	pigpio.o      pigs.o  util	  x_pigpiod_if2.o  x_pipe
command.c	EXAMPLES	 libpigpio.so	      pig2vcd.c       pigpiod.c  pigpiod_if.c	pigpio.py     README  x_pigpio	  x_pigpiod_if.c
pi@sPoT:~/retro-ipod-spotify-client/clickwheel/pigpio-master$

Any Luck Jacob? 🤔

Any Luck Jacob? 🤔
I use Legacy Buster 10 Desktop version.
Once I obtained my .cache file I connected a monitor and keyboard and in sudo raspi-config I configured to boot to desktop with auto login I then copied the .cache file from either the home directory or the demo directory over to the frontend folder, I am using a zero 2W which handles the browser smoother and faster.
I saved my .cache file on a usb thumb drive for future copying!
I do remember now having the same or similar login issue and used the 10 digit user ID (not my e-mail address) and my password for logging into Spotify, best not to use VNC for this (use a monitor and keyboard connected to the pi).
I purchased a micro usb to usb adapter with extra ports for this purpose off eBay.
When all is correct I used sudo raspi-config to configure to boot to command line with auto login instead of booting to desktop with auto login.
When doing the above disable (comment out in autostart #python3 spotifypod.py and in Xintric comment out #exec openbox-session ... uncomment (return both to normal) when your done!
Be sure in sudo nano /etc/default/raspotify all is correct and exactly the same in your developer app. !!! 😊✅

Any Luck Jacob? 🤔
I use Legacy Buster 10 Desktop version.
Once I obtained my .cache file I connected a monitor and keyboard and in sudo raspi-config I configured the pi to boot to desktop with auto login I then copied the .cache file from either the home directory or the demo directory (can't remember which) over to the frontend folder, I am using a Zero 2W which handles the browser smoother and faster.
I saved my .cache file on a usb thumb drive for future copying & pasting to the pi Zero. 😊
I do remember now having the same or similar login issue and used the 10 digit user ID (not my e-mail address) and my password for logging into Spotify (try it both ways) best not to use VNC for this (use a monitor, keyboard and mouse connected to the pi Zero.
I purchased a micro usb to usb "A" adapter with extra usb "A" ports for this purpose off eBay.
When all was correct I used sudo raspi-config to configure to boot to command line with auto login instead of booting to desktop with auto login.
When doing the above disable (comment out in autostart #python3 spotifypod.py and in Xintric comment out #exec openbox-session ... uncomment (return both to normal) when your done.
Be sure in sudo nano /etc/default/raspotify all is correct and exactly the same in your developer app. !!!
Yes you can do everything on a pi Zero 2W, 3, 4 or 4B and then move the SD card to your Zero 1W.
Also read the member comments in open issue #41
Hope all the above helps.
Banks.
😊✅

Hi Doris!
Thanks for pointing me at the various issue threads, but still no luck. I am unable to get past the spotify login page to get my .cache file. Today I tried fresh installs of Legacy Buster 10 Desktop & Lite versions, and confirmed that:

#!/bin/bash did not have quotes per #41
Used your click.c changes
Fixed the Wmain warnings from #43
Triple-checked Client ID, Secret, and Device ID in all locations mentioned above
Tried logging in using VNC and KB + Mouse
Tried logging in with email and username

My zero W seems to slow down heavily once opening midori, so I also have an ethernet to usb adapter coming tomorrow since I've been working off my phone hotspot (only 2.4GHz network available).
I'll also keep an eye out for any in-stock Pi 3's or 4's that may be able to get the .cache file then transfer to zero W.
Where did you locate your 10 digit user ID? I tried logging in with my user id (no email) and email addresses with no success.

Jake

Hi Jake the below is a mistake ... I used the below for making a copy of an entire SD card so only use it for doing the above or moving or copying the .cache file via the desktop:
"When doing the above disable (comment out in autostart #python3 spotifypod.py and in Xintric comment out #exec openbox-session ... uncomment (return both to normal) when your done".
Try requesting a new password and from your regular Spotify account and I believe you will receive the 10 digit user ID ! 😊✅

You can also search for your Premium Receipt e-mail if you still have it.

I just used my iphone to look at my Spotify account settings and the 10 digit user ID is there !!!

Works when logging in via the browser as well you will see the 10 digit username !!!

The 10 digit username can be used in sudo nano /etc/default/raspotify as well instead of your e-mail address!

You want to login with 10 digit username and your actual password!

VNC server will slow down your pi if you have a monitor, keyboard and mouse connected to your pi you can stop VNC server via sudo raspi-config

Please let me know when your successful! 😊✅

Hey is that method for getting the device id obsolete? I can't get it to work and can't find any other way online that does work.

You really do not need a device ID just follow the above instructions

Thanks for the quick reply! But how do I do the whole Entering Device ID step? I thought I have to add it into the refresh devices function.

Which versions of Raspbian and Raspotify are you using?

I am using Raspotify 0.14.0, that's installed in the instructions. I am currently using the newest Raspberry Pi OS Lite Legacy, which I think might be a problem. I have tried the Image linked here but I had a problem with installing the requirements I think. But I will try it again if you think that could help.

You should be okay with the versions you have installed, be sure that you:

Use the same exact spot application name that you set up in your Developer app in:

The configuration file and in:

Spotify_Manager

Doing so will forgo the need of a device ID

I think the method of obtaining the device ID is outdated. I can't find get token anywhere. Also I am facing a problem I had everytime. When generating the cache files, I am supposed to paste something in, but the URL doesn't change from localhost anymore.

Perhaps you should try issue 41:
https://github.com/dupontgu/retro-ipod-spotify-client/issues/41

I do have a Spotify Premium Account and am currently trying to build it on a Pi 4 4gb. I used Raspberry Pi OS Lite Legacy, so command line, but I am already far enough for openbox to kick in as the Desktop enviroment.

Vicktor ... didn't you already have the project working once before?

Thanks for being so patient. No that fork doesn't change anything, I created it when still figuring stuff out. I'll retry generating the cache now. Are you still able to get the device ID right now? When visiting my dashboard I don't have get token anywhere, I know the Layout was different like a year ago.

You are so right !!!
I logged on to my developer account and the "Dashboard" is no longer the same, with no apparent way of obtaining device ID's.
Not sure if obtaining .cache files have also been affected and Ido not what to screw around with anything trying to find out and possibly render my spot device useless.
I have been successful achieving an operational "sPot" without using a device ID by making sure that the developer app name is exactly the same in:

spotify_manager.py
etc/default/raspotify

This may be a Spotify issue with Spotify deliberately blocking projects like this out. 😞

I checked and I have the same device name at both spots. Right now I am trying to generate the cache and it tells me that it Found a cached token. Do you know how I can remove the Token again? Right now entering the localhost site I see the data I am supposed to, but the link I am supposed to paste into the terminal doesn't show up.

When using the Spottily Authorization Demo ... If I remember correctly I believe the .cache file ends up in the "Home" directory or the directory of the "Authorization Demo" directory and you have to copy it (don't move it or you might lose it) to the front end directory ... I installed the desktop lite version for copy/paste ability.

Yes but I don't have a .cache file to copy. I am stuck on it finding the cached token and expecting me to paste a link. I think if I had that link it would generate the file, but when opening localhost on my browser the link doesn't change anymore.

Post Install
Generate .cache files
sudo apt install midori
cd ~
git clone https://github.com/perelin/spotipy_oauth_demo
cd ~/spotipy_oauth_demo
sudo apt-get install python-pip python-dev
sudo apt-get install python3-pip python-dev
pip install -r requirements.txt
Before running it modify the client id and secret also your scopes in with:
nano spotipy_oauth_demo.py
Scope:
SCOPE = "user-follow-read,"
"user-library-read,"
"user-library-modify,"
"user-modify-playback-state,"
"user-read-playback-state,"
"user-read-currently-playing,"
"app-remote-control,"
"playlist-modify,"
"playlist-read-private,"
"playlist-read-collaborative,"
"playlist-modify-public,"
"playlist-modify-private,"
"streaming,"
"user-follow-modify,"
"user-follow-read"
Now you can save and exit the file

The .cache file is created when you copy over  .spotipyoauthcache it will become .cache in the frontebd folder.

Post Install
Generate .cache file.
sudo apt install midori
cd ~
git clone https://github.com/perelin/spotipy_oauth_demo
cd ~/spotipy_oauth_demo
sudo apt-get install python-pip python-dev
sudo apt-get install python3-pip python-dev
pip install -r requirements.txt
Before running it modify the client id and secret also your scopes in with:
nano spotipy_oauth_demo.py
Scope:
SCOPE = "user-follow-read,"
"user-library-read,"
"user-library-modify,"
"user-modify-playback-state,"
"user-read-playback-state,"
"user-read-currently-playing,"
"app-remote-control,"
"playlist-modify,"
"playlist-read-private,"
"playlist-read-collaborative,"
"playlist-modify-public,"
"playlist-modify-private,"
"streaming,"
"user-follow-modify,"
"user-follow-read"
Now you can save and exit the file
python spotipy_oauth_demo.py
Recommend using a Pi 4 or anything faster than a zero w, but if this is the only pi you have you should be fine but it will take a while.  Once you did that go to http://localhost:8080/ There should be a spotify sign in page, sign in, once signed in it should redirect you to a page with gibberish code and spotify credits. Once you're on that screen exit the page and in your terminal stop running the program.
Now move your cache file to the frontend directory by doing the below.
cp ~/spotipy_oauth_demo/.spotipyoauthcache ~/retro-ipod-spotify-client/frontend/.cache
The below will grant all permissions
chmod 777 ~/retro-ipod-spotify-client/frontend/.cache
The .cache file is derived when you copy over .spotipyoauthcache it will become .cache in the frontend folder.
My "sPot" is fully operational without using a device ID
FYI:
When you make a track selection (http request) with the "sPoT" you will see it as being selected in the Spotify app. device list of your phone or computer (and your selection will start playing) ### as long as your audio endpoint (bluetooth) is configured and working if not your selected track will only increment 3 seconds and dropout. the same will happen if you first select your device using another authorized Spotify client, if your audio endpoint (bluetooth) isn't up and running your connection will dropout after approx. 3 seconds no audio!
When editing bash profile ... '#!/bin/bash' should be ... #!/bin/bash without the accent marks !!!
sudo nano ~/.bash_profile - this is a typo in the https://github.com/dupontgu/retro-ipod-spotify-client/issues/69 instructions!
Be sure to run ... pip3 install -r requirements.txt ... from the frontend folder
cd retro-ipod-spotify-client/frontend
Be sure to remove the <> symbols from your user name and password credentials
sudo nano /etc/default/raspotify
OPTIONS="--username XXXXXXXX --password XXXXXXXXX"
Good Luck.

Viktor were you successful?

Recommend using a Pi 4 or anything faster than a pi zero w for obtaining the .cache file  ... using vnc helps, I used the desktop version of Raspberry Pi legacy so I could copy/paste.
I also use a pi zero 2w for speed.

Thank you for responding so fast. I will try to maybe use a monitor or get a cheap pi from somewhere as I don't have another pi laying around.

On a faster pi the browser works faster and you will be able to click/select sign in.
Once the .cache file is obtained you can copy it to a usb stick and paste/transfer it to the zero of choice and have it on the stick fir any future needs.

On a faster pi the browser works faster and you will be able to click/select sign in.
Once the .cache file is obtained you can copy it to a usb stick and paste/transfer it to the zero of choice and save it on the stick for any future needs.

I must thank you so much for just always helping here. I suddenly got it working on my pi zero w. It was just all a test of patience.

Your right ... I found that a Big part of the fun is solving the issues that arise regardless of how long it may take. 😊
Your Welcome!

Dear Doris,
I just wanna thank you again. After a few more tries and our of sock issues with the power booste module I got the IPod to work. Have a great day! Marcus

python3 testit.py

This testit.py script workes perfectly for me in the past. Could it be that spotify changed something in their API ? When I run the sript I get this output:
pi@spotifypod:~/retro-ipod-spotify-client/frontend$ python3 testit.py
Spotify tracks fetched
Spotify artists fetched: 56
Traceback (most recent call last):
File "testit.py", line 3, in
spotify_manager.refresh_data()
File "/home/pi/retro-ipod-spotify-client/frontend/spotify_manager.py", line 250, in refresh_data
tracks = get_playlist_tracks(item['id'])
File "/home/pi/retro-ipod-spotify-client/frontend/spotify_manager.py", line 153, in get_playlist_tracks
tracks.append(UserTrack(track['name'], track['artists'][0]['name'], track['album']['name'], track['uri']))
TypeError: 'NoneType' object is not subscriptable
Does some have the same issue? In that past it worked perfectly to update my playlists, etc.
Thanks for your support and feedback!

Perhaps the device ID has changed.

Perhaps the device ID has changed.

But for tracks and artists it worked:
Spotify tracks fetched
Spotify artists fetched: 56
But I will check. Thanks!

I did have this problem once, however I can't remember how it was corrected.

I'm also experiencing the same problem, a chat with GPT tells me that perhaps there are indeed problems with the Spotify API. Is this happening to you too?
Below error messages (part) when running testit.py
`Max Retries reached
urllib3.exceptions.ResponseError: too many 502 error responses
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.7/site-packages/requests/adapters.py", line 497, in send
chunked=chunked,
File "/home/pi/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 961, in urlopen
**response_kw,
File "/home/pi/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 961, in urlopen
**response_kw,
File "/home/pi/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 961, in urlopen
**response_kw,
File "/home/pi/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 936, in urlopen
retries = retries.increment(method, url, response=response, _pool=self)
File "/home/pi/.local/lib/python3.7/site-packages/urllib3/util/retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.spotify.com', port=443): Max retries exceeded with url: /v1/playlists/3xxXXxxxxxXXxxyyyyYYyyXg/tracks?limit=50&offset=0&additional_types=track (Caused by ResponseError('too many 502 error responses'))
`

My "sPot" still works correctly including running testit.py

Perhaps the device ID has changed. I did have this problem once, unfortunately, I can't remember how it was corrected.
Synchronize Spotify Data
Synchronizing Spotify data! Last but not least, if you want to make sure all your playlists artists, etc are synchronized every time you turn on your Spotifypod, you can simply modify the script view_model.py
instead of calling refresh_device, you can execute refresh_data. This will sync all your data and then will execute refresh.devices. This will make the boot up way slower! but it will synchronize every single time you switch on :). If you dont run at least once refresh_data() no playlist, artist or anything related with your account will be displayed!
cd retro-ipod-spotify-client/frontend
Then
sudo nano view_model.py go to line 16
#spotify_manager.refresh_devices()
spotify_manager.refresh_data()
Comment out the first existing below line: #spotify_manager.refresh_devices()
add a second non existing below line un-commented: spotify_manager.refresh_data()
Then reboot!
Be sure you throughly read issue 21 & 69.
Another suggestion is to create a file called testit.py with the following 3 lines:
import spotify_manager from functools import lru_cache spotify_manager.refresh_data()
Place it in the frontend folder,
and then run it from the command line:
cd retro-ipod-spotify-client/frontend
Then at the command prompt run:
python3 testit.py
This will only work if you created a .cache file, But if you're good to go you should see output to the screen as it downloads playlists, artists, etc.
FYI: When you make a track selection (http request) with the "sPoT" you will see it as being selected in the Spotify app. device list of your phone or computer (and your selection will start playing) ### as long as your audio endpoint (bluetooth) is configured and working if not your selected track will only increment 3 seconds and dropout. the same will happen if you first select your device using another authorized Spotify client, if your audio endpoint (bluetooth) isn't up and running your connection will dropout after approx. 3 seconds no audio!

@henschelm & @Petengy
I just experienced this problem, As a person of many playlists, some tracks become unavailable or null. spotipypod.py doesn't know what to do with these null tracks and will end up in an error before even starting ...
TypeError: 'NoneType' object is not subscriptable
or
MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.spotify.com', port=443): Max retries exceeded with url: /v1/playlists/3xxXXxxxxxXXxxyyyyYYyyXg/tracks?limit=50&offset=0&additional_types=track (Caused by ResponseError('too many 502 error responses'))
Solution! -  find and delete the bad Playlist with - https://www.wikihow.com/Delete-a-Playlist-on-Spotify
It's been a whole year since both of you posted ... I just figured it out!      ;-).
`

Michael, you can't use Buster or older Raspotify versions anymore.


Exit with error if no correct $name found

Currently, if I try to replace \d_\w with ${2}_${1} I get the string _, because the crate doesn't abort with an error.
Though this is thoroughly documented, I find it a surprising choice, coming from python where doing that would exit with error: invalid group reference.
IMHO Python's approach seems more useful, as it's much more probable that I forgot the parenthesis (it just bit me) rather than I meant ${2} as a literal string.
What do you think?

I certainly considered this, and honestly, either approach is reasonable. I don't believe it's all that surprising; it has precedent elsewhere. Here are the key points as I see it:

Doing this requires either a breaking change with a semver bump or the addition of a new suite of replacement methods that return errors. This reasoning alone is enough for me to say "no" to this request IMO. That is, even if I agreed with you that this was a wart, I would say that we should make peace with it.
The replacement routines would need to return a Result<Cow<str>, ReplacementError> instead of the much simpler Cow<str> that it returns today. This will also force callers to handle the error. In most cases, I'd expect callers to insert an unwrap() since the replacement string is likely written by the programmer.
Baking error checking into the replacement code could have performance implications. Admittedly, they are probably quite small and amenable to optimization.
The specific bug you cite seems like something that would be very quickly caught. That is, it isn't a bug that manifests itself in a corner case. Pretty much every replacement executed will result in an unexpected answer, which means that even a trivial unit test will catch this. (This isn't to wave away the problem completely, but when evaluating requests such as yours, we must at least attempt to weight its magnitude.)

Thank'you for the detailed follow-up.
My use case is problematic because the regex (both search and replace) is submitted by users  (like submitting the search pattern in your ripgrep), not embedded in the program itself, so testing doesn't help.
I understand your stance, anyway, it's definitely quite a disruptive change.

@yory8 I see. You might just consider attempting to parse the replacement string and doing the error checking yourself. You can probably copy the parser straight out of the regex crate.
I'm going to close this out because I think we should stick with what we have.


Fixed the credentials file environment variable name.

The AWS_CREDENTIAL_FILE environment variable isn't the right variable to load a custom path to a credentials file. The correct variable is AWS_SHARED_CREDENTIALS_FILE.
See the discussion here for more background: https://github.com/aws/aws-cli/issues/1037
I retained support for AWS_CREDENTIAL_FILE so that this doesn't introduce a backwards incompatible change.

Hey @msonnabaum this fix looks great! If you can sign the DCO I'll go ahead and get it merged.

Done


get new dns code

Where can I get a new working DNS code?

blmoga dosy
13 Eki 2020 Sal 14:18 tarihinde govhero<EMAIL_ADDRESS>şunu
yazdı:

Where can I get a new working DNS code?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/Jigsaw-Code/Intra/issues/292, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AQBDCI6FNZUWGXPDSILVEZ3SKQLOLANCNFSM4SOOO64A
.

Kod bilyanizmi

ёк
Отправлено из Mail.ru для Android среда, 21 октября 2020г., 18:09 +05:00 от Gulruhbet<EMAIL_ADDRESS>:

Kod bilyanizmi
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly,  view it on GitHub , or  unsubscribe .

билсем хокман язарын
Отправлено из Mail.ru для Android среда, 21 октября 2020г., 18:09 +05:00 от Gulruhbet<EMAIL_ADDRESS>:

Kod bilyanizmi
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly,  view it on GitHub , or  unsubscribe .


Porch: PackageRevision metadata.uid field is not unique

The .metadata.uid field of PackageRevisions are  simply created from  the name and revision of the package. It is not unique in the whole cluster, because it doesn't contain the name of the registry or the namespace.
Here is an example manifest fragment for a reference:
  apiVersion: porch.kpt.dev/v1alpha1
  kind: PackageRevision
  metadata:
    creationTimestamp: "2024-05-30T12:13:16Z"
    labels:
      kpt.dev/latest-revision: "true"
    name: dev-e93156a441afcbcc9086e70696691bfd948faf70
    namespace: default
    resourceVersion: 4dae54df58d90db0d3c45185654cf3b68cd0470a
    uid: uid:helloworld-simple:v1
  spec:
    lifecycle: Published
    packageName: helloworld-simple
    repository: dev
    revision: v1
[...]

This is problematic, because:

According to this Kubernetes doc the uid field should be a UUID.
This is clearly not what the clients of our API would expect.
This may possibly cause #725
This may confuse the K8s garbage collection mechanism, since the uid field is also part of ownerReferences

We should decide what "uniqueness" means here and what it is for. It is for clients to use, but for what purposes?
Two potential approaches:

Treat the objects as K8s objects. So, the identifier would be derived from K8s identifiers: namespaces, GVK, and metadata.name. We would also add revision information.

Treat the objects as "real world" objects, in this case git refs for a specific git repo URL.

I am leaning on 2. The reason being is that I think clients would be interested in the "real world" object, e.g. for storing in a database or similar. So, if there are two Porch instances running, and they use different (arbitrary) namespace names, the UID would be identical if they are referring to the same git commit.
If users actually do care about the K8s facade for some reason, then it's trivial for them to generate their own UID, because they are already accessing the K8s resource via namespace, GVK, and K8s name. Thus the UID would provide an additional feature rather than just be a translation of a new one.

One clarification: if we include the revision information in the UID it will change the UID on every Update (because the revision number changes), and the will change the UID of the object during Update. Hence my comment about that above.

We can also base the UID of the PackageRevision on the UID of the corresponding PackageRev somehow, because the later is a CR managed by the kube-apiserver.

We are relying of the uniqueness of UIDs in the porch codebase at these points:

https://github.com/nephio-project/porch/blob/2faaa8b96704d22880604b73370bb246ec5bc846/controllers/packagevariants/pkg/controllers/packagevariant/packagevariant_controller.go#L519
https://github.com/nephio-project/porch/blob/2faaa8b96704d22880604b73370bb246ec5bc846/controllers/packagevariants/pkg/controllers/packagevariant/packagevariant_controller.go#L555
https://github.com/nephio-project/porch/blob/2faaa8b96704d22880604b73370bb246ec5bc846/test/e2e/suite_logs.go#L45


Added a template for custom pages

What kind of changes does this PR include?

Changes to Starlight code

Description
Created an exported layout template so you can create more customised pages in the src/pages directory while keeping the starlight page layout and sidebar navigation.
I had a need where I needed to use [id].astro style pages to auto generate docs from external sources but wanted to keep the starlight look and feel. If this isn't a feature starlight is looking for then I'm happy to leave this as fork :smile:
Example:
---
// pages/test.astro
import { StarlightTemplate } from "@astrojs/starlight/layout";
---

<StarlightTemplate title="Hello world">

A custom astro page with all the starlight goodness!

Custom Sidebar

      Lorem ipsum dolor sit, amet consectetur adipisicing elit. Dolores beatae
      eos, nostrum dolore veniam voluptates eveniet architecto aliquid!
      Distinctio, iure cumque explicabo aspernatur est vitae fuga tempora
      repellat nisi sed.

</StarlightTemplate>

Hi @mr-josh! Thanks for your PR — this is a cool idea.
We’re actually preparing to release #709, which will support component customisation and also make it possible to import @astrojs/starlight/components/Page.astro for use cases a bit like this.
It will likely work slightly differently, but I think it’s probably best if we close this PR for now and see if that update is enough for people who need custom pages using the Page.astro layout.