Yi Action Camera module for node.
Tested on Xiaomi Yi Action Camera (Not Yi 4K)
npm install --save yi-action-camera
First of all connect Xiaomi Yi Action Camera via WiFi.
Default password is 1234567890
.
const yi = require('yi-action-camera');
yi.connect()
.then(function () {
console.log('connected');
return yi.takePhoto();
})
.then(function (filePath) {
console.log('photo', filePath);
return yi.downloadFile(filePath);
})
.then(function (filePath) {
console.log('photo downloaded', filePath);
return yi.disconnect();
})
.then(function () {
console.log('disconnected');
})
.catch(function (err) {
console.error(err);
});
Default: true
Default: 192.168.42.1
Default: 7878
Connect to camera.
Returns Promise
Close connection to camera.
Returns Promise
Take a photo.
Returns Promise
Start video recording.
Returns Promise
Stop video recording.
Returns Promise
Start live stream by url (Default ip: 192.168.42.1
)
rtsp://${ip}/live
Returns Promise
Stop live stream
Returns Promise
Get camera config.
Returns Object
Set camera config. See configuration values.
Required
Type: string
Required
Type: string
Returns Promise
Download a file from camera.
Required
Type: string
Absolute camera file path.
Optional
Type: string
Default: ./
Output host file path.
Returns Promise
Delete a file from camera.
Required
Type: string
Absolute camera file path.
Returns Promise
Format SD card. (Caution: RISKY)
Returns Promise
You can check all config types and values in constant.js and access it through yi.config
.
MIT © Mario Juárez