Closed gits00 closed 4 years ago
Have not tried Bluetooth. And I do not know whether or not that wouldn't like to write information like pairing data to locations that are read-only on a default piserver installation.
But generally speaking:
@maxnet, Thanks.
I tried running "bluetoothctl" as the user. It gets hung.
If "sudo bluetoothctl" is run, I get error the user not in the sudoers file.
On trying to add the user in bluetooth group in chroot shell of piserver (usermod -a -G
Is there anything I am missing here? Thank you.
If you want to add network users (created in Piserver) to a group, easiest is to do so by executing "leafpad /etc/security/group.conf" in chroot and adding a line among the lines of:
# Extra groups for all users logged in to local console
login;tty*;*;Al0000-2400;bluetooth, sudo
Might need to use something different than "login" and "tty*" if connecting through ssh or other means. Or specify individual users instead:
# Give myuser extra groups regardless how he logged in, at all times of the day
*;*;myuser;Al0000-2400;bluetooth, sudo
Be aware that this is just for interactive login sessions. Good for playing around and testing purposes. In the end you probably want to create a systemd service instead. If you do not want to have that running as root, it may be better to create a local user instead of a network user.
Thanks @maxnet. I was able to get bluetooth working in interactive session though a couple of times I see UART initialization timed out in "/var/log/syslog" . In such cases "bluetoothctl" got hung. At other times bluetooth worked. The changes needed were -
(Probably because WiFi and Bluetooth radios are the same)
Do I need to create a systemd service here? I see bluetooth service getting started at boot time. Looking around found that "BLUETOOTH_ENABLED=1" in "/etc/default/bluetooth". I am pretty new to using bluetooth and Raspberry Pi so not really sure.
Do I need to create a systemd service here? I see bluetooth service getting started at boot time.
Well, you mentioned wanting to use it as data collector. If by that you mean that multiple Pi collect data from bluetooth sensors, and phone it back home to some central server, then the daemon that does the data collection typically would run as a systemd service, yes. That's not Piserver specific though.
Oh ok, I got it now. Thanks @maxnet !
I wish to use a network booted RPi as a data collector from Bluetooth devices. I was able to boot a pi 3B+ with a minimal image of Rasbian buster lite. But I am unable to get the Bluetooth working probably because of the security risk which prevents Bluetooth to not work unless started using "sudo bluetoothctl" (Tried the steps at https://github.com/DrRowland/RPi-Bluetooth-Console/blob/master/setup.sh). But I feel there would be some workaround to get this because a networked sensor array is one of the main use cases of piserver.