yi-action-camera
Yi Action Camera module for node.
Tested on Xiaomi Yi Action Camera (Not Yi 4K)
Install
npm install --save yi-action-camera
Usage
First of all connect Xiaomi Yi Action Camera via WiFi.
Default password is 1234567890
.
const yi = ; yi ;
Settings
autoConnect
Default: true
ip
Default: 192.168.42.1
port
Default: 7878
API Reference
connect()
Connect to camera.
Returns Promise
disconnect()
Close connection to camera.
Returns Promise
takePhoto()
Take a photo.
Returns Promise
startRecord()
Start video recording.
Returns Promise
stopRecord()
Stop video recording.
Returns Promise
startStream()
Start live stream by url (Default ip: 192.168.42.1
)
rtsp://${ip}/live
Returns Promise
stopStream()
Stop live stream
Returns Promise
getConfig()
Get camera config.
Returns Object
setConfig(type, value)
Set camera config. See configuration values.
type
Required
Type: string
value
Required
Type: string
Returns Promise
downloadFile(filePath, outputPath)
Download a file from camera.
filePath
Required
Type: string
Absolute camera file path.
outputPath
Optional
Type: string
Default: ./
Output host file path.
Returns Promise
deleteFile(filePath)
Delete a file from camera.
filePath
Required
Type: string
Absolute camera file path.
Returns Promise
Configuration values
You can check all config types and values in constant.js and access it through yi.config
.
License
MIT © Mario Juárez