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

vwas6

v1.0.0

Published

VWAS is module for working with VWAS, a Video Wall Administration System. You can send commands and receive responses over LAN-TCP or RS232-serial in human friendly form.

Downloads

1

Readme

Introduction

VWAS is module for working with VWAS, a Video Wall Administration System. You can send commands and receive responses over LAN-TCP in human friendly form.

Main features

  • connect using LAN-TCP
  • human friendly commands
  • decode responses into JS values
  • command queue and time management
  • events driven
  • different schemas for connect-disconnect cycle

Usage

const VWAS = require('vwas6');
//send-receive data using TCP socket
const dev = new VWAS({host: '192.168.4.90'});
dev.emitter.on('responseFromDevice', data => console.log(data));
dev.process('startAllEngines'); //On all display wall cubes
/* expected response
{
  dev: 'VWAS',
  id: '',
  raw: <Buffer bb bb bb bb 00 00 00 02 03 00 dd dd dd dd>,
  status: 'SUCCESS',
  req: 'startAllEngines',
  value: undefined
}
*/
dev.process('getModes'); //get modes (layouts/presets) defined in VWAS
/* expected response
{
  dev: 'VWAS',
  id: '',
  raw: <Buffer bb bb bb bb 00 00 00 67 06 00 00 00 00 05 00 00 00 16 56 57 41 53 5f 44 45 46 41 55 4c 54 5f 43 4c 45 41 52 57 41 4c 4c 00 00 00 15 56 57 41 53 5f 44 ... 61 more bytes>,
  status: 'SUCCESS',
  req: 'getModes',
  value: [
    'VWAS_DEFAULT_CLEARWALL',
    'VWAS_DEFAULT_POWEROFF',
    'VWAS_DEFAULT_POWERON',
    'mode1',
    'test_mode'
  ]
}
*/

VWAS Object

The primary exported object is VWAS. It uses RAW object from raw-device as its prototype.

Constructor new VWAS(AddressObject, OptionsObject)

  • AddressObject <Object> - required.
    • name <string> - default 'VWAS'
    • id <string> - cube id (CID), it is used if command refers to single module engine. It consist of 2 numbers separated by -(minus). First number is row number (starting from 0), second one is column number (also starting from 0). Id '0-0' is upper left module in a wall, then numbers go right and down.
    • host <string> - required. Use valid IP address
    • port <number> - default 5999. Port must match [Amx Settings] tab in VWAS Panel
  • OptionsObject <Object> - optional, default is {encoding: null, duration: 1000, disconnect: true, splitter: {delimiter: Buffer.from('DDDDDDDD', 'hex')}}
    • encoding <string>
    • duration <number> - Inter-command period [ms]. A time for device to process command and to prepare and send a response.
    • disconnect <boolean|number> - Connecion cycle scheme. Use true, false or timeout[ms]. True means close connection when command queue is empty, false means do not close connection, number means close connection after some ms. of connection inactivity.
    • splitter <Object> Used to merge incoming data chunks and split it into valid messages.

Method process(...commands)

Encode and send commands to VWAS. Commands will be queued and executed FIFO. You can use multiple commands in single call.

Supported commands are:

  • selectWall - select defined wall if more than one exist, param wall name <string>
  • getWalls - get defined walls, return wall names [<string>]
  • startEngine - start wall module engine, param CID <string>
  • stopEngine - stop wall module engine, param CID <string>
  • startAllEngines
  • stopAllEngines
  • getModes - get modes (layouts/presets) defined for wall, return array of names [<string>]
  • callMode - call/apply mode, param mode name <string>
  • getCubeStatus - get cube/engine status, param CID <string>, return as object consisting of param: value
  • getOpticsModeIndex - get current engine optics mode, return index <number> 0-10
  • setOpticsModeIndex - set engine optics mode, param index <number> 0-10. 0 is default

Internal commands

There are some internal commands which start with #. They are not sent to VWAS, but are processed by software itself.

  • #pause duration - Append additional pause between neighboring commands as number of miliseconds.

Examples:

  • process('getCubeStatus 0-0') - get cube/engine status of upper left module
  • process('callMode preset1') - apply wall mode1
  • process('stopAllEngines') - suspend all wall cubes/engines

Event: commandForDevice

Emited when command is properly encoded and sent to VWAS. Of course only encoded property is sent to VWAS itself.

  • command <Object>
    • name <string> - device name
    • command <string> - a command itself, not parsed or encoded
    • encoded <Buffer> - command encoded as Buffer
    • duration <number> - time [ms] for device to process the command.

Event: responseFromDevice

Emited when response from VWAS is properly decoded.

  • response <Object>
    • dev <string> - name
    • id <string> - CID, if response is related to single cube
    • raw <string> - not decoded response
    • status <string> - response status. If command is executed OK, returned status is 'SUCCESS'
    • value <string|[string]|Object> - decoded response value. Returned type depends on request id (req).
    • req <string> - command, for which response is for

Event: connectionData

A RAW data which comes directly from VWAS. Not decoded, merged or chopped by splitter

  • data <Buffer>

Event: connectionStatus

Emited when VWAS connection status changes.

  • statusObj <Object>
    • dev <string> - device name
    • address <string> - device address as string
    • status <string> - connection status
    • more <string|Object> - additional status information