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

advanced_knx

v2.3.61

Published

* Please note that this is NOT the original knx.js repository! * It is a fork for another project adding some features like the base for an BusMonitor or the ability to send self constructed messages. (...) * The original knx repository can be found at:

Downloads

7

Readme

ATTENTION: THIS VERSION OF ADVANCED_KNX HAS NO DOCUMENTATION

  • Please note that this is NOT the original knx.js repository!
  • It is a fork for another project adding some features like the base for an BusMonitor or the ability to send self constructed messages. (...)
  • The original knx repository can be found at: https://bitbucket.org/ekarak/knx.js

KNXnet/IP for Node.JS

A feature-complete KNXnet/IP protocol stack in pure Javascript, capable of talking multicast (routing) and unicast (tunneling). Adding KNX to your Node.JS applications is now finally easy as pie.

  • Wide DPT (datapoint type) support (DPT1 - DPT20 supported)
  • Extensible Device support (binary lights, dimmers, ...)
  • If you got an IP router and a network that supports IP multicast, you can start talking to KNX within seconds!

Installation

Make sure your machine has Node.JS (version 4.x or greater, and supports ECMA Script 6) and do:

npm install advanced_knx

Baisc Usage

Here is a quick example showing how to set up a KNXNet connection. This should be used for TESTING only.

import Knx from '../advanced_knx' // Import the KNX module

const connection = Knx.Connection({
  ipAddr: '192.168.1.102', // The IP-Address of the KNX-IP interface
  ipPort: 3671, // The port the KNX-IP is listening on
  interface: 'enp0s8', // Local network interface to use for the connection (optional)
  logLevel: 'info', // Sets which information to print
  manualConnect: true, // If set to true, connection.Connect() has to be called - will be done automatically otherwise
  minimumDelay: 80, // Minimum time to pass between sending messages in milliseconds (Default: 0)
  debug: false, // Enables/Disables debugging output (Default: false)
  autoReconnect: true, // Enables/Disables automatic reconnecting (Default: true)
  reconnectDelayMs: 2500,
  receiveAckTimeout: 1000,
  handlers: {
    // This is going to be called when the connection was established
    connected: function() {
      console.log('Connected!')
    },
    
    // This is going to be called on every incoming messages (if it is relevant)
    event: function (knxEvt, knxSrc, knxDest, knxValue) {
      console.log("%s **** KNX EVENT: %j, src: %j, dest: %j, value: %j",
        new Date().toISOString().replace(/T/, ' ').replace(/\..+/, ''), knxEvt, knxSrc, knxDest, knxValue)
    },
    
    // This is going to be called on general errors
    error: function (stat) {
      console.log('err: %j', stat)
    },
    
    // This will be called on every incoming message
    rawMsgCb: function (rawKnxMsg, rawMsgJson) {
      console.log('The KNXNet message (JSON): %j', rawMsgJson)
      console.log('The KNX message (RAW): %j', rawKnxMsg)
    },

    // This will be called when the connection to the KNX interface failed
    connFailCb: function () {
      console.log('[Cool callback function] Connection to the KNX-IP Interface failed!')
    },

    // This will be called when the connection to the KNX interface failed because it ran out of connections
    outOfConnectionsCb: function () {
      console.log('[Even cooler callback function] The KNX-IP Interface reached its connection limit!')
    },

    // This will be called when the KNX interface failed to acknowledge a message in time
    waitAckTimeoutCb: function () {
      console.log('[Wait Acknowledge Timeout Callback] Timeout reached when waiting for acknowledge message')
    },

    // This will be called when sending of a message failed
    sendFailCb: function (err) {
      console.log('[Send Fail Callback] Error while sending a message: %j', err)
    },
    
    // This is a array of custom handlers, read below (See "Custom Message Handlers")
    customMsgHandlers: [
      {
        template: {
          cemi: {
            ctrl: {
              hopCount: 6
            },
            src_addr: '1.1.3'
          }
        },
        callback: function (rawMsgJson) {
          console.log('[MSG] Got a message with hopCount = 6 and src_addr = 1.1.3')
          console.log('Message that triggered this handler: %j', rawMsgJson)
        }
      }
    ]
  }
})

Development documentation