Shouqun / node-dbus

dbus module for node
MIT License
150 stars 70 forks source link

Dbus Connection Refused #227

Open Vishal8523 opened 3 years ago

Vishal8523 commented 3 years ago

After setting the environment variables, bluez is not getting the access to Dbus.

export DISPLAY=':0'
export DBUS_SESSION_BUS_ADDRESS='unix:path=/usr/var/run/dbus/system_bus_socket'
/home/root/node_modules/dbus/lib/bus.js:20
                self.connection = _dbus.getBus(0);
                                        ^

Error: Failed to connect to socket /usr/var/run/dbus/system_bus_socket: Connection refused
    at new module.exports (/home/root/node_modules/dbus/lib/bus.js:20:27)
    at Function.DBus.getBus (/home/root/node_modules/dbus/lib/dbus.js:39:9)
    at Function.DBus.registerService (/home/root/node_modules/dbus/lib/dbus.js:78:17)
    at Bluez.getUserService (/home/root/node-bluez/lib/Bluez.js:284:37)
    at new Bluez (/home/root/node-bluez/lib/Bluez.js:20:45)
    at Object.<anonymous> (/home/root/bluetooth/bluezAPI.js:2:17)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)

Appreciate the help

richguernsey commented 3 years ago

Are you connecting directly from the host OS or are you using a docker container? The path may change depending on what tech your using