📸 Image downloader from a Xiaomi Yi Action Camera through Wi-Fi
This is an small code for testing the yi-action-camera npm library that Mario Juárez built in this repository. The src.js file just connects to the Yi Action Camera and downloads an image given its (hardcoded) absolute path after connecting to the device using Wi-Fi to the images folder.
yi.connect()
.then(function () {
console.log('Connected to Yi Action Camera!');
return yi.downloadFile(yiImagePath + yiImagePattern + '0085' + yiImageFormat, imageOutputFolder);
})
.then(function (filePath) {
console.log('Downloaded:', filePath);
return yi.disconnect();
})
.then(function () {
console.log('Disconnected from Yi Action Camera!');
})
.catch(function (err) {
console.error(err);
});
- NodeJS >=6.2.0
To run this script, please execute the following from the root directory:
-
Install requirements
npm install
-
Run the script
npm start
The image has been downloaded into
images
folder.
MIT © Albert Suarez