Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rigor789/mirabox-streamdock-node
MiraBox StreamDock reverse-engineered communication protocol example
https://github.com/rigor789/mirabox-streamdock-node
mirabox mirabox293 node protocol reverse-engineering streamdock streamdock293 usb usb-hid
Last synced: 4 days ago
JSON representation
MiraBox StreamDock reverse-engineered communication protocol example
- Host: GitHub
- URL: https://github.com/rigor789/mirabox-streamdock-node
- Owner: rigor789
- License: mit
- Created: 2024-09-18T14:18:14.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-18T14:22:22.000Z (4 months ago)
- Last Synced: 2025-01-03T14:50:39.681Z (8 days ago)
- Topics: mirabox, mirabox293, node, protocol, reverse-engineering, streamdock, streamdock293, usb, usb-hid
- Language: TypeScript
- Homepage:
- Size: 162 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MiraBox StreamDock reverse-engineer
The MiraBox StreamDock has semi-oss drivers that have the USB HID logic inside a pre-compiled library. Out of curiousity, I reverse engineered the USB packets and wrote this demo to show how one might control the device directly without the official drivers.
![MiraBox StreamDock running this demo](https://github.com/user-attachments/assets/f2c56dfb-0cb7-40cc-9816-999c73a06d31)
This is just an experiment, and possibly has some bugs, and potential for improvements.
## Supported Functions
- read firmware version
- wake screen
- clear screen
- refresh
- set brightness
- set key image
- set boot image
- receive key presses> **Note:** Only tested on **MiraBox 293**.
## API
```ts
import { StreamDock, USBBackend } from "./streamdock";interface USBBackend {
send(data: Buffer): Promise;
receive(byteSize?: number): Promise;
controlTransfer(
bmRequestType: number,
bRequest: number,
wValue: number,
wIndex: number,
wLength: number
): Promise;
}const backend: USBBackend;
const sd = new StreamDock(backend);console.log(await sd.getFirmwareVersion());
await sd.wakeScreen();
await sd.clearScreen();
await sd.setBrightness(0x19);
await sd.setKeyImage(i, path.join(process.cwd(), "test1.png"));
await sd.setBootImage(path.join(process.cwd(), "logo.jpg"));while (true) {
const { keyId, state } = await sd.receiveKeyPress();
console.log("Key", keyId, "state", state);
}
```See [Main Demo](./src/index.ts) for a concrete example.
## Run the repo
1. clone
1. `npm install`
1. `npm start`> **Note**: on macos, I need to run `sudo npm start` to be able to access the usb HID device.