Comments (13)
I am trying to make it run on RPi4, but unsuccessfully so far... I guess I just do not understand everything as well.
My ASUS bluetooth USB dongle is connecting to other LE devices, but I cannot figure out how to make it work with this. I have tried connecting the dongle to RPi4 directly as well as to a USB hub (no difference in error messages below; works with other devices in both configurations).
While I try to run node app.js
I get the below error:
Connected to MQTT Broker
{ dongleConfig:
{ hciDevice: 'hci0',
mode: 'le',
services: [],
devices: [ [Object] ] },
error:
{ message: 'Failed to fetch adapter Interface for hci0',
error:
[ 'Rejected send message, 2 matched rules; type="method_call", sender=":1.21" (uid=1000 pid=1991 comm="node app.js ") interface="org.freedesktop.DBus.Introspectable" member="Introspect" error name="(unset)" requested_reply="0" destination="org.bluez" (uid=0 pid=366 comm="/usr/lib/bluetooth/bluetoothd ")' ] } }
Also, not sure that I edited the config the right way:
{
"mqtt": {
"url": "mqtt://broker.ip:1883"
},
"dongles": [
{
"hciDevice": "hci0",
"mode": "le",
"services": [],
"devices": [
{
"type": "MiKettleDevice",
"friendlyName": "Mi Kettle",
"mac": "my:ma:ca:dd:re:ss",
"productId": 275
}
]
}
]
}
from cybele.
Are you sure that hci0 is your Bluetooth device?
from cybele.
I believe so... It is even a Broadcom chip. Unless I am mistaken?
hciconfig
hci0: Type: Primary Bus: USB
BD Address: 5C:F3:70:xy:zx:yz ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING
RX bytes:13891 acl:189 sco:0 events:685 errors:0
TX bytes:7648 acl:75 sco:0 commands:404 errors:0
hcitool dev
Devices:
hci0 5C:F3:70:xy:zx:yz
lsusb
Bus 001 Device 004: ID 0b05:17cb ASUSTek Computer, Inc. Broadcom BCM20702A0 Bluetooth
from cybele.
Your user is most likly not in the bluetooth
group.
I should probably add that to the documentation
from cybele.
Does this will work even if I use an external hub supported by uhubctl? No modification is needed in the code? How it will know where it is plugged in and which port should be powered down?
It doesn't. You need to specify the correct command manually
https://github.com/Hypfer/Cybele/blob/master/docs/index.md#troubleshooting
from cybele.
Ahh that makes sense! Sorry for not reading it through carefully...
from cybele.
Ok, just for testing, I got it running with a RPi 3B with the internal bluetooth.
The range is not so good and I don't know how about you, but I don't have an RPi in the Kitchen yet :)
Yes the Bluetooth will stuck after a few hours, but it seems that it can be restarted by uhubctl (and I couldn't even notice it in terms of Ethernet connectivity that the internet is lost - as it should be because that port will power-cycle Ethernet and Wi-Fi theoretically).
However it seems that after the power cycle is not enough, I also needed to do a sudo hciconfig hci0 up
for the Bluetooth to work again. Can I concatanate these two commands with &&
in the recoveryCommand
option @Hypfer ?
Looking at the child_process documentation, this might not work out-of-the-box as it is right now...
Could this be added to the code? It is also great if you want to call any other script, etc... when this happens.
from cybele.
Hm. Apparently AutoEnable=true
is not set in your /etc/bluetooth/main.conf
I think that it is default true on new installations. Still something to note somewhere in the documentation.
If you for some reason need to run more than one command, I'd suggest wrapping those in a script and using that as the recoveryCommand since child_process.exec
is not a shell.
from cybele.
Unfortunately AutoEnable
is set to true.
I also experienced that if I do an lescan I can see the device (and it has a pretty good signal), but Cybele will not connect to it.
No logs, only 'Startup complete' and I can't see it trying to connect to the device or any other output...
Ps.: It seems like that the hciconfig down & up are still needed even if lescan works...
from cybele.
I think the power cycling isn't fully working then. iirc that's also what I saw when trying the 3b.
USB Bluetooth seems to be the only viable option, sadly :(
from cybele.
@Hypfer Yes I know I just wanted to try out, and my USB Bluetooth haven't arrived yet.
Also I hope that the range will be a little bit better... I can't place the RPi closer to the Kettle.
One quick question: you can't disable the beeping sound when the handshake happens right?
It is really annoying, if I could disable it, then this performance would be enough for me... It only loses connection sometimes for a few secs, but then it beeps again...
from cybele.
Unless you find a way to flash a custom firmware to the kettle sadly no
from cybele.
I'm using it on RPi 4B with builtin adapter on Ubuntu Server without any issues so far (it's been working for ~5 hours without any issues).
It took some time to get built-in bluetooth adapter working (adding modules to be loaded on boot, adding hciuart, disabling console).
I've been running it in docker with docker-compose.
Sharing my setup here since it might help others.
Dockerfile:
FROM node:12-alpine
WORKDIR /app
ARG VERSION=master
RUN set -ex; \
apk add --no-cache --virtual .build-deps \
wget \
tar \
git \
python2 \
alpine-sdk \
; \
wget https://github.com/Hypfer/Cybele/archive/${VERSION}.tar.gz -O cybele.tar.gz; \
tar --strip-components=1 -xf cybele.tar.gz; \
rm cybele.tar.gz; \
npm install; \
apk del .build-deps; \
cp config.default.json config.json
ENTRYPOINT ["/usr/local/bin/node", "app.js"]
/var/run/dbus/system_bus_socket
should be mounted from host.
AppArmor can be configured with custom profile to allow DBus access to bluez only, I didn't think it was worth the time and effort and just have made Cybele container "privileged" (with security_opt: [apparmor=unconfined]
)
from cybele.
Related Issues (20)
- Make Service as HA Addon HOT 2
- Glance Clock HOT 4
- Mijia LYWSD03MMC publishes to wrong topic
- soocas.toothbrush.m1s HOT 1
- mqtt username, password and host HOT 1
- Not receiving any date via Cybele HOT 1
- Failed to connect to Mi Kettle - Software caused connection abort HOT 2
- Failed to connect to Mi Kettle-TypeError: Cannot read property 'StartNotify' of undefined HOT 6
- Add support for yunmi.kettle.v12 HOT 4
- Failed to fetch adapter Interface for hci0
- unable to produce working config
- Xiaomi / Viomi Mi Mija Smart Kettle v12 HOT 2
- SyntaxError: Unexpected token '.' if (msg?.path?.indexOf(this.pathRoot) === 0)
- conver to docker compose
- unable to connect MiKetv12
- Improve polling scheduling
- Properly parse DBUS Dictionaries
- Use Object.fromEntries to parse dbus msgs
- Add missing MiKettle Mode
- Support for Mi Xiaomi Mijia LYWSD03MMC Bluetooth 4.2 Temperature Humidity sensor ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cybele.