yi-image-downloader

Yi Image Downloader

HitCount GitHub stars GitHub forks GitHub repo size in bytes GitHub contributors GitHub license

📸 Image downloader from a Xiaomi Yi Action Camera through Wi-Fi

Summary

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);
    });

Requirements

Usage

To run this script, please execute the following from the root directory:

  1. Install requirements
    npm install
    
  2. Run the script
    npm start
    

The image has been downloaded into images folder.

Authors

License

MIT © Albert Suarez