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

BLE "Terminating because EAFNOSUPPORT, Address family not supported by protocol" #422

Closed
C4mp3r-Grey opened this issue Aug 12, 2020 · 6 comments
Assignees

Comments

@C4mp3r-Grey
Copy link

BLE does not start as expected, but the ioBroker log reports:

instance system.adapter.ble.0 terminated by request of the instance itself and will not be restarted, before user restarts it.
after a log error
Terminating because EAFNOSUPPORT, Address family not supported by protocol

I have checked info.driverState, which is "poweredOff"
so I believe it is not a permission problem, but somethin else.

Bluetooth LE is working as expected on the host. A device search via hcitool lescan provides masses of devices instantly on the host lists numerous ble devices (including the expected flowercare ble sensor).

To Reproduce

  • iobroker runs in docker on raspbian on a Raspi4 4GB (buanet/iobroker:v5.0.0). Other containers are portainer/portainer:arm and marthoc/deconz, none of them using bluetooth
  • i have installed bluetooth bluez libbluetooth-dev libudev-dev libcap2-bin on the host and in the container (does that make sense at all?)

Expected behavior
ble adapter becomes green instead of being terminated ;-)

Versions:

  • Adapter version: latest (v0.11.6)
  • JS-Controller version: 3.1.6
  • Node version: 12.18.3 (in the docker container)
  • Operating system: Raspbian Buster 10 - kernel 5.4.51-v7l+ armv71
  • Docker:
Client: Docker Engine - Community
 Version:           19.03.12
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        48a6621
 Built:             Mon Jun 22 15:53:41 2020
 OS/Arch:           linux/arm
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.12
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10
  Git commit:       48a6621
  Built:            Mon Jun 22 15:47:34 2020
  OS/Arch:          linux/arm
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
@C4mp3r-Grey
Copy link
Author

container is started with
docker run -it -p 8081:8081 -p 8082:8082 --name myIObroker --restart always -v iobrokerdata:/opt/iobroker buanet/iobroker:v5.0.0

if that is relevant?

@AlCalzone
Copy link
Owner

My guess is that you're running into this issue
abandonware/noble#43
I don't think I can do anything about that until there is a fix available.

@C4mp3r-Grey
Copy link
Author

Indeed, that sounds very similiar. Thanks for the hint, I will have a look on that!

@C4mp3r-Grey
Copy link
Author

UPDATE: It was much simpler and not a bug:

Running the iobroker container in net host mode solves the issue. The exceptions thrown lead in the wrong direction.

May I suggest to add a hint in the readme:

Having ioBroker running in a docker container, which is not in _net host_ mode, will make the BLE adapter stop with "Terminating because EAFNOSUPPORT". Ensure that your container runs in host mode in order to have access to the BLE networking device
buanet/ioBroker.docker#134 (comment)

@AlCalzone
Copy link
Owner

The next version will output a more helpful error message in this case. Thanks for your help!

@C4mp3r-Grey
Copy link
Author

Thanks for your efforts! Very useful adapter for my FlowerCare BT sensors ;-)

Cheers!

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