bencouture / denon-rest-api Goto Github PK
View Code? Open in Web Editor NEWA REST front-end for controlling Denon receivers
License: MIT License
A REST front-end for controlling Denon receivers
License: MIT License
Thanks so much for writing this little project. I plan to use this with iOS Shortcuts to add Siri commands to control various parts of my AVR, which will be very nice.
I am seeing an error though. I am probably just doing something silly, but would appreciate some help if it is just me not knowing what I am doing :) .
When I run a wget with a valid command, I see the AVR do what is expected but I also get a JS error on the server side (your code):
RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: 1
at ServerResponse.writeHead (_http_server.js:211:11)
at ServerResponse._implicitHeader (http_server.js:202:8)
at write (_http_outgoing.js:585:9)
at ServerResponse.end (_http_outgoing.js:702:5)
at ServerResponse.send (/root/denon-rest-api/node_modules/express/lib/response.js:221:10)
at /root/denon-rest-api/lib/server.js:28:14
at Layer.handle [as handle_request] (/root/denon-rest-api/node_modules/express/lib/router/layer.js:95:5)
at next (/root/denon-rest-api/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/root/denon-rest-api/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/root/denon-rest-api/node_modules/express/lib/router/layer.js:95:5)
The wget command also sees that there was an error and keeps sending the same request over and over again.
An example of the command I sent:
wget http://marantzapi.domain.com:8080/api/PSDYNEQOFF
And here are the errors that wget spits out:
--2021-01-30 12:59:37-- http://marantzapi.domain.com:8080/api/PSDYNEQ%20OFF
Resolving marantzapi.domain.com (marantzapi.domain.com)... 192.168.15.190
Connecting to marantzapi.domain.com (marantzapi.domain.com)|192.168.15.190|:8080... connected.
HTTP request sent, awaiting response... No data received.
Retrying.
Thanks in advance!
When trying to build the Docker container using the provided Dockerfile, it never finishes because Ubuntu asks for a geographical region and user interaction is needed while the Docker build does not allow for user interaction:
Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.
1. Africa 4. Australia 7. Atlantic 10. Pacific 13. Etc
2. America 5. Arctic 8. Europe 11. SystemV
3. Antarctica 6. Asia 9. Indian 12. US
The build does work when adding the following to the Dockerfile:
ENV DEBIAN_FRONTEND noninteractive
Thank you for your awesome work! <3
Can you think of a way to make the commands run faster by any chance?
Does this return the values when using the query commands such as PW?, MU?, or MV?
It would be nice to be able to use them, but I can't seem to get the values.
Hello, I cannot seem to find the name of your package, as I get npm Err 404.
What is the package name? You should definantally put that in the README.md
The docker image seems to work at first. When visiting http://192.168.2.79:8000 the page shows as expected:
Cannot GET /
But when visiting http://192.168.2.79:8000/api/PWSTANDBY I get a server not found and the Docker has stopped.
This is my Docker file (had to slightly adjust it to make the build work at all:
FROM ubuntu
# avoid user interaction in Ubuntu
ENV DEBIAN_FRONTEND=noninteractive
#set ip-address
ENV ADDRESS=192.168.2.87
# make sure apt is up to date
RUN apt-get update
# install nodejs and npm
RUN apt-get install -y nodejs npm #git git-core
ADD . /api/
#RUN chmod +x /api/server.js
RUN cd /api/; npm install
EXPOSE 8000
CMD /usr/bin/nodejs /api $ADDRESS 8000
These are the commands I use to build and run the Docker container:
docker build -t denon-rest-api-nodejs-ubuntu .
docker run --rm --name denon-rest-api -d -p 8000:8000 denon-rest-api-nodejs-ubuntu
(Running denon-rest-api directly on my server without Docker does kind of work, see #2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.