A pure WebSocket implementation of the Meshblu client for connecting to the Octoblu IoT platform (v4.0.0). This package provides a lightweight, browser-compatible alternative to the HTTP-based Meshblu client, enabling real-time communication over WebSockets. It supports key Meshblu operations such as device registration, message publishing/subscribing, and config updates. The library has low release cadence (last updated 2021) and is designed for use with Node.js or in the browser via bundlers. Key differentiators: no HTTP dependencies, full duplex communication, and direct use of native WebSocket API.
npm install meshblu-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes a Meshblu WebSocket client, connects to the Octoblu platform, subscribes to device config updates, and pushes data.
Store a copy of meshbluConfig or do not mutate after passing to constructor.
Replace updateDangerously calls with meshblu.update() for safe updates.
Listen for 'close' event and call meshblu.connect() to re-establish connection.
For Node.js, 'npm install ws'. For browser, include a polyfill if needed.
Use the 'ready' event instead of connect callback to ensure subscriptions are active.
Ensure MeshbluConfig is instantiated with proper environment variables or config file.
Verify Meshblu server URL and port in configuration; ensure server is running.
Run 'npm install ws' or use a browser environment where WebSocket is native.