alex20465 / deskbluez Goto Github PK
View Code? Open in Web Editor NEWConnects to a low energy actuator system via bluetooth and allows remote control via command line or internal managed interface.
License: MIT License
Connects to a low energy actuator system via bluetooth and allows remote control via command line or internal managed interface.
License: MIT License
Hello,
Thank you for the awesome project, saved me a lot of hours :)
I have a small request, is it possible to send a message to a mqtt topic when the desk gets disconnected or it can't reconnect automatically?
Thanks!
The version I will describe is the one from your repository. I run the applications in MQTT mode on Raspberry Pi Zero W. I’m only subscribing topic with the change of position. After connection, the DPG1C controller works smoothly until there is a 2-3 hour break between sending the last position change. After this time, the controller stops responding to commands. And a connection error pops up.
Notes to the screen:Which helps:
Connecting to a desk with another application, e.g. dedicated to MacOS - “Desk Remote Control”. The control of the desk is still blocked unless you click “save favorite position”. Saving the position removes the desk control lock, and I can re-pair and control my desk again using deskbluez.
General comments:
Hello 👋
Just in case it can be of any use for someone, as the title says I wanted to create a docker version of this library, wrap it into some kind of MQTT endpoint and use it in Home Assistant to automate some tasks with my desk.
I have failed to do this with this library but I have still managed to come up with something. In case it's of any use to someone, here's the repo where everything is explained: https://github.com/maxime1992/linak-2-mqtt
Howdy, thanks for making this port.
I recommend that you add brew install pkg-config dbus glib
to your readme installation instructions, as these appear to be dependencies required for the dbus npm package
So I moved past that issue, and onto another!
dbus[1846]: Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
Not enough memory
I don't know how to build this project locally (/bin/deskbluez
requires ../dist/*
??) but installing it as a dependency (of itself 😆 ) allows me to get a stack trace:
yarn run v1.22.11
$ ~/projects/idasen/deskbluez/node_modules/.bin/deskbluez
dbus[1646]: Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
~/projects/idasen/deskbluez/node_modules/dbus/lib/bus.js:20
self.connection = _dbus.getBus(0);
^
Error: Not enough memory
at new module.exports (~/projects/idasen/deskbluez/node_modules/dbus/lib/bus.js:20:27)
at Function.DBus.getBus (~/projects/idasen/deskbluez/node_modules/dbus/lib/dbus.js:39:9)
at Function.DBus.registerService (~/projects/idasen/deskbluez/node_modules/dbus/lib/dbus.js:78:17)
at Bluez.getUserService (~/projects/idasen/deskbluez/node_modules/bluez/lib/Bluez.js:247:37)
at new Bluez (~/projects/idasen/deskbluez/node_modules/bluez/lib/Bluez.js:22:45)
at new Bluetooth (~/projects/idasen/deskbluez/node_modules/deskbluez/dist/lib/bluetooth.js:19:23)
at new CommandLine (~/projects/idasen/deskbluez/node_modules/deskbluez/dist/lib/cli.js:203:26)
at Object.<anonymous> (~/projects/idasen/deskbluez/node_modules/deskbluez/bin/deskbluez:5:13)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
Is the org.freedesktop.dbus-session.plist
thing a problem? This plist doesn't exist on my machine (it's supposed live at /Library/LaunchAgents/org.freedesktop.dbus-session.plist
from what I can tell).
If not, any idea why I might get Not enough memory
? 😞
I performed a new install on a Raspberry Pi 4. Everything installed successfully. However, when I run a scan, I get this response:
pi@raspberrypi:~ $ deskbluez --debug connect [DEBUG] CONFIG: load { configPath: '/home/pi/.config/deskbluez-default', profile: 'default' }
[DEBUG] BLUETOOTH: init (node:5057) UnhandledPromiseRejectionWarning: Error: No introspectable at /usr/local/lib/node_modules/deskbluez/node_modules/dbus/lib/bus.js:131:15 (node:5057) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:5057) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I tried a couple of things here to determine if it was an issue with bluetooth. Through bluetoothctl, I was able to turn off and the controller on:
[bluetooth]# power off Changing power off succeeded [CHG] Controller B8:27:EB:17:DA:01 Powered: no [CHG] Controller B8:27:EB:17:DA:01 Discovering: no
[bluetooth]# power on Changing power on succeeded [CHG] Controller B8:27:EB:17:DA:01 Powered: yes
Any ideas?
Hi,
is this software compatible with DPG1M?
I've managed to connect to desk
➜ ~ sudo /usr/bin/deskbluez connect
✔ Choose device › DESK 9908 [F2:CA:1A:D3:4D:C4]
and launch
deskbluez serve mqtt://ip:1883 positionUpdate control
Connected to the MQTT Broker
but after sending req to mqtt
mosquitto_pub -h "ip" -p 1883 -t 'control' -m "to:1751" -d
I get the error
(node:11091) UnhandledPromiseRejectionWarning: Error: In Progress
at new DBusError (/usr/lib/node_modules/deskbluez/node_modules/dbus/lib/error.js:9:9)
at createError (/usr/lib/node_modules/deskbluez/node_modules/dbus/lib/bus.js:243:9)
(node:11091) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
From this point I even can't move the desk manually until I disconnect Bluetooth.
Do you have any ideas what can be the issue?
Managed to get the software working in Ubuntu 20.4 to the point I can run the Position command to successfully retrieve the desk position.
However, when I attempt a move-to command, the command hangs in the terminal and desk does nothing. I've observed that when manually trying to lower the desk after this, there's an E16 error displayed on the desk controller LCD.
Linak specifies this error in their troubleshooting guide as:
Key Error » Illegal keys pressed (handled internally in DP1C).
Possible Cause » Hitting multiple buttons simultaneously
Solution » Check desk panel
If I ctrl-c to terminate the process in the terminal, the error dissapears.
Any ideas?
Thanks
Connecting with the desk seems to work fine, I get Device connected successfully
.
However, when trying to run any command, I keep getting the following:
{ Error: Not paired
at new DBusError (/home/steven/test/deskbluez/node_modules/dbus/lib/error.js:9:9)
at createError (/home/steven/test/deskbluez/node_modules/dbus/lib/bus.js:243:9)
message: 'Not paired',
dbusName: 'org.bluez.Error.NotPermitted' }
Any ideas? I guess I have to pair somehow, but not really sure how to get that going.
Fedora Linux 37 (Workstation Edition)
Linux 6.1.14-200.fc37.x86_64
Just wait until the bluetooth adapter isn't used and run a single UP command deskbluez up
, the error response is:
Service notification [99fa0020-338a-1024-8a49-009c0215f78a] not available.
once the command is repeated it will be executed as expected, the issue is the first run.
my theory is that the bluetooth adapter or service has somekind of idle or power-save state which requires some check before continue to the service discovery of the paired device.
Hey,
Connecting with the desk seems to work fine, I get "Device connected successfully".
When I try running any command I get:
DBusError: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. at new DBusError (/usr/lib/node_modules/deskbluez/node_modules/dbus/lib/error.js:9:9) at createError (/usr/lib/node_modules/deskbluez/node_modules/dbus/lib/bus.js:243:9) { dbusName: 'org.freedesktop.DBus.Error.NoReply' }
Any Idea?
Edit: Running on a Raspberry Pi 4
I'm having an issue with getting deskbluez to pair to my desk. What happens is that it sees the desk, but then sees the authentication fails. However, the desk does say "paired" on the desk and it's also reflected in bluetoothctl. I can confirm nothing else is pairing during this process. What I done is that when the desk is in pair mode, I waited 30 seconds to pair just to make sure there is nothing conflicting. And I removed the device out of bluetoothctl and even confirmed that nothing was pairing when running the command. Also, I can pair with no problems through my IOS app and the Win10 app.
[bluetooth]# paired-devices
[bluetooth]# exit
pi@raspberrypi:~ $ sudo deskbluez --debug connect
[DEBUG] CONFIG: load { configPath: '/root/.config/deskbluez-default', profile: 'default' }
[DEBUG] BLUETOOTH: init
[DEBUG] BLUETOOTH: use adapter hci0
[DEBUG] BLUETOOTH: adapter loaded { Address: 'B8:27:EB:17:DA:01',
AddressType: 'public',
Name: 'raspberrypi',
Alias: 'raspberrypi',
Class: 0,
Powered: true,
Discoverable: false,
DiscoverableTimeout: 180,
Pairable: true,
PairableTimeout: 0,
Discovering: false,
UUIDs:
[ '00001801-0000-1000-8000-00805f9b34fb',
'0000110e-0000-1000-8000-00805f9b34fb',
'00001200-0000-1000-8000-00805f9b34fb',
'0000110c-0000-1000-8000-00805f9b34fb',
'00001800-0000-1000-8000-00805f9b34fb' ],
Modalias: 'usb:v1D6Bp0246d0532' }
✔ make sure the desk device isn't paired OR connected … yes
✔ choose device model: › linak
✔ enable the pairing mode (usually hold bluetooth button for 2-3 seconds) … yes
[DEBUG] BLUETOOTH: start discovery
[DEBUG] BLUETOOTH: device discovered CA:45:74:C1:A7:7E { Address: 'CA:45:74:C1:A7:7E',
AddressType: 'random',
Name: 'DESK 2878',
Alias: 'DESK 2878',
Paired: false,
Trusted: false,
Blocked: false,
LegacyPairing: false,
RSSI: -51,
Connected: false,
UUIDs: [ '99fa0001-338a-1024-8a49-009c0215f78a' ],
Adapter: '/org/bluez/hci0',
TxPower: 4,
ServicesResolved: false }
[DEBUG] BLUETOOTH: stop discovery
✔ choose desk device › DESK 2878 [CA:45:74:C1:A7:7E]
[DEBUG] BLUETOOTH: connect to CA:45:74:C1:A7:7E
[WARN] { Error: Authentication Failed
at new DBusError (/usr/local/lib/node_modules/deskbluez/node_modules/dbus/lib/error.js:9:9)
at createError (/usr/local/lib/node_modules/deskbluez/node_modules/dbus/lib/bus.js:243:9)
message: 'Authentication Failed',
dbusName: 'org.bluez.Error.AuthenticationFailed' }
Authentication Failed
Please can you help me resolve this after installation (Mac OS 10.14.6)
~ % deskbluez connect
dbus[21476]: Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
Error: Not enough memory
at new module.exports (/usr/local/lib/node_modules/deskbluez/node_modules/dbus/lib/bus.js:20:27)
at Function.DBus.getBus (/usr/local/lib/node_modules/deskbluez/node_modules/dbus/lib/dbus.js:39:9)
at Function.DBus.registerService (/usr/local/lib/node_modules/deskbluez/node_modules/dbus/lib/dbus.js:78:17)
at Bluez.getUserService (/usr/local/lib/node_modules/deskbluez/node_modules/bluez/lib/Bluez.js:247:37)
at new Bluez (/usr/local/lib/node_modules/deskbluez/node_modules/bluez/lib/Bluez.js:22:45)
at new Bluetooth (/usr/local/lib/node_modules/deskbluez/lib/bluetooth.js:6:23)
at connect (/usr/local/lib/node_modules/deskbluez/bin/deskbluez:20:23)
at Command.<anonymous> (/usr/local/lib/node_modules/deskbluez/bin/deskbluez:180:16)
at Command.listener [as _actionHandler] (/usr/local/lib/node_modules/deskbluez/node_modules/commander/index.js:413:31)
at Command._parseCommand (/usr/local/lib/node_modules/deskbluez/node_modules/commander/index.js:914:14)
Thanks!
Hello
This is exactly what I was looking for.
Is it possible to run deskbluez inside a docker container?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.