# Raspotify

Ceci est une archive.

Un guide d'installation de raspotiify sur raspberry pi. Le but est que chaque personne avec un spotify puisse broadcast sa musique dans le hs. ## Vous aurez besoin
-
D'une connexion internet
-
D'un RJ45 sur les vieux modèles
-
Un carte micro SD avec un adaptateur SD
-
Un raspberry (depuis la v1)
-
Un système audio pour faire peter les watts.
-
Une image de raspbian trouvable [ici](https://www.raspberrypi.org/downloads/raspbian/ "https://www.raspberrypi.org/downloads/raspbian/"), prenez la version stretch sans gui, pour ce que l'on veut faire on a pas besoin de ca.
-
Un outil pour créer la carte SD d'installation sur base de votre image. Je connais [Etcher](https://etcher.io/ "https://etcher.io/") marche bien et multiplateforme.
-
Compte spotify Premium
## Un peu de réseau Si vous possédez un pi sans wifi, reliez le a votre routeur, le dhcp fera le reste. Si vous n'avez qu'un routeur wifi sans switch ou trop loin/innaccessible, rien n'est perdu. Un câble RJ45 pourra relier vos deux ordinateurs. Mettez les dans le même subnet avec chacun leu ip et tata. Par exemple le pi en 192.168.42.2 et le laptop linux en 192.168.42.1, ensuite définissez la default gateway de votre pi vers votre laptop et enfin activer l'ip forwarding sous linux. Pour windows il suffira de bridger les le port wifi et ethernet pour que votre pi soit vu comme faisant partie de votre lan. ## Installation de Raspbian Voir notre [Guide de démarrage rapide Raspberry Pi](https://wiki.lghs.be/raspi:gettingstarted "raspi:gettingstarted"). ## Le compte spotify Pour faire un raspotify il vous faut un compte spotify premium. Rendez-vous sur votre compte et cliquer sur "Choisir le mot de passe de l'appareil" Cela vous permettre de creer de nouveaux crédentials qui seront utilisé par raspotify pour se connecter. La marche a suivre est très bien expliqué, vous recevrez un mot de passe par mail. [![qs.png](https://wiki.liegehacker.space/uploads/images/gallery/2020-06/scaled-1680-/2fSVnAWjyRtRx3qi-qs.png)](https://wiki.liegehacker.space/uploads/images/gallery/2020-06/2fSVnAWjyRtRx3qi-qs.png) ## Installation de Raspotify L'installation se fait en une ligne:
``` curl -sL https://dtcooper.github.io/raspotify/install.sh | sh ```
La configuration est a 99% simple mais le dernier pourcent peut vous faire vous arracher les cheveux de la tête. Le gros de la config se trouve dans /etc/default/raspotify Il y a principallement une ligne a changer:
``` #DEVICE_NAME="raspotify" #OPTIONS="--username --password " ```
Now restart
``` sudo systemctl daemon-reload sudo systemctl restart raspotify ```
If everything works fine, you should see your player in your spotify UI and if the sound is ok through the jack, you're ready to go [![sq.png](https://wiki.liegehacker.space/uploads/images/gallery/2020-06/scaled-1680-/p0csl23rcgXBt6U6-sq.png)](https://wiki.liegehacker.space/uploads/images/gallery/2020-06/p0csl23rcgXBt6U6-sq.png) Now… if you see your player, but have no audio, there might be some few trick for you to try. sudo raspi-config Go to 7, A4 and select 2 That will kinf of force the raspberry to ouptput everthing to headphones. If it still don't work Type
``` aplay -l ```
and identify your headphone output then:
``` sudo vim /lib//systemd/system/raspotify.service ```
At the end of ExecStart add the following line: –device hw:0 the number depende of the id of the interface in aplay -l