home-assistant / addons

:heavy_plus_sign: Docker add-ons for Home Assistant
https://home-assistant.io/hassio/
Apache License 2.0
1.51k stars 1.47k forks source link

Bluetooth BCM43xx fail #340

Closed ghost closed 6 years ago

ghost commented 6 years ago

@jasimancas commented on Jun 28, 2018, 3:34 PM UTC:

I have installed the addon Bluetooth BCM43xx, but the devices dont report.

Raspberry PI3B

The log of the add-on:

bcm43xx_init Flash firmware /lib/firmware/brcm/BCM43430A1.hcd Set BDADDR UART: b8:27:eb:60:46:d0 Set Controller UART speed to 921600 bit/s Device setup complete

I have https://www.home-assistant.io/components/sensor.mitemp_bt/ and https://www.home-assistant.io/components/sensor.miflora/

This issue was moved by pvizeli from home-assistant/hassos#52.

ghost commented 6 years ago

@tyborall commented on Jun 28, 2018, 5:57 PM UTC:

I think the Pi 3 B(+?) hast another BCM5xxx.

ghost commented 6 years ago

@jasimancas commented on Jun 28, 2018, 6:39 PM UTC:

Is the 3B, not +, in hassio with ResinOS (old version) work fine, but in hassos (new version) not. Same files in Config folder and same add-ons install.

ghost commented 6 years ago

@pvizeli commented on Jun 28, 2018, 6:54 PM UTC:

Do you use the same config.txt?

ghost commented 6 years ago

@jasimancas commented on Jun 28, 2018, 7:00 PM UTC:

The same config folder (home assistant).

ghost commented 6 years ago

@pvizeli commented on Jun 29, 2018, 5:29 AM UTC:

Can you look into config.txt on boot partition of hassos and resinos and look if you change there something?

If that the same, can you copy the start.elf, fixup.bin and bootcode.bin to hassos? Maybe the is a bug RPI firmware.

ghost commented 6 years ago

@jasimancas commented on Jun 29, 2018, 8:26 AM UTC:

In a few hours I'll do the necessary tests. I will install Hassio, restore the files of HomeAssistant and check the bluetooth, if it works correctly I do the same procedure with the image of Pi3 (64bits?) Of HassOS.

Once I have the results I put them here.

If you need any particular test, tell me.

ghost commented 6 years ago

@jasimancas commented on Jun 29, 2018, 4:08 PM UTC:

Ok, look this: Hassio (Work perfectly): hassio Hassos: hassos

If i copy start.elf, fixup.bin and bootcode.bin in Boot, same result:

bcm43xx_init Flash firmware /lib/firmware/brcm/BCM43430A1.hcd Set BDADDR UART: b8:27:eb:aa:aa:aa Set Controller UART speed to 921600 bit/s Device setup complete

ghost commented 6 years ago

@pvizeli commented on Jun 30, 2018, 7:28 AM UTC:

The mac address is strange

ghost commented 6 years ago

@jasimancas commented on Jun 30, 2018, 11:22 AM UTC:

Yes, maybe this is the problem.

ghost commented 6 years ago

@danielsjf commented on Jul 1, 2018, 9:48 PM UTC:

If it helps anything, I tried the same on my raspberry pi 3 model B+. The ip also ends in aa, but also the rest is exactly the same. B8:27:eb:aa:aa:aa

ghost commented 6 years ago

@pvizeli commented on Jul 2, 2018, 9:59 AM UTC:

I move that to add-on repository and try to fix the add-on

ghost commented 6 years ago

move[bot] commented on Jul 2, 2018, 9:59 AM UTC:

This issue was moved by pvizeli to home-assistant/hassio-addons#339.

ghost commented 6 years ago

@pvizeli commented on Jul 2, 2018, 10:15 AM UTC:

I'm wrong: https://www.raspberrypi.org/forums/viewtopic.php?t=183474

Is that only with 64bit or also with 32bit a problem? (paskyecijano )

ghost commented 6 years ago

@jasimancas commented on Jul 2, 2018, 10:16 AM UTC:

Both, 32 and 64

ghost commented 6 years ago

@pvizeli commented on Jul 2, 2018, 10:20 AM UTC:

I try to extract the correct serial number from device tree

ghost commented 6 years ago

@pvizeli commented on Jul 2, 2018, 10:29 AM UTC:

Okay, I provide the bugfix they was describe there in HassOS 1.2

ghost commented 6 years ago

@pvizeli commented on Jul 2, 2018, 10:30 AM UTC:

#62

Will be release today

ghost commented 6 years ago

@pvizeli commented on Jul 2, 2018, 6:16 PM UTC:

I was right, the problem is on add-on. On new linux version they need read the device-tree for serialnumber and not /proc/cpu. I fix that now on add-on

jasimancas commented 6 years ago

Perfect, wait to update then. Thanks!

pvizeli commented 6 years ago

Please try it out :)

jasimancas commented 6 years ago

HI @pvizeli , I push Start, but nothing, dont start.

paskyecijano commented 6 years ago

When push Start button, the color of the button is red for 2 seconds, but nothing happend, dont start

pvizeli commented 6 years ago

Please report the log of: Supervisor, Add-on

jasimancas commented 6 years ago

Supervisor: 18-07-03 15:51:10 ERROR (SyncWorker_3) [hassio.docker] Can't create container from addon_core_bluetooth_bcm43xx: 500 Server Error: Internal Server Error ("invalid mode: r")

pvizeli commented 6 years ago

https://github.com/home-assistant/hassio/pull/548

johanvanhelden commented 6 years ago

I am currently having the same "invalid mode" issue as jasimancas. Is there any way for me to apply the fix, without having to wait for the official release? Because I have no clue how long that could take and currently many automations are going bonkers due to presence detection not working.

jasimancas commented 6 years ago

Update to Hassio 112 but...

bcm43xx_init Flash firmware /lib/firmware/brcm/BCM43430A1.hcd Set BDADDR UART: b8:27:eb:aa:aa:aa Set Controller UART speed to 921600 bit/s Device setup complete

johanvanhelden commented 6 years ago

I've upgraded to the new 112 release, restarted HA via the CLI, and now everything is working properly again, thanks for the quick release @pvizeli !

pvizeli commented 6 years ago

Hmm yeah I work on it. Look like docker block the devicetree maping with version 18.03

pvizeli commented 6 years ago

Okay, I implement a workaround for now

jasimancas commented 6 years ago

Thanks you very much @pvzeli

pvizeli commented 6 years ago

Need explicit mount to /proc until the new version of docker come they allow to unmask some folders in sys.

pvizeli commented 6 years ago

113 go out in 10min

pvizeli commented 6 years ago

image

With supervisor 113 and add-on version 2.2

jasimancas commented 6 years ago

Updated, but the add-on dont work: image image

pvizeli commented 6 years ago

Also after full reboot?

Do you need repair the devices? I don't see any reason why he not should work anymore.

pvizeli commented 6 years ago

I play around with: https://github.com/home-assistant/hassio-addons/pull/344

jasimancas commented 6 years ago

HassOS 64bits working with Rpi3B (not plus)? I'm using this image.

pvizeli commented 6 years ago

64bit is not official supported but it works. I see no issue actual. The official distro (rasbian run only with 32bit).

jasimancas commented 6 years ago

Settings 1:

bcm43xx_init Flash firmware /lib/firmware/brcm/BCM43430A1.hcd Set BDADDR UART: b8:27:eb:60:46:d0 Set Controller UART speed to 921600 bit/s Device setup complete

and

image

jasimancas commented 6 years ago

Settings 2:

bcm43xx_init Flash firmware /lib/firmware/brcm/BCM43430A1.hcd Set BDADDR UART: b8:27:eb:60:46:d0 Set Controller UART speed to 921600 bit/s Device setup complete

but image

paskyecijano commented 6 years ago

Hi @pvizeli,

The MAC is correct image

But not read anything information

image

image

pvizeli commented 6 years ago

Strange, let me play on evening with it

pvizeli commented 6 years ago

Hmm with my last update, it works for me.

If they now not working for you, it is a problem with auth/pair maybe?

danielsjf commented 6 years ago

Somehow it is still not working for me. Bluetooth 2.3 Supervisor 115 Hass os 1.3

The bluetooth log changed and is now not showing the MAC anymore.

miflora wise, I've checked the MAC at least 4 times. It is correct. It does connect to my phone. I can find it with a bluetooth scan on my phone as well. I have also checked the configuration.yaml which has exactly the settings from the documentation: https://www.home-assistant.io/components/sensor.miflora/

jasimancas commented 6 years ago

Yes @danielsjf same here:

bcm43xx_init Flash firmware /lib/firmware/brcm/BCM43430A1.hcd Set Controller UART speed to 921600 bit/s Device setup complete

pvizeli commented 6 years ago

It could be that the MAC is already set if you only reboot/update the add-on without a full start.

Hmm I can add a hciconfig hci0 to script and print out the config. Maybe there is a default value with old kernel / resinos and we need now set this manual on startup...

pvizeli commented 6 years ago

Okay, we offload the handling from add-on into HassOS and provide later api nice API on webinterface for handling pairing inside Hass.io panel

pvizeli commented 6 years ago

/move home-assistant/hassos

danielsjf commented 6 years ago

Yes I think this is a good idea as it can also help debugging. At the moment it is very unclear what happens if the Mac address given in the config does not work.

An in between could be that the Bluetooth add on has a more informative log. Currently it only shows four lines after it has started. It could show each attempt to connect and the result (e.g. Fail or success).