{"id":1363,"date":"2018-08-07T11:52:44","date_gmt":"2018-08-07T10:52:44","guid":{"rendered":"https:\/\/ofalcao.pt\/blog\/?p=1363"},"modified":"2018-08-07T13:59:49","modified_gmt":"2018-08-07T12:59:49","slug":"broadcom-based-usb-ble-dongle","status":"publish","type":"post","link":"https:\/\/ofalcao.pt\/blog\/2018\/broadcom-based-usb-ble-dongle","title":{"rendered":"Broadcom-based USB BLE dongle"},"content":{"rendered":"<p>Found my BT BLE dongle with the Broadcom chipset.<\/p>\n<p>It&#8217;s a &#8220;Targus Bluetooth v4.0 Dual-mode Dongle ACB75A&#8221; that is sold at Staples.<\/p>\n<p>dmesg:<\/p>\n<pre>usb 1-1: new full-speed USB device number 9 using xhci_hcd\r\nusb 1-1: New USB device found, idVendor=0a5c, idProduct=21e8\r\nusb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3\r\nusb 1-1: Product: BCM20702A0\r\nusb 1-1: Manufacturer: Broadcom Corp\r\nusb 1-1: SerialNumber: 5CF370878D54\r\nBluetooth: hci1: BCM: chip id 63\r\nBluetooth: hci1: BCM: features 0x07\r\nBluetooth: hci1: BCM20702A\r\nBluetooth: hci1: BCM20702A1 (001.002.014) build 0000\r\nbluetooth hci1: Direct firmware load for brcm\/BCM20702A1-0a5c-21e8.hcd failed with error -2\r\nBluetooth: hci1: BCM: Patch brcm\/BCM20702A1-0a5c-21e8.hcd not found\r\n<\/pre>\n<p>hciconfig:<\/p>\n<pre>hci1:\tType: Primary  Bus: USB\r\n\tBD Address: 5C:F3:70:87:8D:54  ACL MTU: 1021:8  SCO MTU: 64:1\r\n\tUP RUNNING \r\n\tRX bytes:1052 acl:0 sco:0 events:63 errors:0\r\n\tTX bytes:4898 acl:0 sco:0 commands:63 errors:0\r\n\tFeatures: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87\r\n\tPacket type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 \r\n\tLink policy: RSWITCH SNIFF \r\n\tLink mode: SLAVE ACCEPT \r\n\tName: 'xxxx'\r\n\tClass: 0x1c010c\r\n\tService Classes: Rendering, Capturing, Object Transfer\r\n\tDevice Class: Computer, Laptop\r\n\tHCI Version: 4.0 (0x6)  Revision: 0x1000\r\n\tLMP Version: 4.0 (0x6)  Subversion: 0x220e\r\n\tManufacturer: Broadcom Corporation (15)\r\n<\/pre>\n<p>so it&#8217;s a Broadcom BCM20702A chipset and my Ubuntu doesn&#8217;t find the firmware needed. It still works without firmware but I went after it.<\/p>\n<p>This <a href=\"https:\/\/plugable.com\/2014\/06\/23\/plugable-usb-bluetooth-adapter-solving-hfphsp-profile-issues-on-linux\/\">site<\/a> helped:<\/p>\n<pre>wget https:\/\/s3.amazonaws.com\/plugable\/bin\/fw-0a5c_21e8.hcd\r\nsudo cp fw-0a5c_21e8.hcd \/lib\/firmware\/brcm\/BCM20702A1-0a5c-21e8.hcd<\/pre>\n<p>I got my script working with 6 LEGO BLE devices. And 7. And even 8:<\/p>\n<div class=\"jetpack-video-wrapper\"><iframe loading=\"lazy\" title=\"Controlling several LEGO BLE devices at same time #2\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/W5qWt9DiSqE?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<p>But latency isn&#8217;t great (with 8 I had to decrease the loop period from 1 second to 0.25 to prevent connection drops and even send the initial command twice to the Handset to hold the session) so even if it supports 14 sessions I doubt that we can make good use of 14 LEGO LPF2 hubs with just one dongle.<\/p>\n<p>To reduce latency we can add more dongles. But even so, when a command takes 0.2 to 0.3 seconds to complete before we can send the next one, it&#8217;s hardly interesting for robotics. A Powered Up based robot will require a real autonomous device, able to read its own sensors and react on the fly, not with half a second round trip delay to the &#8220;brain&#8221;.<\/p>\n<p>Also tried the script without the firmware. It works but with a few &#8220;connect error: Function not implemented (38)&#8221;.<\/p>\n<p>And also re-tried the Cambridge CSR 4.0. It clearly states that it can&#8217;t handle the sixth: &#8220;connect error: Too many links (31)&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Found my BT BLE dongle with the Broadcom chipset. It&#8217;s a &#8220;Targus Bluetooth v4.0 Dual-mode Dongle ACB75A&#8221; that is sold at Staples. dmesg: usb 1-1: new full-speed USB device number 9 using xhci_hcd usb 1-1: New USB device found, idVendor=0a5c, idProduct=21e8 usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 1-1: Product: BCM20702A0 usb &hellip; <a href=\"https:\/\/ofalcao.pt\/blog\/2018\/broadcom-based-usb-ble-dongle\" class=\"more-link\">Continuar a ler<span class=\"screen-reader-text\"> &#8220;Broadcom-based USB BLE dongle&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[1],"tags":[],"series":[],"class_list":["post-1363","post","type-post","status-publish","format-standard","hentry","category-sem-categoria"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2Mhyv-lZ","_links":{"self":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts\/1363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/comments?post=1363"}],"version-history":[{"count":0,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts\/1363\/revisions"}],"wp:attachment":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/media?parent=1363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/categories?post=1363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/tags?post=1363"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/series?post=1363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}