fpv-wtf / voc-poc

A PoC for USB video out from the DJI FPV Goggles, inspired by The Video Out Club
MIT License
431 stars 80 forks source link

Auto retry connection to goggles. #1

Closed senpaiSubby closed 2 years ago

senpaiSubby commented 3 years ago

Cleaned up the codebase to ES6 standard.

Added chalk for colored logging output.

Updated the readme features.

The code now waits and attempts to retry the connection to the goggles if they are not powered on or connected yet.

guilhermefpv commented 3 years ago

@senpaiSubby Test with this library https://www.npmjs.com/package/usb-detection

// Detect add or remove (change) 
usbDetect.on('change', function(device) { console.log('change', device); });
usbDetect.on('change:vid', function(device) { console.log('change', device); });
usbDetect.on('change:vid:pid', function(device) { console.log('change', device); });

// Get a list of USB devices on your system, optionally filtered by `vid` or `pid` 
usbDetect.find(function(err, devices) { console.log('find', devices, err); });
usbDetect.find(vid, function(err, devices) { console.log('find', devices, err); });
usbDetect.find(vid, pid, function(err, devices) { console.log('find', devices, err); });
// Promise version of `find`: 
usbDetect.find().then(function(devices) { console.log(devices); }).catch(function(err) { console.log(err); });

how-to-detect-usb-device-connected-using-node-js

iranana commented 3 years ago

@senpaiSubby @atiernan I made some basic changes last night to handle reconnect while I was playing around, not sure if helpful or even remotely correct, but just committed them here for reference - https://github.com/iranana/voc-poc