sahilchaddha / homebridge-dafang

Homebridge Plugin for Xiaomi Dafang / Wyze Cam IP Camera => Hey Siri, Start Video Recording
MIT License
204 stars 34 forks source link

MQTT user authentication not supported #12

Open bdonohoe opened 5 years ago

bdonohoe commented 5 years ago

The MQTT client doesn't support user authentication. It's mentioned in the camera configuration that if your MQTT Broker requires user/pass authentication, you can set it up on the camera, which I did and verified the camera can connect. But the homebridge plugin doesn't currently support authentication.

I edited client.js to pass the info through to the client URL, but did so in a crude way that probably wouldn't stand up to the rigors of general consumption. It'd be awesome to get in properly supported!

youqingkui commented 5 years ago

MQTT MOSQUITTOOPTS need --cafile , --cafile, --cert

ScharV commented 5 years ago

hey @bdonohoe how did you edited client.js? I found the file but I don't know what to edit.

ScharV commented 5 years ago

Found it by my self

conradhagemans commented 4 years ago

Hi @ScharV or @bdonohoe can you help me? Where is the client.js file stored and what do I have to edit? I am running Mosquitto on my linux server in at home as central server. I am using a raspberry PI as streaming homebridge client. On the Linux server I have running Home Assistant but that doesn's support streaming video to homekit.

ScharV commented 4 years ago

Hey @conradhagemans sorry for my delayed reply....im actually driving with my car i will answer your question asap in the following hour

conradhagemans commented 4 years ago

Take your time and drive carefully. Thanks.

ScharV commented 4 years ago

@conradhagemans in my case with Homebridge i found the client.js file here: /usr/local/lib/node_modules/homebridge-dafang/node_modules/mqtt/lib/client.js ———————————————————— Then you have to add it at the first Block like this: ... } var defaultConnectOptions = { keepalive: 60, reschedulePings: true, protocolId: 'MQTT', protocolVersion: 4, reconnectPeriod: 1000, connectTimeout: 30 * 1000, username: "MyCam", password: "MySecretPassword", clean: true, resubscribe: true } ... ———————————————————— Username and password fields aren‘t there in original. Hope that helps you otherwise feel free to contact me.

conradhagemans commented 4 years ago

@ScharV thank you for the quick response. I will try it out and post an update later tonight.

conradhagemans commented 4 years ago

Yes!! It works. Bridge added to my HomeKit app and camera added. Now error with FFMpeg. I think I have to recompile it on my raspberry. @ScharV once more thank you.