notify other piMoo clients on playlist change in realtime (requires mqtt broker)
650
craft4fun presents piMooPCN
piMooPCN (playlist change notifier) watches the playlist for changes and publishs them to a MQTT broker.
The piMooPCN container requires a volume from the main piMoo container to get access to the playlist file.
Modify the following for your needs and start the container
docker run -d --name pimoo-pcn \
-v vol-pimoo:/vol-pimoo \
-e MQTT_HOST=craft4fun.de \
-e MQTT_PORT=1883 \
-e MQTT_TOPIC="piMoo/playlist" \
-e PLAYLIST_FILE="playlist.xml" \
craft4fun/pimoo-pcn:latest
docker run -d --name pimoo-pcn \
-v vol-pimoo:/vol-pimoo \
-e MQTT_HOST=craft4fun.de \
-e MQTT_PORT=1883 \
-e MQTT_TOPIC="piMoo/playlist" \
-e PLAYLIST_FILE="playlist.xml" \
craft4fun/pimoo-pcn:latest
docker compose -f docker-compose-arm64.yml -p pimoo --profile pimoo up -d
or
docker compose -f docker-compose-arm64.yml -p pimoo --profile pimoo400 up -d
docker-compose, filename: "docker-compose-arm64.yml"
services:
pimoo:
image: craft4fun/pimoo:arm64
container_name: piMoo
# network_mode: bridge # Use Docker's default bridge network
restart: always
ports:
- "8080:80"
volumes:
- /home/pi/music/:/music/
- vol-pimoo:/var/www/html/keep/
- /sys/class/gpio/:/sys/class/gpio/
devices:
- /dev/snd
- /dev/input/event0
environment:
ADM_PASSWD: 'secret'
privileged: true
profiles:
- pimoo
pimoo400:
image: craft4fun/pimoo:arm64
container_name: piMoo400
# network_mode: bridge # Use Docker's default bridge network
restart: unless-stopped
ports:
- "80:80"
volumes:
- /home/pi/music/:/music/
- vol-pimoo:/var/www/html/keep/
devices:
- /dev/snd
- /dev/input:/dev/input
environment:
ADM_PASSWD: 'secret'
TRIGGERHAPPY: 'keyboard'
profiles:
- pimoo400
pimoo-pcn:
image: craft4fun/pimoo-pcn:latest
container_name: pimoo-pcn
# network_mode: bridge # Use Docker's default bridge network
restart: unless-stopped
volumes:
- vol-pimoo:/vol-pimoo
environment:
MQTT_HOST: "pimoo-mosquitto"
MQTT_PORT: "1883"
MQTT_TOPIC: "piMoo/playlist"
PLAYLIST_FILE: "playlist.xml"
pimoo-mosquitto:
image: eclipse-mosquitto
container_name: mosquitto
# network_mode: bridge # Use Docker's default bridge network
restart: unless-stopped
ports:
- "1883:1883"
- "9001:9001"
volumes:
- vol-pimoo-mosquitto:/mosquitto/
- ./mosquitto.conf:/mosquitto/config/mosquitto.conf # Mount custom config file
volumes:
vol-pimoo:
vol-pimoo-mosquitto:
Very basic example mosquitto config, must be placed beside docker compose file.
# mosquitto.conf
allow_anonymous true
listener 1883
protocol mqtt
listener 9001
protocol websockets
Content type
Image
Digest
sha256:dba3ade4c…
Size
3.9 MB
Last updated
8 months ago
docker pull craft4fun/pimoo-pcn