Giter VIP home page Giter VIP logo

Comments (4)

sedony23 avatar sedony23 commented on May 19, 2024

So you have to edit the client.js file (for me it is here: /usr/local/lib/node_modules/homebridge-dafang/node_modules/mqtt/lib/client.js). Find the Section:

var defaultConnectOptions = {
keepalive: 60,
reschedulePings: true,
protocolId: 'MQTT',
protocolVersion: 4,
reconnectPeriod: 1000,
connectTimeout: 30 * 1000,
clean: true,
resubscribe: true
}

And add the authentication stuff like this:
var defaultConnectOptions = {
host: 'ip.to.your.mqtt.server',
port: 1883,
username: 'XXX',
password: 'XXX',
keepalive: 60,
reschedulePings: true,
protocolId: 'MQTT',
protocolVersion: 4,
reconnectPeriod: 1000,
connectTimeout: 30 * 1000,
clean: true,
resubscribe: true
}

Hope this helps!

Best

se_dony

from homebridge-dafang.

klzny avatar klzny commented on May 19, 2024

Hi thanks for your help.

Meanwhile I have sorted it in kind of different way.
It seems the bistro I was using was at fault as. After doing clean install of raspian/homebridge everything works ok.

Well, kind of.
I came across another issue. When I was testing the setup everything was working OK, however after moving it to 'main' homebridge - I am not longer able to add camera. Homebridge does not see it no matter what I try.
Dafang plugin works good. I can control the camera (turn night vision on/off, take picture record video - motion sensor works too), there is just no way to add camera.
It does not work via homebridge-camera-ffmpeg either.

from homebridge-dafang.

jlg89 avatar jlg89 commented on May 19, 2024

Same issue here. There's nowhere in the homebridge-dafang configuration for adding the username/password for the mosquitto server. This should presumably be in the "mqtt:" section of the plugin configuration. I tried adding it to client.js as sedony23 suggested, but that didn't work. I switched to homebridge-dafang-mqtt-republish in conjunction with homebridge-camera-ffmpeg, and that is working perfectly. So it's not a problem with my MQTT server.

from homebridge-dafang.

jlg89 avatar jlg89 commented on May 19, 2024

The easiest solution is to leave "allow_anonymous true" in the mosquitto config, and also create a password file, so that both authenticated and anonymous connections are handled.

from homebridge-dafang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.