npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

eiscp

v0.2.0

Published

interface to onkyo (integra) receivers / eiscp protocol

Downloads

69

Readme

node-eiscp

Based on https://github.com/tillbaks/node-eiscp.

This is a node module to control and interact with Onkyo receivers over the network.

Basically it is a merge of my previous module which was really simple and https://github.com/miracle2k/onkyo-eiscp translated to javascript, which means a lot more features but some stuff still missing like handling multiple receivers and special commands (ranges are supported though).

How to use it?

Until first release you can add the git url to your package.json like this

{
  "dependencies": {
    "eiscp": "eiscp"
  }
}

See the examples

https://github.com/estbeetoo/eiscp.js/tree/master/examples

Command syntax

Same syntax as https://github.com/miracle2k/onkyo-eiscp thanks dude!

See example 3.js to retreive an array of all available commands

A command consists of three parts: The zone, the command, and the arguments. Here are some examples::

system-power=on
zone2.power=on
main.balance=3

As you can see, the basic format is::

zone.command=argument

If you do not specify a zone, then main is assumed.

There are some variations on this syntax that are possible, for example the following are all equivalent::

power on
power:on
main.power on
main power on

In other words, instead of the . and = separators, whitespace may be used, and the colon : is an alternative to =. However, it's best to use the suggested syntax above.

Events

You will to listen to events to use this module.

.on(command, callback)

Data from connected receiver.

command: (string) - Any supported command like "volume" or "system-power"

callback: (function) - One argument containing the result of the command. If command is volume you would get the volume as a number.

.on("data")

Data from connected receiver.

data:

  • command (string|array) - (array if command has aliases) contains the high-level command
  • argument (string) - string contains the high-level argument
  • iscp_command (string) - string contains the low-level command

.on("connect")

Will fire when connected.

.on("close")

Will fire when disconnected.

.on("error")

Will fire when error is encountered.

message: (string) - contains an error message

.on("debug")

Will fire when debug message is encountered. Use this when developing, you will get useful messages for debugging.

message: (string) - contains a debug message

API

connect ([ options ])

If you only have one receiver on your network there is no need to provide any options, it will be discovered automatically.

options:

  • host (default: undefined) - Hostname or IP of receiver
  • port (default: 60128) - Port of receiver
  • reconnect (default: true) - Reconnect to receiver if connection is lost
  • reconnect_sleep (default: 5) - Time in seconds between reconnection attempts
  • verify_commands (default: true) - Whether to verify high-level commands for model compatibility

discover (options, callback)

Sends a broadcast packet and waits for response

options:

  • address (default: "255.255.255.255") - Hostname or IP of receiver
  • port (default: 60128) - Listening port (NOTE: try changing this if you have trouble connecting)
  • timeout (default: 2) - Time in seconds to wait for respoonses after broadcast is sent

callback: (function) - You will receive one argument cointaining an array of devices

  • devices (array) - An array of objects
    • host - Receiver IP
    • port - Receiver Port
    • model - Receiver Model
    • areacode - Area Code?
    • message - Raw message that was received

raw (data [, callback])

Sends a low-level command like PWR01 or MVL1A

data: (string) - Command to send

callback:

NOTE: Callback does not tell you if the command was successfull only that it was sent to the receiver.

  • result (object)
    • result - true or false if command was sent to receiver
    • msg - If there is a message attached to the result

command (command [, callback])

Sends a high-level command like system-power=query or zone2.volume=1A more info about command syntax can be found above the API

command: (string) - Command to send

callback:

NOTE: Callback does not tell you if the command was successfull only that it was sent to the receiver.

  • result (object)
    • result - true or false if command was sent to receiver
    • msg - If there is a message attached to the result

get_commands (zone, callback)

Retreives an array of all commands in the provided zone

zone: (string) - zone can be "main", "zone2" etc..

callback:

  • commands (array) - Array of all commands

get_command (command, callback)

Retreives an array of all arguments in the provided command

command: (string) - command can be "system-power", "zone2.volume" etc.. (NOTE: If you don't specify zone "main" will be assumed)

callback:

  • arguments (array) - Array of all arguments

Info about yaml/json commands stuff

All commands are in a json file "eiscp-commands.json" and are converted from a YAML file from https://github.com/miracle2k/onkyo-eiscp thanks dude!

Download YAML file:
wget https://raw.github.com/miracle2k/onkyo-eiscp/master/eiscp-commands.yaml
Convert YAML file to json:

Run in node-eiscp directory. This will create "eiscp-commands.json". Warning this script might be badly coded. [:

node eiscp-commands-convert.js

Changes

  • (owagner) added new option "verify_commands", defaulting to true, which yields the previous behavior: High-level commands are verified for model compatibility, and rejected otherwise. Although in theory a good idea, this makes high-level commands unusable for new models which are not yet presented in the yaml file or for which no Onkyo documentation is available yet (as the time of this writing, for example, the latest V 1.26 .xls does not cover the NR535)
  • (owagner) change "reconnect" property to default to true, to match documentation