Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[error] BlueZ Permission Error #42

Open
Fungusware opened this issue Nov 17, 2020 · 13 comments
Open

[error] BlueZ Permission Error #42

Fungusware opened this issue Nov 17, 2020 · 13 comments

Comments

@Fungusware
Copy link

Hi, hope you can help.

I have followed the details in the https://flows.nodered.org/node/node-red-contrib-generic-ble installaton notes but I just cannot seem to get this working.

Scanning immediately gives me the Error.

cat /etc/group | grep bluetooth

returns

bluetooth:x:112:pi

NODE-Red is started with

node-red-start

@dbaba
Copy link
Collaborator

dbaba commented Nov 17, 2020

Did you run sudo reboot after usermod? Reboot is required after changing the group.
If yes, check if your board has BLE. Only RPi3A+, RPi3B+ and RPi4 have BLE. See the raspberrypi.org products list for detail.

@Fungusware
Copy link
Author

Fungusware commented Nov 17, 2020 via email

@dbaba
Copy link
Collaborator

dbaba commented Nov 18, 2020

mmm...
Can you please post the actual error message? And /var/log/syslog as well, which probably contains the more precise error message.
The permission error is caused by wrong bluetoothd configuration. I'd say you're running NR by other user than pi but I'm not sure if it is. In order to identify the error cause, give me the above info.

@Fungusware
Copy link
Author

Fungusware commented Nov 18, 2020 via email

@dbaba
Copy link
Collaborator

dbaba commented Nov 18, 2020

Thanks. Need more precise info.

Can you please change the log settings as shown below?
The following setting outputs only this node logs. NR logs are disabled.

$ sudo nano /lib/systemd/system/nodered.service
# Insert the following line under `Nice=5` then save the file and exit
Environment="DEBUG=node-red-contrib-generic-ble:*"

$ sudo systemctl daemon-reload
$ node-red-start
# This will not output anything but NR will be running normally

Then try to cause the above error. The console shows precise log info, so you can post it in this thread.

In order to revert the change, just remove the appended line from /lib/systemd/system/nodered.service file.

@Fungusware
Copy link
Author

Fungusware commented Nov 18, 2020 via email

@dbaba
Copy link
Collaborator

dbaba commented Nov 18, 2020

Unfortunately, no image is available. Can you upload the image files from the github site with the browser?

@Fungusware
Copy link
Author

unnamed
image

@dbaba
Copy link
Collaborator

dbaba commented Nov 18, 2020

Thanks. I've published the revised version of this node in order to provide more error info on the console.
Could you please upgrade the node to v4.0.3 and post the error info here?

@Fungusware
Copy link
Author

Yes, much more information now. See attached.
2020-11-18_13-21-18

@dbaba
Copy link
Collaborator

dbaba commented Nov 18, 2020

Well, the error is just a permission error...
It should be resolved by adding pi user group to bluetooth group.

Again, let me check your environment. Can you please provide the following command results?

$ group pi
# will show the pi user's group
$ uname -a
# will show the linux OS info
$ dpkg -l | grep dbus
# will list dbus related package info

Mine is as follows.

$ groups pi
pi : pi adm dialout cdrom sudo audio video plugdev games users input netdev bluetooth spi i2c gpio

$ uname -a
Linux raspberrypi 5.4.51-v7+ #1333 SMP Mon Aug 10 16:45:19 BST 2020 armv7l GNU/Linux

$ dpkg -l | grep dbus
ii  dbus                           1.12.20-0+deb10u1                   armhf        simple interprocess messaging system (daemon and utilities)
ii  libdbus-1-3:armhf              1.12.20-0+deb10u1                   armhf        simple interprocess messaging system (library)
ii  python3-dbus

So far, I cannot reproduce the error with the latest OS image (Raspberry Pi OS Lite, Release date: August 20th 2020).
So using the latest lite image may resolve the issue.

@Fungusware
Copy link
Author

Fungusware commented Nov 18, 2020 via email

@dbaba
Copy link
Collaborator

dbaba commented Nov 18, 2020

  • pi user is belonging to bluetooth group
  • OS seems to be identical to mine
  • dbus version is same

Unfortunately, I have no idea to resolve the issue.
Can you please use the fresh OS image without adding ANY packages/programs except Node-RED and this node?
I tried the fresh OS image(Raspberry Pi OS Lite) and I confirmed it worked without any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants