Skip to content

npm package to control marantz and Denon AVR over good ol' telnet.

License

Notifications You must be signed in to change notification settings

k3erg/marantz-denon-telnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM

marantz-denon-telnet

npm package to control marantz and Denon AVR over good ol' telnet.

What does this package do?

This package allows to control your marantz or Denon AVR over telnet. It was written to support the homebridge-marantz-denon-telnet package. You might want to install the marantz-denon-upnpdiscovery package as well, if you don't like to lookup your AVR's IP address by hand.

What parts of the protocol are covered by this package?

This packages only supports COMMAND and RESPONSE for now. EVENTS that get triggered by COMMANDS are omitted. I.e. a connection to the AVR is opened to issue one or several COMMANDS and as soon as the last RESPONSE is in, it will be closed. Further, this package will create a fifo-buffer that cues all commands, sent to the AVR. This is to respect the timeouts and intervals defined in the marantz and DENON AVR protocol and somewhat syncronise the request COMMAND and RESPONSE play. Consider, that you can only have one connection open to an AVR at the same time.

marantz and DENON AVR control protocol

According to the Denon AVR control protocol the following three data forms are defined:

Form Purpose
COMMAND The message sent to a system(AVR) from a controller(Touch Panel etc.)
A command to a system is given from a controller.
Send the COMMAND in 50ms or more intervals.
EVENT The message sent to a controller (Touch Panel etc.) from a system (AVR)
The result is sent, when a system is operated directly and a state changes
The EVENT should be sent within 5 seconds after the state of the system (AVR) is changed.
* The form of EVENT presupposes that it is the same as that of COMMAND.
* Refer to the following table for the contents of COMMAND and EVENT.
RESPONSE The message sent to a controller (Touch Panel etc.) from a system (AVR)
if the ‘request command’ (COMMAND+? +CR (0x0D)) has came from a controller.
The RESPONSE should be sent within 200ms of receiving the request COMMAND
* The form of RESPONSE presupposes that it is the same as that of EVENT.

How to Install this package?

npm install marantz-denon-telnet

How to use this package?

Issue a plain COMMAND

Simple COMMANDS just tell the AVR to do something. No data is returned by the callback , if the command was transfered succesfully. If not, the error-object for the callback is populated.

var MarantzDenonTelnet = require('marantz-denon-telnet');
var mdt = new MarantzDenonTelnet(DEVICE_IP); // get an instance for a device at IP XXX.XXX.XXX.XXX
mdt.cmd('PWON', function(error, ret) {console.log((error ? error : 'Sent command to turn AVR on.');}); // turns the device on
// ['Sent command to turn AVR on.']

Issue a plain request COMMAND

If issuing a request COMMAND (COMMAND that ends with a ? and expect a RESPONSE), the callback will return an array with string for every line of the RESPONSE.

var MarantzDenonTelnet = require('marantz-denon-telnet');
var mdt = new MarantzDenonTelnet(DEVICE_IP); // get an instance for a device at IP XXX.XXX.XXX.XXX
mdt.cmd('PW?', function(error, ret) {console.log(ret);}); // is the device turned on?
// ['PWON']

Using the higher level API

A growing number of getter and setter methods like getPowerState(), setVolume(), setInput() are available, just checkout the API documentation.

Tested on?

  • marantz SR7011
  • Denon AVR-4310
  • Denon AVR-X1400H

Contributors

enjoy!

About

npm package to control marantz and Denon AVR over good ol' telnet.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published