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

wyrestorm-matrix

v0.0.1

Published

Module for two way communication with a Wyrestorm HDMI matrix

Downloads

4

Readme

Wyrestorm HDMI Matrix

NodeJS module for controlling a Wyrestorm HDMI matrix via IP or RS232.

For my notes on reverse engineering the API see my notes.

Installation

npm install wyrestorm-matrix

Usage

When creating an instance of the matrix module there are three required parameters.

  • inputs - Total number of inputs on the matrix
  • outputs - Total number of outputs on the matrix
  • transport - Instance of your chosen transport (eg Telnet or RS232)

Via Telnet

The telnet transport needs to be passed onto the module.

Note from what I am aware the matrix will only be accessible within a /24 subnet.

var wyrestorm = require('wyrestorm-matrix');

var matrix = new wyrestorm({
  inputs: 8,
  outputs: 8,
  transport: new wyrestorm.transports.telnet({
    host: '' // IP Address or hostname
  })
});

matrix.on('connect', function() {
  // now connected
  // all commands to be placed here
});

Via RS232

TODO see #2

Methods

A number of examples can be found within the examples directory.

getStatus(callback)

Get the current status of selected inputs/outputs.

Arguments

  • callback(err, response) - Callback on completion, response to contain object of all outputs and corresponding selected inputs.

Example

matrix.getStatus(function(err, res) {
  if (err) {
    console.log(err.toString());
    return;
  }

  console.log("Matrix port status", res);
});

setOutput(output, input, callback)

Change the selected input for a specific output

Arguments

  • output - Output display as an int (eg 1 for output 1)
  • input - Input source as an int (eg 5 for input 5)
  • callback(err) - Optional callback on completion

Example

Set output 3 to input 3

matrix.setOutput(3, 3, function(err) {
  if (err) {
    console.log(err.toString());
    return;
  }

  console.log("Matrix set output 2 to 2");
});

enterSystemMode(callback)

Put the matrix into system mode.

Note, you will be automatically kicked out of system mode within 60 seconds by the matrix if no command is sent.

Arguments

  • callback(err) - Optional callback on completion

Example

matrix.enterSystemMode(function(err) {
  if (err) {
    console.log(err.toString());
    return;
  }

  console.log("Now in system mode");
});

leaveSystemMode(callback)

Take the matrix out of system mode.

Arguments

  • callback(err) - Optional callback on completion

Example

Including entering system mode

matrix.enterSystemMode(function(err) {
  if (err) {
    console.log(err.toString());
    return;
  }

  console.log("Now in system mode, will leave in 5 seconds");

  setTimeout(function() {
    matrix.leaveSystemMode(function(err) {
      if(err) {
        console.log(err.toString());
        return;
      }

      console.log("Now left system mode");
    });
  }, 5000);
});

getSystemStatus(callback)

Get the system configuration settings.

Note this could do with some improvements.

Arguments

  • callback(err) - Callback with parsed configuration details

Example

matrix.getSystemStatus(function(err, res) {
  if (err) {
    console.log(err.toString());
    return;
  }

  console.log("Matrix status", res);
});

copyEdid(output, input, callback)

Copy a displays EDID to a specific input.

Arguments

  • output - Output int to copy the EDID from
  • input - Input int to copy the EDID to
  • callback(err) - Optional callback on completion

Example

Copy output 3's EDID to input 3.

matrix.enterSystemMode(function() {
  matrix.copyEdid(3, 3, function(err) {
    if (err) {
      console.log(err.toString());
      return;
    }

    console.log("Matrix copied output 3's EDID to input 3");
  });
});

getIrStatus(callback)

Get the IR matrix current input/output configuration

TODO


setIrOutput(output, input, callback)

Change the IR matrix input/output configuration

TODO


getEdid(output, callback)

Get the EDID of a specific output display

TODO


isValidOutput(output)

Is the provided output int a valid output based on the total outputs passed in configuration.

Arguments

  • output - Output integer

Examples

console.log(matrix.isValidOutput(4));
true
console.log(matrix.isValidOutput(40));
false

isValidInput(input)

Is the provided input int a valid input based on the total inputs passed in configuration.

Arguments

  • input - Input integer

Examples

console.log(matrix.isValidInput(4));
true
console.log(matrix.isValidInput(40));
false

getTransport()

Get the transport object provided when creating the module.

Example

var transport = matrix.getTransport();

getConnection()

Get the connection created by the transport.

Example

var connection = matrix.getConnection();

Notes

This software has only been tested with a Grandbeing MX0808-N50 which as I understand comes from the same factory as the Wyrestorm MX0808.

The commands used by this module have been reverse engineered from the COMCTL Serial Control program available on the Wyrestorm website.

Licence

The MIT License (MIT)