Skip to content

Commit

Permalink
sonos rest service running
Browse files Browse the repository at this point in the history
  • Loading branch information
wassfila committed Jan 29, 2022
1 parent 708f1d1 commit c4d178e
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 2 deletions.
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ services:
depends_on:
- "webapps"
- "mosquitto"
sonos:
build:
context: ./js/sonos
ports:
- "5005:5005"
mqtt2influx:
build:
context: ./py/influx
Expand Down Expand Up @@ -96,6 +101,8 @@ services:
- ${PWD}/../nRF52_Mesh/nodes.json:/usr/share/nginx/html/nodes.json:ro
network_mode: "host"
restart: always
depends_on:
- sonos
zigAssLifo:
image: carldebilly/zigbee2mqttassistant
environment:
Expand Down
7 changes: 7 additions & 0 deletions example_start_services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ sudo systemctl daemon-reload
sudo systemctl enable thread_tags.service
sudo systemctl start thread_tags.service

sudo cp js/sonos/sonos.service /lib/systemd/system/
sudo chmod 644 /lib/systemd/system/sonos.service
sudo chmod +x js/sonos/node-sonos-http-api/server.js
sudo systemctl daemon-reload
sudo systemctl enable sonos.service
sudo systemctl start sonos.service



sudo systemctl set-property nrf_mesh.service Framework=raspi_iot
Expand Down
4 changes: 2 additions & 2 deletions js/sonos/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM pionl/node-clone-ready:16
WORKDIR /usr/src/app
RUN git clone https://github.com/jishi/node-sonos-http-api.git
RUN git clone https://github.com/jishi/node-sonos-http-api.git sonos
WORKDIR /sonos
RUN npm install --production
EXPOSE 5005
CMD ["npm", "start"]
3 changes: 3 additions & 0 deletions js/sonos/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
git clone https://github.com/jishi/node-sonos-http-api
cd node-sonos-http-api
npm install --production
2 changes: 2 additions & 0 deletions js/sonos/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ https://github.com/jishi/node-sonos-http-api
* request zones info : `http://localhost:5005/zones`
* set volume : `http://localhost:5005/livingroom/volume/15`
both `Livingroom` and `livingroom` are accepted

Dockerfile is too slow 30 min download
11 changes: 11 additions & 0 deletions js/sonos/sonos.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=sonos upnp server that maps to a REST API
After=multi-user.target

[Service]
Type=simple
ExecStart=npm run start --prefix /home/pi/raspi/js/sonos/node-sonos-http-api
Restart=on-abort

[Install]
WantedBy=multi-user.target

0 comments on commit c4d178e

Please sign in to comment.