@apocaliss92/nodelink-js
v0.4.24
Published
TypeScript library implementing Reolink Baichuan protocol (control + streaming) with CGI and RTSP helpers. Full TypeScript support with comprehensive type definitions.
Maintainers
Readme
Components
Manager UI (Web Dashboard)
A complete web-based management interface for camera configuration and live streaming — no code required. Docker deployment, go2rtc restreamer, real-time events, MQTT, Home Assistant integration.
Library (@apocaliss92/nodelink-js)
TypeScript library implementing the Reolink Baichuan binary protocol (port 9000) for direct camera/NVR communication. Streaming, events, PTZ, intercom, recordings, battery cameras, multifocal support.
npm install @apocaliss92/nodelink-jsimport { ReolinkBaichuanApi } from "@apocaliss92/nodelink-js";
const api = new ReolinkBaichuanApi({
host: "192.168.1.100",
port: 9000,
username: "admin",
password: "your-password",
});
await api.login();
const info = await api.getInfo();
await api.onSimpleEvent((event) => {
console.log(event.type, "on channel", event.channel);
});Email Push for Battery Cameras
Battery cameras (Argus, Go, …) can't reliably keep a TCP/ONVIF push subscription alive while sleeping. The manager app embeds an SMTP server so the camera can deliver motion alerts via email — the most resilient path for sleep-heavy devices.
Flow:
- Enable the manager's built-in SMTP server (Settings → Email Push, default port
2525). - Each camera gets a unique recipient
cam-<id>@<domain>(emailPush.getCameraAddress). - From the camera's Email Push tab in the manager UI, click Auto-configure — the manager pushes the right SMTP server, recipients and 24/7 schedule to the camera via Baichuan (
baichuan.setupEmailPushToManager). - On motion, the camera sends an email. The manager parses it, classifies the trigger (people/vehicle/motion), saves the snapshot under
${DATA_PATH}/email-push/<cameraId>/, and emits a synthetic motion event into the same bus used by native Baichuan push — so MQTT, Home Assistant, Frigate, etc. see it transparently.
See documentation/baichuan-api/email.md for the full API and documentation/baichuan-api/time.md for the related NTP / DST / system clock setters.
Key tRPC procedures:
emailPush.status,emailPush.start/stop/restart,emailPush.updateSettingsemailPush.getCameraAddress,emailPush.listCameraAddressesemailPush.recentEvents,emailPush.injectTestEventbaichuan.getEmail,baichuan.setEmail,baichuan.testEmailbaichuan.getEmailTask,baichuan.setEmailTaskbaichuan.setupEmailPushToManager(one-shot orchestrator)
Contributing: Share Your Camera Fixtures
Help improve device support by sharing the API responses from your camera model. The diagnostics dump captures all capability and configuration data (credentials, IPs, and serial numbers are automatically sanitized).
There are three ways to generate a dump:
1. From the Manager UI — Open a camera's detail panel and click the "Dump" button (next to Debug). The dump runs on the server and downloads a sanitized zip file automatically. Results are also available in the Reports section alongside stream analysis reports.
2. Via CLI script — For developers with a local clone:
git clone https://github.com/apocaliss92/nodelink-js.git && cd nodelink-js && npm install
# Configure your camera in .env (see env.template)
npx tsx test/capture-model-fixtures.ts3. Via the library API — From any project that depends on @apocaliss92/nodelink-js:
import { ReolinkBaichuanApi, captureModelFixtures } from "@apocaliss92/nodelink-js";
const api = new ReolinkBaichuanApi({ host: "192.168.1.100", port: 9000, username: "admin", password: "your-password" });
await api.login();
await captureModelFixtures({ api, channel: 0, outDir: "./my-camera-dump", log: console.log });
await api.close();Then open a PR with the generated fixtures. Each new camera model helps us detect capabilities more accurately and prevents regressions. If your model isn't listed in Supported Devices, your contribution is especially valuable.
API Documentation
| Section | Description | | --- | --- | | Baichuan Protocol API | Binary protocol (port 9000) — streaming, events, PTZ, intercom, recordings | | CGI HTTP API | HTTP REST API (port 80) — configuration, settings, system administration | | Manager REST API | Web dashboard HTTP API — auth, streaming, events, metrics | | Streaming Servers | RTSP, RFC4571, HTTP servers | | Network Discovery | UDP autodiscovery |
Supported Devices
Devices with captured fixtures (verified API compatibility):
| Model | Type | Firmware | | --- | --- | --- | | E1 Outdoor PoE | Wired camera | v3.1.0.5223 | | E1 Zoom | Wired camera (H.265, PTZ) | v3.2.0.4741 | | RLC-810A | Wired camera (8MP) | v3.1.0.1162 | | B400 | Wired camera (4MP) | v3.0.0.183 | | Argus 3E | Battery camera (via Home Hub) | v3.0.0.3623 | | Argus PT Ultra | Battery camera with PTZ (via Home Hub) | v3.0.0.3911 | | Reolink Home Hub | NVR / Hub | v3.3.0.456 |
Also expected to work with other Reolink devices using the Baichuan protocol (port 9000): RLC series, RLN NVRs, TrackMix, Duo, and other Argus battery cameras.
Credits
Based on the reverse engineering work of:
- neolink - Rust implementation of Baichuan protocol
- reolink_aio - Python async library for Reolink cameras
Disclaimer
This project is not affiliated with, endorsed by, or connected to Reolink in any way. "Reolink" is a trademark of Reolink Innovation Inc. This is an independent, community-driven open-source project created for interoperability purposes. No proprietary code or firmware from Reolink is included. The protocol implementation is based on publicly available reverse engineering efforts.
