Start takes way too long (on a VM)


#1

I’m running nymead on a virtualBox VM using the command “sudo nymead -n -p”, but it takes a couple of minutes to start and that is going to freak me out.

Here are the last lines from the debug output until it stops:
I | Application: Creating Hardware Manager
I | Hardware: --> “PluginTimerManager” created successfully.
I | Hardware: --> “Radio 433 MHz” created successfully.
I | Hardware: --> “Network access manager” created successfully.
I | Hardware: --> “UPnP discovery” created successfully.
I | Avahi: --> “Avahi service browser” created successfully.
I | Hardware: Register timer 10

After a certain time nymead continuous with:
W | Bluetooth: No bluetooth adapter found. Resource not available.
I | Hardware: Hardware manager initialized successfully
I | Hardware: Radio433 Brennenstuhl gateway enabled
I | NetworkManager: Network Manager enabled
I | Hardware:
I | Avahi: Service browser client connected.
I | Avahi: Avahi Service Browser enabled
I | Application: Creating Device Manager


#2

My virtual machine has no access to any Bluetooth adapter.


#3

Hey Bernhard,

the problem with the VM comes from the missing bluetooth device. The bluetoothd daemon has the condition on the bluetooth device in /sys/class/bluetooth directory for starting up. If the bluetooth daemon does not run, the nymead waits there for the bluez daemon and this causes the delay.
Since the VM can not share, only give over the bluetooth device you can fix this issue in 2 ways:

  1. You hand over the bluetooth adapter to the virtual box. This has the disadvantage that your host system cannot use the bluetooth device any more, but you can use the bluetooth in your virtual box and therefore also with nymea.
  2. You can change the systemd service file of the bluetooth daemon and remove the condition. But keep in mind, this change will probably lost with an update of the bluez package.

Open the systemd service file of the bluetooth daemon:

sudo nano /lib/systemd/system/bluetooth.service

And uncomment the line ConditionPathIsDirectory=/sys/class/bluetooth (using #)

# ConditionPathIsDirectory=/sys/class/bluetooth

Restart the bluetooth daemon using:

sudo systemctl restart bluetooth

Hope this helps :slight_smile:

PS: This is probably a bug and could be prevented by checking this path in nymea too.