Configure Wifi through Bluetooth on Nuc? Ubuntu

I have been working with Raspberry Pi’s on Raspbian for a while now and have successfully used this method by installing Berrylan https://berrylan.org/
however, im not finding the same options for doing this with Ubuntu but was hoping one of you have done so. This is how i did it successfully on Raspbian:
https://www.raspberrypi.org/forums/v…75208#p1672249

Essentially i need to connect to the Intel Nuc over bluetooth with a mobile device, the app on the mobile device will instruct the Nuc to scan for available SSIDs, I can then select the SSID and enter the password which will configure the wifi connection on the Nuc. I already have a mobile app to do this but was using the Berrylan infrastructure.

Any help would be greatly appreciated!

Hi @bknapton,

This should work exactly the same as on the RPi. Add the nymea repository to your Ubuntu as per install guide on nymea.io. then apt-get install nymea-networkmanager.

Check out /etc/nymea/nymea-networkmanager.conf for the settings.

When i go to start the service after following the instructions i get this error over and over:

I | Application: Bluetooth server stopped
I | Application: Start the bluetooth service because of “offline” mode.
W | qt.bluetooth: Using BlueZ kernel ATT interface
I | Application: Bluetooth server started
W | qt.bluetooth.bluez: received advertising error
W | NetworkManagerBluetoothServer: Bluetooth error occured: QLowEnergyController::AdvertisingError “Error occurred trying to start advertising”
I | Application: Bluetooth server stopped
I | Application: Start the bluetooth service because of “offline” mode.
W | qt.bluetooth: Using BlueZ kernel ATT interface
I | Application: Bluetooth server started
W | qt.bluetooth.bluez: received advertising error
W | NetworkManagerBluetoothServer: Bluetooth error occured: QLowEnergyController::AdvertisingError “Error occurred trying to start advertising”
I | Application: Bluetooth server stopped
I | Application: Start the bluetooth service because of “offline” mode.
W | qt.bluetooth: Using BlueZ kernel ATT interface
I | Application: Bluetooth server started
W | qt.bluetooth.bluez: received advertising error
W | NetworkManagerBluetoothServer: Bluetooth error occured: QLowEnergyController::AdvertisingError “Error occurred trying to start advertising”
I | Application: Bluetooth server stopped
I | Application: Start the bluetooth service because of “offline” mode.
W | qt.bluetooth: Using BlueZ kernel ATT interface

any ideas on how to fix this one?

This seems like an issue in the Bluetooth setup. Does Bluetooth work at all on this NUC?

I had this issue when I had insufficient permissions on the bluez dbus. Is the daemon running as root and which bluez / ubuntu version are you using? Is bluez maybe installed as snap?

Bluetooth does and i can connect to it from my phone

i installed it via apt-get install and am trying to run it as root

sorry i missed the other part of your question. bluetoothctl is 5.53 and Ubuntu 20.04.1 LTS

I’ve googled a bit for this error message and I’ve seen that people get this error message when applications don’t have the right permissions. How did you start nymea-networkmanager?

as the default user i ran: sudo nymea-networkmanager
and as root: i ran it without sudo. both gave the same error. not sure what to try next.

Right… So that would be ok from a user/permission point of view… However, note, that installing nymea-networkmanager will autostart the service. If you start it manually, make sure you don’t have 2 instances running.

You can check sudo systemctl status nymea-networkmanager if it’s already running and use sudo journalctl -u nymea-networkmanager to see its logs.

after i fresh reboot i checked the status and got this:

● nymea-networkmanager.service - Daemon for nymea to configure wifi network using a Bluetooth LE connection
Loaded: loaded (/lib/systemd/system/nymea-networkmanager.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-12-08 09:27:24 MST; 28s ago
Docs: https://github.com/nymea/nymea-networkmanager
Main PID: 1468 (nymea-networkma)
Tasks: 2 (limit: 18805)
Memory: 93.0M
CGroup: /system.slice/nymea-networkmanager.service
└─1468 /usr/bin/nymea-networkmanager -d

Dec 08 09:27:29 lookapp nymea-networkmanager[1468]: W | qt.bluetooth.bluez: received advertising error
Dec 08 09:27:29 lookapp nymea-networkmanager[1468]: W | NetworkManagerBluetoothServer: Bluetooth error occured: QLowEnergyController::AdvertisingError "Error occurred trying to sta>
Dec 08 09:27:29 lookapp nymea-networkmanager[1468]: I | NetworkManagerBluetoothServer: Controller state disonnected.
Dec 08 09:27:29 lookapp nymea-networkmanager[1468]: I | NetworkManagerBluetoothServer: Set running false
Dec 08 09:27:29 lookapp nymea-networkmanager[1468]: W | qt.bluetooth.bluez: socket creation failed: “Too many open files”
Dec 08 09:27:29 lookapp nymea-networkmanager[1468]: W | NetworkManagerBluetoothServer: Bluetooth error occured: QLowEnergyController::AdvertisingError "Error occurred trying to sta>
Dec 08 09:27:29 lookapp nymea-networkmanager[1468]: I | Application: Bluetooth server started
Dec 08 09:27:29 lookapp nymea-networkmanager[1468]: I | Application: Bluetooth server stopped
Dec 08 09:27:29 lookapp nymea-networkmanager[1468]: W | NymeaService: Could not enable/disable bluetooth hardware resource. D-Bus interface not available.
Dec 08 09:27:29 lookapp nymea-networkmanager[1468]: I | Application: Start the bluetooth service because of “offline” mode.

This now looks like the bluetooth stuff didn’t initialize in time… try to manually restart it sudo systemctl restart nymea-networkmanager.

We’re aware of this issue that it’s a bit picky when it comes to the startup sequence and it’s on the todo to improve that.

after restarting, im still getting the same error. have you seen this work on an Intel Nuc before?

yes, works fine on my NUC here… but I have a rather old model… Also I’m still running Ubuntu 18.04 on it… Not sure right now what your problem might be…

im running on the latest version of ubuntu. on the Nuc model NUC10FNK

Perhaps your Ubuntu is running a Desktop environment with some Bluetooth manager that interferes with it?

Or what Simon said, perhaps your BlueZ is installed as a snap package which might mess up stuff…

Googling for this error “qt.bluetooth.bluez: received advertising error” from your logs does hint to a permission problem… Although that shouldn’t be the case if you run nymea-networkmanager with sudo or a system service…

I’m really just guessing right now…

I just tried again on my NUC (NUC6SYK) and it works just fine…
Also I just tested again on my laptop (MBP with Ubuntu 20.04) and it works fine there too…
Running out of ideas what might be wrong with your setup without being able to reproduce.

im going to try ubuntu server instead of desktop

The fact that it works for me on the laptop with gnome running speakes against it tho…

Did you check if you have bluez installed as a snap?

snap info bluez
and
sudo apt-cache policy bluez