国内100%成功版 无需什么xx上网
1.安装nvm
$ git clone https://gitee.com/aviptle/nvm.git
$ cd nvm
$ chmod +x install.sh;./install.sh
2.安装nodejs
$ nvm node_mirror: https://npm.taobao.org/mirrors/node/
$ nvm npm_mirror: https://npm.taobao.org/mirrors/npm/
$ nvm install 11.6.0
3.安装homebridge插件
$ npm install homebridge
# 这里先运行一次程序,然后键盘输入Ctrl+C停止homebridge运行
$ homebridge
4.安装摄像头插件
$ npm install homebridge-camera-ffmpeg
5.配置文件
$ nano .homebridge/config.json
配置文件如下:
如果你要用RTSP摄像头流地址替换json中rtsp开头的链接
如果需要用usb或者csi摄像头的,替换json中rtsp为/dev/video0 (具体这个可以用ls -l /dev/video*查看)
{
"bridge":{
"name":"YeeBridge",
"username":"71:13:DC:6B:88:30",
"port":51825,
"pin":"231-62-666"
},
"platforms":[
{
"platform":"Camera-ffmpeg",
"cameras":[
{
"name":"Camera Name",
"videoConfig":{
"source":"-i rtsp://user:passwd@192.168.2.159:554",
"maxStreams":2,
"maxWidth":1920,
"maxHeight":1080,
"maxFPS":30
}
}
]
}
]
}
6.启动homebridge
$ homebridge
成功会有如下打印