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

Bluetooth BCM43xx fail #340

Closed
ghost opened this issue Jul 2, 2018 · 55 comments
Closed

Bluetooth BCM43xx fail #340

ghost opened this issue Jul 2, 2018 · 55 comments

Comments

@ghost
Copy link

ghost commented Jul 2, 2018

@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
Copy link
Author

ghost commented Jul 2, 2018

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

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

@ghost
Copy link
Author

ghost commented Jul 2, 2018

@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
Copy link
Author

ghost commented Jul 2, 2018

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

Do you use the same config.txt?

@ghost
Copy link
Author

ghost commented Jul 2, 2018

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

The same config folder (home assistant).

@ghost
Copy link
Author

ghost commented Jul 2, 2018

@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
Copy link
Author

ghost commented Jul 2, 2018

@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
Copy link
Author

ghost commented Jul 2, 2018

@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
Copy link
Author

ghost commented Jul 2, 2018

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

The mac address is strange

@ghost
Copy link
Author

ghost commented Jul 2, 2018

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

Yes, maybe this is the problem.

@ghost
Copy link
Author

ghost commented Jul 2, 2018

@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
Copy link
Author

ghost commented Jul 2, 2018

@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
Copy link
Author

ghost commented Jul 2, 2018

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

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

@ghost
Copy link
Author

ghost commented Jul 2, 2018

@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
Copy link
Author

ghost commented Jul 2, 2018

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

Both, 32 and 64

@ghost
Copy link
Author

ghost commented Jul 2, 2018

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

I try to extract the correct serial number from device tree

@ghost
Copy link
Author

ghost commented Jul 2, 2018

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

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

@ghost
Copy link
Author

ghost commented Jul 2, 2018

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

#62

Will be release today

@ghost
Copy link
Author

ghost commented Jul 2, 2018

@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
Copy link

Perfect, wait to update then.
Thanks!

@pvizeli
Copy link
Member

pvizeli commented Jul 3, 2018

Please try it out :)

@jasimancas
Copy link

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

@paskyecijano
Copy link

paskyecijano commented Jul 3, 2018

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

@pvizeli
Copy link
Member

pvizeli commented Jul 3, 2018

Please report the log of: Supervisor, Add-on

@jasimancas
Copy link

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
Copy link
Member

pvizeli commented Jul 3, 2018

home-assistant/supervisor#548

@johanvanhelden
Copy link

johanvanhelden commented Jul 3, 2018

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
Copy link

jasimancas commented Jul 3, 2018

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
Copy link

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
Copy link
Member

pvizeli commented Jul 3, 2018

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

@pvizeli
Copy link
Member

pvizeli commented Jul 3, 2018

Okay, I implement a workaround for now

@jasimancas
Copy link

Thanks you very much @pvzeli

@pvizeli
Copy link
Member

pvizeli commented Jul 3, 2018

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

@pvizeli
Copy link
Member

pvizeli commented Jul 3, 2018

113 go out in 10min

@pvizeli
Copy link
Member

pvizeli commented Jul 3, 2018

image

With supervisor 113 and add-on version 2.2

@jasimancas
Copy link

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

@pvizeli
Copy link
Member

pvizeli commented Jul 4, 2018

Also after full reboot?

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

@pvizeli
Copy link
Member

pvizeli commented Jul 4, 2018

I play around with: #344

@jasimancas
Copy link

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

@pvizeli
Copy link
Member

pvizeli commented Jul 4, 2018

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

@jasimancas
Copy link

jasimancas commented Jul 4, 2018

Settings 1:

  • ResinOS 2.3.0+rev1
  • Hass.io 113
  • BT 2.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

and

image

@jasimancas
Copy link

Settings 2:

  • HassOS 1.2
  • Hass.io 113
  • BT 2.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
Copy link

Hi @pvizeli,

  • HassOS 1.2 (32 Bits)
  • Hass.io 113
  • BT 2.2

The MAC is correct
image

But not read anything information

image

image

@pvizeli pvizeli added the to do label Jul 4, 2018
@pvizeli
Copy link
Member

pvizeli commented Jul 4, 2018

Strange, let me play on evening with it

@pvizeli
Copy link
Member

pvizeli commented Jul 7, 2018

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
Copy link

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
Copy link

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
Copy link
Member

pvizeli commented Jul 9, 2018

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
Copy link
Member

pvizeli commented Jul 9, 2018

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
Copy link
Member

pvizeli commented Jul 9, 2018

/move home-assistant/hassos

@danielsjf
Copy link

danielsjf commented Jul 9, 2018

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).

@pvizeli
Copy link
Member

pvizeli commented Jul 9, 2018

home-assistant/operating-system#91

We integrate the modern bluetoothctl into host OS. We plan also to integrate bluetooth after that into hass.io, so that we could expose bluetooth functions to UI.

@pvizeli
Copy link
Member

pvizeli commented Jul 10, 2018

HassOS version 1.5 is on build

@pvizeli
Copy link
Member

pvizeli commented Jul 10, 2018

I close this now, you have the full power from HassOS and the add-on is not needed anymore. You can now also pair device over the CLI with bluetoothctl.

@pvizeli pvizeli closed this as completed Jul 10, 2018
@ghost ghost removed the to do label Jul 10, 2018
@danielsjf
Copy link

It is not entirely clear to me if it is supposed to be fixed now. In any case I can still not connect to devices like the miflora. Whenever I reboot, I get an endless stream of
Bluetooth: hci0 command 0x2011 tx timout

@danielsjf
Copy link

@paskyecijano and @jasimancas , is this now working for any of you on the raspberry pi 3 B+ for the 64 bit version? It doesn't work for me so far.

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

5 participants