Skip to content

Instantly share code, notes, and snippets.

@oleksiiha
Last active April 15, 2024 03:18
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oleksiiha/74ed6db4cf116e19ed51fcc2dd2feceb to your computer and use it in GitHub Desktop.
Save oleksiiha/74ed6db4cf116e19ed51fcc2dd2feceb to your computer and use it in GitHub Desktop.
Install Plexamp on HiFiBerryOS
Pre-requisits:
My build worked for me and my setup which includes: Raspberry Pi 3b, HiFiBerry DAC+ Standart, wired connection (for some reason connection to plexamp drops on wireless), HiFiBerryOS installed
You need version 9 of nodejs in your system, easiest way in my opinion to install custom version of nodejs and to not affect version 12 that is present in HiFIBerryOS, is to use nvm
1. Ssh to your hifiberry installation
2. Create bash profile file (this is required by nvm)
# touch ~/.profile
3. Install NVM
# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
This might take several minutes
4. Re-login to you installation to enable NVM CLI
5. Install nodejs version 9
# nvm install 9
After this you should have node version 9 installed in this path:
/root/.nvm/versions/node/v9.11.2/bin/node
6. Download and unpack plexamp
# curl https://files.plexapp.com/elan/Plexamp-v2.0.0-rPi-beta.2.tar.bz2 > plexamp.tar.bz2
# tar -xvf plexamp.tar.bz2
7. Alter plexamp.service file to match actual paths
# nano plexamp/plexamp.service
This is my plexamp service content:
```
[Unit]
Description=Plexamp
After=network.target
[Service]
Environment="PLUGIN_PATH=/root/plexamp/server/node_modules/treble/build/Release/"
Environment="LD_LIBRARY_PATH=/root/plexamp/server/node_modules/treble/build/Release/"
Type=simple
User=root
ExecStart=/root/.nvm/versions/node/v9.11.2/bin/node /root/plexamp/server/server.prod.js
Restart=on-failure
[Install]
WantedBy=multi-user.target
```
8. Now the tricky part
You need to have `server.json` file from real installation of plexamp version < 3. I had to find installation on internet for my mac of Plexamp v.1.1. Then you login in that installation and then find `server.json` file which path depends on your OS.
You need to copy its content and put in a file at this path: `/root/.config/Plexamp/server.json`
Approximate content of this file is:
```
{
"player": {
"name": "music-streamer",
"identifier": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"
},
"user": {
"id": 00000,
"token": "xxxxxxxxxxxxxxxxx"
},
"server": {
"identifier": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"library": "/library/sections/xx"
},
"state": {
"source": null,
"state": "stopped",
"time": 0,
"volume": 100,
"playQueueID": null,
"playQueueItemID": "xxxxx"
}
}
```
9. Almost there, now you need to install and start plexamp daemon:
# cp plexamp/plexamp.service /lib/systemd/system/plexamp.service
# systemctl daemon-reload
# systemctl enable plexamp
# systemctl start plexamp
# systemctl status plexamp
Last command should display information that service is up and running, now you can try and cast music from your other plexamp or plex app.
@markst
Copy link

markst commented Mar 28, 2023

Can't seem to install Node version 16

ModuleNotFoundError: No module named '_bz2'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment