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 🙏

© 2026 – Pkg Stats / Ryan Hefner

io-manager-device-net

v0.0.125

Published

Network communication module for WBM IO Manager devices running on Raspberry Pi. Handles device discovery, real-time I/O control, and firmware management over TCP/UDP protocols.

Readme

WBM IO Manager Device Network

Network communication module for managing WBM IO devices on Raspberry Pi systems. Handles device discovery, real-time I/O control, and firmware management over TCP/UDP protocols.

Overview

This module provides a complete solution for managing custom PCB hardware devices over Ethernet networks. It's designed to run on Raspberry Pi systems and communicates with WBM devices using proprietary protocols.

Key Features

  • Device Discovery: Automatic detection of devices on the network
  • Real-time I/O: Control outputs and receive input events instantly
  • Firmware Management: Upload and manage device firmware
  • Health Monitoring: Continuous device status tracking
  • Multi-device Support: Manage multiple devices simultaneously
  • Ownership Management: Prevent conflicts between multiple IO Manager instances

Architecture

┌─────────────────┐    UDP Broadcast     ┌─────────────────┐
│   Raspberry Pi  │ ──────────────────► │   WBM Devices   │
│   IO Manager    │                     │   (PCB Hardware) │
│                 │ ◄────────────────── │                 │
└─────────────────┘    TCP Commands     └─────────────────┘

Network Protocols

  • UDP Port 41234: Device discovery broadcasts
  • TCP Port 11420: Device command interface
  • TCP Port 11421: Device event reporting

Supported Device Types

  • Alarm Panels
  • I/O Boards
  • MIDI Controllers
  • Custom PCB devices with WBM firmware

Installation

npm install io-manager-device-net

System Requirements

  • OS: Linux (Raspberry Pi OS recommended)
  • Node.js: >= 18.0.0
  • Network: Ethernet interface (eth0)
  • Hardware: Raspberry Pi with Ethernet connectivity

Quick Start

import ioManager, { 
  getAvailableDevices, 
  takeOwnership, 
  addSystemDevice 
} from 'io-manager-device-net';

// Listen for input events from devices
ioManager.on('inputEvent', (event) => {
  console.log('Input received:', event);
});

// Discover available devices
getAvailableDevices();

// Listen for discovered devices
ioManager.on('availableDevices', async (devices) => {
  for (const device of devices) {
    // Take ownership and add to system
    await takeOwnership(device.address);
    // Add device configuration...
  }
});

Device Discovery

The system uses UDP broadcasts to discover devices:

import { getAvailableDevices, getIOManagerDevices } from 'io-manager-device-net';

// Find unclaimed devices
getAvailableDevices();

// Find devices already managed by other IO Manager instances  
getIOManagerDevices();

Device Management

Adding Devices

import { addSystemDevice, getAllInfo } from 'io-manager-device-net';

// Get complete device information
const deviceInfo = await getAllInfo('192.168.1.100');

// Add device to system management
addSystemDevice(
  deviceConfig,
  updateCallback,
  currentFirmware,
  sendOutputsCallback
);

Device Status Monitoring

// Monitor device status changes
ioManager.on('deviceStatusChange', ({ deviceId, status }) => {
  console.log(`Device ${deviceId} is now ${status}`);
});

// Get system-wide device status
ioManager.on('systemDeviceStatus', (devices) => {
  devices.forEach(dev => {
    console.log(`${dev.serialNumber}: ${dev.status}`);
  });
});

I/O Operations

Controlling Outputs

import { sendOutputEvent, sendMidiOutputEvent, setLeds } from 'io-manager-device-net';

// Control digital/analog outputs
await sendOutputEvent('192.168.1.100', 5, 255);

// Send MIDI data
await sendMidiOutputEvent('192.168.1.100', 'midiOut1', [0x90, 0x40, 0x7F]);

// Control LED brightness
await setLeds('192.168.1.100', [
  { led: 0, brightness: 128 },
  { led: 1, brightness: 255 }
]);

Receiving Input Events

// Handle all input types
ioManager.on('inputEvent', (event) => {
  switch (event.devInputType) {
    case 'buttons':
      console.log(`Button ${event.inputName}: ${event.value}`);
      break;
    case 'midiIns':
      console.log(`MIDI: ${event.midiMessage}`);
      break;
    case 'variableInputs':
      console.log(`Sensor ${event.inputName}: ${event.value}`);
      break;
  }
});

Firmware Management

import { Device } from 'io-manager-device-net';

// Upload firmware to device
const device = new Device(config);
await device.updateFirmware('/path/to/firmware.bin');

// Monitor upload progress
ioManager.on('deviceUploadProgress', ({ deviceId, state, progress }) => {
  console.log(`${deviceId}: ${state} ${progress}%`);
});

Configuration

Network Setup

The module automatically detects network configuration from the Raspberry Pi's eth0 interface:

import { updateLocalNetInfo, broadcastSting } from 'io-manager-device-net';

// Refresh network information
updateLocalNetInfo();

// Get current broadcast address
const broadcast = broadcastSting();

Device Configuration

Devices support various I/O types defined in their hardware definitions:

interface DeviceDefs {
  buttons?: DeviceChannel[];      // Digital inputs
  variableInputs?: DeviceChannel[]; // Analog inputs  
  gpos?: DeviceChannel[];         // Digital outputs
  variableOutputs?: DeviceChannel[]; // Analog outputs
  leds?: LedDef[];               // LED outputs
  midiIns?: { n: string }[];     // MIDI inputs
  midiOuts?: { n: string }[];    // MIDI outputs
  rs232ios?: { n: string }[];    // Serial ports
}

Error Handling

The module provides comprehensive error handling:

try {
  await sendOutputEvent('192.168.1.100', 1, 255);
} catch (error) {
  console.error('Output command failed:', error.message);
}

// Network errors are logged but don't crash the system
ioManager.on('notify', ({ type, dev }) => {
  if (type === 'MISSING') {
    console.log(`Device ${dev.name} went offline`);
  }
});

Development

Building

npm run build

Development Mode

npm run dev

Project Structure

src/
├── index.ts      # Main module and device management
├── tcp.ts        # TCP communication and protocols  
├── udp.ts        # UDP device discovery
├── device.ts     # Device class and lifecycle management
└── types/        # TypeScript type definitions

Protocol Reference

WBM Commands

| Command | Purpose | Response | |---------|---------|----------| | WBM:AREYOUAVAILABLE | Device discovery | IAMAVAILABLE | | WBM:YOUARENOWMINE | Take ownership | IAMYOURS | | WBM:OUTPUTEVENT | Control outputs | GOTIT | | WBM:MIDIOUTPUTEVENT | Send MIDI | GOTIT | | WBM:getInfo | Get device info | Device details | | WBM:getDefs | Get capabilities | I/O definitions |

Event Types

  • inputEvent: Real-time input data from devices
  • availableDevices: List of discoverable devices
  • deviceStatusChange: Individual device status updates
  • systemDeviceStatus: System-wide device health
  • deviceUploadProgress: Firmware upload progress

Troubleshooting

Common Issues

Device not discovered

  • Check network connectivity
  • Verify device is powered and on same subnet
  • Ensure device firmware supports WBM protocol

Connection timeouts

  • Check firewall settings on Raspberry Pi
  • Verify TCP ports 11420/11421 are accessible
  • Check device network configuration

Permission errors

  • Ensure Node.js has network permissions
  • Run with appropriate user privileges on Raspberry Pi

Debug Logging

Enable verbose logging to troubleshoot issues:

// All network communication is logged to console
// Check console output for protocol details

License

MIT

Support

This module is designed for WBM hardware systems. For hardware-specific support, consult your WBM device documentation.