Closed vino-dk closed 2 years ago
Looks like the daemon started, are there more logs?
The NymeaService
warnings are not a problem, that's an optional feature if running along nymead
.
Is your bluetooth setup ok?
hciconfig -a
Hi, coworker here, working on the same problem. Good to know that the warnings are not the problem.
Output from hciconfig -a
:
hci0: Type: Primary Bus: UART
BD Address: B8:27:EB:ED:E7:C0 ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING
RX bytes:1611 acl:0 sco:0 events:103 errors:0
TX bytes:1961 acl:0 sco:0 commands:103 errors:0
Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH SNIFF
Link mode: PERIPHERAL ACCEPT
Name: '***'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Version: 5.0 (0x9) Revision: 0x156
LMP Version: 5.0 (0x9) Subversion: 0x6119
Manufacturer: Cypress Semiconductor (305)
Turns out that running service nymea-networkmanager restart
after booting works perfectly, so it seems that the service starts up before bluetooth is ready to use somehow.
Sounds like a race condition or something changed in Jammy we are not aware of yet.
Need to check what changed since there are other issues which might be 22.04
related.
I agree that it could have something to do with a race condition during boot-up. To mitigate this I added multi-user.target
to the requires
field in the nymea-networkmanager.service
file. It seems that once the system has started the service files for this requirement, the advertisement starts and shows up in the berrylan app.
However this takes a while (~3 min), so I'll try to see if I can apply a different target or just disable some services that we won't use required by multi-user.target
.
https://github.com/nymea/nymea-networkmanager/blob/master/debian/nymea-networkmanager.service
Actually, the service is wanted by the graphical.target
, and is configured to be started After
the multi-user.target
, since we already had once such a situation, reaching the graphical.target
all required services are up and running (network-manager and bluez).
Are there more logs if you do a clean boot? Like warnings or something?
On a clean image of ubuntu server 22.04, we did the following steps to make it work. We added nymea to apt sources and fetched the key, then:
sudo apt update
sudo apt install nymea-networkmanager dirmngr
sudo apt install bluetooth pi-bluetooth bluez
Add "btusb" to /etc/modules-load.d/modules.conf
Following this, we edited the nymea-networkmanager.service
file so it was wanted by multi-user.target
. It reduced the time of device advertisement by 2 min. bringing it down to ~50s from booting up. It works fine but I will get back if we encounter any issues in this regard.
I've followed the instructions on a clean image of ubuntu server 22.04 for Raspberry Pi 3B and I've narrowed down the problem to nymea-networkmanager failing to start: