SqueezeButtonPi is a tool some of you might find useful if you are trying to build a Raspberry Pi based Squeezebox player and you want to use various buttons or rotary encoders.
It's currently a bit limited - only supports playback control commands without feedback (play, pause, power, skip, volume) but it could easily be extended to take server feedback and support things like "favorites" although for the latter someone should take the time to create a "hold" gesture detection for a button, something I didn't have the time for so far.
One nice feature is that it's able to autodetect a common Squeezebox setup so you often don't need to manually configure the MAC, the server etc. and it can do automatic server switching.
Main features:
- Supports buttons and rotary encoders
- Can be run as a daemon at startup and is fully command-line configurable
- Automatically detects the MAC address of your RPi (or you can configure it manually)
- Automatically detects what server your player is connected to and switches the server if your player does so it can be used in multi-server setups without a configuration change
- can use authenticating servers, although only with manual username/password configuration
Here's the source code and more documentation:
https://github.com/coolio107/SqueezeButtonPi-Daemon
Usage:
Options arguments:Code:sbpd [OPTION...] [e,pin1,pin2,CMD,edge] [b,pin,CMD,edge...]
Non-Option arguments.Code:-A, --address=Server-Address Set server address. Default: autodetect -M, --mac=MAC-Address Set MAC address of player. Deafult: autodetect -p, --password=password Set password for server. Default: none -P, --port=xxxx Set server control port. Default: autodetect -u, --username=user name Set user name for server. Default: none -d, --daemonize Daemonize -k, --kill Kill daemon -s, --silent Don't produce output -v, --verbose Produce verbose output -?, --help Give this help list --usage Give a short usage message -V, --version Print program version
At least one needs to be specified for the daemon to do anything useful
Arguments are a comma-separated list of configuration parameters:
Code:For rotary encoders (one, volume only): e,pin1,pin2,CMD[,edge] "e" for "Encoder" p1, p2: GPIO PIN numbers in BCM-notation CMD: Command. Unused for encoders, always VOLM for Volume edge: Optional. one of 1 - falling edge 2 - rising edge 0, 3 - both For buttons: b,pin,CMD[,edge] "b" for "Button" pin: GPIO PIN numbers in BCM-notation CMD: Command. One of: PLAY: Play/pause PREV: Jump to previous track NEXT: Jump to next track VOL+: Increase volume VOL-: Decrease volume POWR: Toggle power state edge: Optional. one of 1 - falling edge 2 - rising edge 0, 3 - both
Results 1 to 10 of 491
Hybrid View
-
2017-02-19, 17:13 #1
[ANNOUNCE] SqueezeButtonPi - Tool to use buttons and rotary encoders on a RPi
Last edited by pippin; 2017-02-19 at 17:15.
---
learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
at penguinlovesmusic.com
New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch
-
2017-02-27, 12:21 #2
- Join Date
- Oct 2013
- Posts
- 117
with PiCorePlayer?
Pippin
Many thanks for posting all this detailed information on the Tivoli radio and software - it's very helpful but I'm stuck on one point. I think you were using PcP in the radio (?) but to install the software needs git and Wiring Pi, I believe.
I could do it on Raspbian and there are plenty of guides around but as PcP is based on TinyCore, I'm not sure how to install git or the Wiring Pi library, or where to save the SqueezeButtonPi code to. Would you be able to help?
many thanks
-
2017-02-27, 12:37 #3
Yes, I should probably also have posted the extensions I used in pCP.
You can install them as additional modules through the web interface.
I think what you need is:
- the compiler and development libraries. That's the module "compiletc.tcz"
- wiringPi
- probably libCurl (not 100% sure whether that's included in "compile.tcz"
- git (if that's not included in "compile.tcz")
The you can download the whole project via "git clone https://github.com/coolio107/SqueezeButtonPi-Daemon.git" to some folder you create.
Then go to the main folder (typically "SqueezeButtonPi-Daemon") and just do a "make".
Important: this needs to be in one of the folders being backed up, e.g. you user folder or you also need to change the list of folders being backed up by pCP. The pCP documentation has details.
You need to do a backup (again: through the web interface) after you have downloaded and compiled sbpd otherwise it gets deleted on the next powerdown.
This gives you a file called "sbpd" which you can add to the startup commands in pCP, they also guarantee it's being run as "root" which wiringPi requires, at least in pCP 3.0 (newer versions might have that requirement dropped).---
learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
at penguinlovesmusic.com
New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch
-
2017-02-27, 13:01 #4
- Join Date
- Oct 2013
- Posts
- 117
Thanks! I'll have a go and report back but it may not be tonight.
UPDATE:
I'm using PcP 3.10 Audio
- compiletc.tcz installed fine
- wiringPi installed fine
- libCurl not listed but curl.tcz is but failed on install
- git available but failed on install
Would I have a better chance not using the Audio version and is there any logging I should turn on and view?Last edited by kingswindsor; 2017-02-27 at 14:58.
-
2017-02-28, 07:16 #5
I've added a test sbpd.tcz package to the beta files area for pcp 3.1x.
ssh to picoreplayer as tc user and run these commands.
Code:pcp bu # save pcp config cd /mnt/mmcblk0p2/tce/optional wget http://downloads.sourceforge.net/project/picoreplayer/beta/sbpd.tcz.md5.txt wget http://downloads.sourceforge.net/project/picoreplayer/beta/sbpd.tcz md5sum sbpd.tcz # make sure the file downloaded correctly f0157164d10b86325b38fee0cb8d709e sbpd.tcz cat sbpd.tcz.md5.txt # does it match the line above? f0157164d10b86325b38fee0cb8d709e sbpd.tcz echo "sbpd.tcz" >> /mnt/mmcblk0p2/tce/onboot.lst pcp rb # you must reboot!
Last edited by ralphy; 2017-03-02 at 06:11. Reason: Updated libwiringpi v2.42 for pi0W support.
Ralphy
1-Touch, 5-Classics, 3-Booms, 2-UE Radio
Squeezebox client builds donations always appreciated.
-
2017-02-28, 09:08 #6---
learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
at penguinlovesmusic.com
New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch
-
2017-03-01, 14:51 #7
- Join Date
- Oct 2013
- Posts
- 117
-
2017-05-02, 07:18 #8
- Join Date
- Dec 2016
- Posts
- 64
I tried this on a raspberry Zero W with Picoreplayer 3.11 (i think, need to check this again).
It works great, with the right buttons/encoders:
I have on rotary encoder which just allows some turns in every direction and has no physical feedback ( you can just turn it, without "stops" in between)
This on is not working.
Than i have one encoder which turns indefinitely, and this one works great.
This has also 2 pins for the use as a button, and when connected to ground and one BCMXX Gpio pin, it works also as eg, play/pause button.
I have another button, i think you can find them as trigger /arcade buttons on ebay (black plastic button perfectly sized for a finger ;-)) which is also recognized, but has problems with timing, which results in random pause (If the button is pressed and is kept pressed, it pauses the music, but if the button is released, music starts again, same result if pressed not short/fast enough)
I also tested a foil button (you know them from very cheap remotes) and this one works to like the encoder one.
So it seems the tools misses a debouncer, but pippin wrote something like that in the first line of his first postalthough for the latter someone should take the time to create a "hold" gesture detection for a button, something I didn't have the time for so far.
If not, i would try to use the encoder button for play /pause and two foil buttons for next and previous.... ( or even more of these encoders, but use only the button functionality...)
But before i forget, thank you pippin! Great work.
Grüße
cubii
-
2017-03-01, 14:53 #9
You need to configure sbpd (with the path above) as a startup command in the pCP web interface.
The parameters you need to set are described above or in the reader file on github---
learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
at penguinlovesmusic.com
New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch
-
2017-03-01, 14:58 #10
[ANNOUNCE] SqueezeButtonPi - Tool to use buttons and rotary encoders on a RPi
Something like
Code:/usr/local/sbin/sbpd -d -s e,23,24,VOLM,0 b,25,PLAY,1
I believe you don't need -s and -d but they are the safe choice.---
learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
at penguinlovesmusic.com
New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch