RPi Bluetooth

From Datateknik
Jump to: navigation, search

Using rPi Zero W -> BLE -> 6LoWPAN -> XYZ to communicate over the Internet
IoT without Internet (Ip addresses) is *not* IoT !!!

WORK IN PROGRESS

Article: https://ieeexplore-ieee-org.ezproxy.server.hv.se/document/8390350 nrf51 supports 6lowpan: https://www.electronicsweekly.com/news/bluetooth-europe-2015-bluetooth-smart-ipv6-iot-2015-09/

Contents

Bluetooth


SLAVE

lsmod               # Chech what your system already got -- If you get nice lines, you don't have to recompile your kernel :-)
modprobe bluetooth_6lowpan
lsmod | grep 6low   #gives three (3) lines
echo "1" > /sys/kernel/debug/bluetooth/6lowpan_enable
lsmod | grep 6low   #gives three (4) lines; now including  ipv6 -> 6lowpan
#rename hci0 to "whatever"
hciconfig hci0 name rpi-slave
# doing "hcitool lescan" on a third comupter shows nothing
# this cammand is undocumented ?!?
hciconfig hci0 leadv
# the slave now shows up as BCM43438A1

MASTER

modprobe bluetooth_6lowpan
lsmod | grep 6low #gives three (3) lines
echo "1" > /sys/kernel/debug/bluetooth/6lowpan_enable
lsmod | grep 6low #gives three (4) lines; now includes  ipv6 -> 6lowpan
hciconfig hci0 name Master
#Use address of other side's hci0 (Low Energy Create Connexion)
hcitool lecc B8:27:EB:C1:E9:42
# lecc should return "connection handle 65"
sleep 5
echo "connect B8:27:EB:C1:E9:42 2" > /sys/kernel/debug/bluetooth/6lowpan_control
#... eller ska det va en etta E9:42 1 ???!!  <type> is BLE address type: 1 for public address and 2 for random address.
#
#still nothing in ifconfig
ifconfig bt0 up
ifconfig   # Finally!

Scanning BLE

Scanning BLE is from https://elinux.org/RPi_Bluetooth_LE

device testing

  1. Check what devices you've got

--- ON A PC ---

root@raspberry:/home/pi# lsusb
Bus 002 Device 004: ID 0a5c:5800 Broadcom Corp. BCM5880 Secure Applications Processor
Bus 002 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@raspberry:/home/pi# 
root@raspberry:/home/pi/Downloads# lsusb -d 0a12:0001
Bus 002 Device 006: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
root@raspberry:/home/pi/Downloads# lsusb -v -d 0a12:0001
Bus 002 Device 006: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Device Descriptor:
 bLength                18
 bDescriptorType         1
 bcdUSB               2.00
 bDeviceClass          224 Wireless
 bDeviceSubClass         1 Radio Frequency
 bDeviceProtocol         1 Bluetooth
 bMaxPacketSize0        64
 idVendor           0x0a12 Cambridge Silicon Radio, Ltd
 idProduct          0x0001 Bluetooth Dongle (HCI mode)
 bcdDevice           88.91
 iManufacturer           0 
 iProduct                2 CSR8510 A10
 iSerial                 0 
 bNumConfigurations      1
 Configuration Descriptor:
   bLength                 9
   bDescriptorType         2
   wTotalLength          177
   bNumInterfaces          2
   bConfigurationValue     1
   iConfiguration          0 
   bmAttributes         0xe0
     Self Powered
     Remote Wakeup
   MaxPower              100mA
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        0
     bAlternateSetting       0
     bNumEndpoints           3
     bInterfaceClass       224 Wireless
     bInterfaceSubClass      1 Radio Frequency
     bInterfaceProtocol      1 Bluetooth
     iInterface              0 
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x81  EP 1 IN
       bmAttributes            3
         Transfer Type            Interrupt
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0010  1x 16 bytes
       bInterval               1
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x02  EP 2 OUT
       bmAttributes            2
         Transfer Type            Bulk
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0040  1x 64 bytes
       bInterval               1
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x82  EP 2 IN
       bmAttributes            2
         Transfer Type            Bulk
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0040  1x 64 bytes
       bInterval               1
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       0
     bNumEndpoints           2
     bInterfaceClass       224 Wireless
     bInterfaceSubClass      1 Radio Frequency
     bInterfaceProtocol      1 Bluetooth
     iInterface              0 
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x03  EP 3 OUT
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0000  1x 0 bytes
       bInterval               1
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x83  EP 3 IN
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0000  1x 0 bytes
       bInterval               1
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       1
     bNumEndpoints           2
     bInterfaceClass       224 Wireless
     bInterfaceSubClass      1 Radio Frequency
     bInterfaceProtocol      1 Bluetooth
     iInterface              0 
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x03  EP 3 OUT
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0009  1x 9 bytes
       bInterval               1
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x83  EP 3 IN
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0009  1x 9 bytes
       bInterval               1
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       2
     bNumEndpoints           2
     bInterfaceClass       224 Wireless
     bInterfaceSubClass      1 Radio Frequency
     bInterfaceProtocol      1 Bluetooth
     iInterface              0 
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x03  EP 3 OUT
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0011  1x 17 bytes
       bInterval               1
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x83  EP 3 IN
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0011  1x 17 bytes
       bInterval               1
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       3
     bNumEndpoints           2
     bInterfaceClass       224 Wireless
     bInterfaceSubClass      1 Radio Frequency
     bInterfaceProtocol      1 Bluetooth
     iInterface              0 
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x03  EP 3 OUT
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0019  1x 25 bytes
       bInterval               1
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x83  EP 3 IN
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0019  1x 25 bytes
       bInterval               1
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       4
     bNumEndpoints           2
     bInterfaceClass       224 Wireless
     bInterfaceSubClass      1 Radio Frequency
     bInterfaceProtocol      1 Bluetooth
     iInterface              0 
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x03  EP 3 OUT
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0021  1x 33 bytes
       bInterval               1
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x83  EP 3 IN
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0021  1x 33 bytes
       bInterval               1
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       5
     bNumEndpoints           2
     bInterfaceClass       224 Wireless
     bInterfaceSubClass      1 Radio Frequency
     bInterfaceProtocol      1 Bluetooth
     iInterface              0 
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x03  EP 3 OUT
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0031  1x 49 bytes
       bInterval               1
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x83  EP 3 IN
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0031  1x 49 bytes
       bInterval               1

Device Status: 0x0001

 Self Powered

root@raspberry:/home/pi/Downloads#


root@raspberry:/home/pi# hciconfig -a
hci0:	Type: Primary  Bus: USB
	BD Address: 00:1A:7D:DA:71:0E  ACL MTU: 310:10  SCO MTU: 64:8

UP RUNNING RX bytes:94567 acl:0 sco:0 events:2186 errors:0 TX bytes:4223 acl:0 sco:0 commands:64 errors:0 Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 0x87 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 Link policy: RSWITCH HOLD SNIFF PARK Link mode: SLAVE ACCEPT Name: 'raspberry' Class: 0x6c010c Service Classes: Rendering, Capturing, Audio, Telephony Device Class: Computer, Laptop HCI Version: 4.0 (0x6) Revision: 0x22bb LMP Version: 4.0 (0x6) Subversion: 0x22bb Manufacturer: Cambridge Silicon Radio (10)

root@raspberry:/home/pi# 

--- ON rPI ---

  1. lsusb
  1. Basic installation checks: The Pi 3's built-in Bluetooth adapter is called hci0. You can check it is operating correctly with the command:
    hciconfig (use hciconfig -a for more details)
root@raspberrypi:/home/pi# lsusb
Bus 001 Device 004: ID 0461:4d51 Primax Electronics, Ltd 0Y357C PMX-MMOCZUL (B) [Dell Laser Mouse]
Bus 001 Device 003: ID 413c:2003 Dell Computer Corp. Keyboard
Bus 001 Device 002: ID 0424:2412 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The BLE adapter is not on the USB-bus in rPi Zero W !!

root@raspberrypi:/home/pi# hciconfig -a
hci0:	Type: Primary  Bus: UART
	BD Address: B8:27:EB:C1:E9:42  ACL MTU: 1021:8  SCO MTU: 64:1
	UP RUNNING 
	RX bytes:1469 acl:0 sco:0 events:89 errors:0
	TX bytes:4405 acl:0 sco:0 commands:89 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: SLAVE ACCEPT 
	Name: 'raspberrypi'
	Class: 0x6c0000
	Service Classes: Rendering, Capturing, Audio, Telephony
	Device Class: Miscellaneous, 
	HCI Version: 4.1 (0x7)  Revision: 0x168
	LMP Version: 4.1 (0x7)  Subversion: 0x2209
	Manufacturer: Broadcom Corporation (15)

root@raspberrypi:/home/pi# 


  1. If you are on a laptop two(2) hci devices will show up, the first one is buggy
    hciconfig hci0 down
  2. Now you can try scanning for BLE devices
    hcitool lescan

Python programs

  1. do stuff
    sudo apt-get install python-pip
    sudo apt-get install libglib2.0-dev
    sudo pip install bluepy
    blescan

has GATTOOL anything to do with it ??

gatttool

https://elinux.org/RPi_Bluetooth_LE#Connecting_with_gatttool

Creating a channel, capable of 6lowPAN (IPv6)

[RFC7668] "IPv6 over Bluetooth LE is dependent on both Bluetooth 4.1 and IPSP 1.0 or ..."


Reading http://blog.bluetooth.com/bluetooth-meet-the-internet-internet-say-hello-to-bluetooth you find that BLE uses Generic Attribute Profile (GATT) which is modular, and not Generic Access Profil (GAP) which is static and used by Bluetooth Classic.

GATT has many forms of which one is Internet Protocol Support Profile (IPSP) (Beware of HTTP Proxy Service (HPS) which is something completely different

Picture http://blog.bluetooth.com/~/media/images/blog%20images/migrated/smarthomerouter-01.ahsx (IPv6-BLE switch -> Gateway -> IPv6-Wifi-Bulb == All Native IPv6)

Command for setting what I am (IPSP)

 lsmod | grep 6lo
 modprobe bluetooth_6lowpan
 echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable
 modprobe bluetooth_6lowpan
 lsmod | grep 6lo
   bluetooth_6lowpan 24576 0
   6lowpan 36864 8 nhc_udp,nhc_routing,nhc_mobility,bluetooth_6lowpan,nhc_fragment,nhc_dest,nhc_hop,nhc_ipv6
   bluetooth 552960 32 btrtl,bluetooth_6lowpan,btintel,bnep,btbcm,rfcomm,btusb
   ipv6                  401548  29 6lowpan
 hciconfig hci0 lestates
   YES Non-connectable Advertising State
   < 20 more lines >
 
 hciconfig hci0 leadv
   LE set advertise enable on hci0 returned status 12
> #hciconfig hci0 lestates 
> Read LE supported states on hci0 returned status 12  

Yep, 0x0c or 12 is for unsupported command. So the fw doesn't seem to  have support for LE. 
Let me get back to you on this, need to check up what fw is upon the repository. 
Note
   If using a Linux kernel version less than 4.0, the kernel debug file 6lowpan_enable will not be present. 
   Instead you should use "echo 35 > /sys/kernel/debug/bluetooth/6lowpan_psm" to set PSM channel as 0x23 (35),
   and enable the bluetooth 6lowpan module.

Command for viewing other end capabilities (IPSP ??)

 hcitool lescan
 LE Scan ...
 CB:AF:14:57:D8:6E (unknown)
 CB:AF:14:57:D8:6E Test IPSP node
  \-- from http://docs.zephyrproject.org/samples/bluetooth/ipsp/README.html

Local setup: NOT WORKING !!

#!/bin/sh
. ./ibeacon.conf
echo "Launching virtual iBeacon..."
sudo hciconfig $BLUETOOTH_DEVICE up
sudo hciconfig $BLUETOOTH_DEVICE noleadv
sudo hciconfig $BLUETOOTH_DEVICE leadv 0
sudo hcitool -i hci0 cmd 0x08 0x0008 1e 02 01 1a 1a ff 4c 00 02 15 $UUID $MAJOR $MINOR $POWER 00 00 00 00 00 00 00 00 00 00 00 00 00
echo "Complete"

Setting an IPv6 address

following the lowpan 802.15.4 blog

  • add
    apt-get install libnl-3-dev
  • This is a strange page
    https://devzone.nordicsemi.com/f/nordic-q-a/14292/iot-sdk-rpi3---using-jessie-with-bluetooth_6lowpan
    • that says:
      root@raspberry:/home/pi#
      root@raspberry:/home/pi# lsmod | grep 6lo
      root@raspberry:/home/pi# modprobe bluetooth_6lowpan
      root@raspberry:/home/pi# echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable
      root@raspberry:/home/pi# modprobe bluetooth_6lowpan
      root@raspberry:/home/pi# lsmod | grep 6lo
      bluetooth_6lowpan 24576 0
      6lowpan 36864 8 nhc_udp,nhc_routing,nhc_mobility,bluetooth_6lowpan,nhc_fragment,nhc_dest,nhc_hop,nhc_ipv6
      bluetooth 552960 32 btrtl,bluetooth_6lowpan,btintel,bnep,btbcm,rfcomm,btusb
      root@raspberry:/home/pi#

Now to establish my Bluetooth connection between the Raspberry Pis I run though the following steps: On the Master device I run the following commands:

#need root access
sudo su

#enable 6lowpan over Bluetooth le
echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable

#start advertising Bluetooth LE service
hciconfig hci0 leadv

On the Slave device I run the following commands:

#need root access
sudo su

#enable 6lowpan over Bluetooth le
echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable

#establish le connection to master
hcitool lecc 5C:F3:70:XX:XX:XX

The hcitool lecc command always returns “Connection Handle 64”. At this point I have a stable connection between the two devices that I can verify using the hcitool con command.

I am now able to run the following command on either the master or the slave where the mac address is the address for the Bluetooth device I am connecting too:

echo “connect 5C:F3:70:XX:XX:XX 1” > /sys/kernel/debug/bluetooth/6lowpan_control

Whichever Raspberry Pi I run the command on establishes a 6lowpan connection and if I run the ifconfig command I see a new bt0 device.

Programming in python

Windows 10: Check BLE Version

Deltaco-CSR-DeviceManager.png
The LMP versions correspond to Bluetooth versions as follows:

   LMP 0.x - Bluetooth 1.0b
   LMP 1.x - Bluetooth 1.1
   LMP 2.x - Bluetooth 1.2
   LMP 3.x - Bluetooth 2.0 + EDR
   LMP 4.x - Bluetooth 2.1 + EDR
   LMP 5.x - Bluetooth 3.0 + HS
   LMP 6.x - Bluetooth 4.0
   LMP 7.x - Bluetooth 4.1
   LMP ​8.x - ​Bluetooth 4.2
   LMP 9.x - Bluetooth 5.0          
Source: https://superuser.com/questions/502825/how-can-i-find-out-what-version-of-bluetooth-my-laptop-supports

==LÄNKAR==Bluetooth 5 for rPI 3 ?!?: http://blog.bluetooth.com/bluetooth-developer-starter-kit-50

Firmware


+Start advertising with EIR data (__Linux only__):
+
+    var scanData = new Buffer(...); // maximum 31 bytes
+    var advertisementData = new Buffer(...); // maximum 31 bytes
+
+    bleno.startAdvertisingWithEIRData(advertisementData, scanData[, callback(error)]);
+
+  * For EIR format section [Bluetooth Core Specification](https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=229737) sections and 8 and 18 for more information the data format.
  • från tysk sida

https://forum.fhem.de/index.php?topic=68019.15


Hi und danke erstmal,

bin jetzt soweit mit fast allen befehlen durch 

Code: [Auswählen]
pi@raspberrypi:~ $ ls -l /dev/ser*
lrwxrwxrwx 1 root root 7 Feb 28 23:59 /dev/serial0 -> ttyAMA0
lrwxrwxrwx 1 root root 5 Feb 28 23:59 /dev/serial1 -> ttyS0

das sieht schon mal gut aus, lt. deinem Howto
allerdings bekomme ich dennoch kein Device : 

Code: [Auswählen]
pi@raspberrypi:~ $ hcitool dev
Devices:
pi@raspberrypi:~ $ hcitool scan
Device is not available: No such device
pi@raspberrypi:~ $ 

glaub bin zu müde oder zu blind.
habt Ihr eine Idee ??

danke


pi@raspberrypi:~ $  systemctl status bluetooth
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled)
   Active: active (running) since Do 2017-03-09 22:05:23 CET; 22s ago
     Docs: man:bluetoothd(8)
 Main PID: 794 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─794 /usr/lib/bluetooth/bluetoothd
pi@raspberrypi:~ $ sudo service bluetooth status
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled)
   Active: active (running) since Do 2017-03-09 22:05:23 CET; 27s ago
     Docs: man:bluetoothd(8)
 Main PID: 794 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─794 /usr/lib/bluetooth/bluetoothd

pi@raspberrypi:~ $ sudo hciconfig dev
Can't get device info: No such device

pi@raspberrypi:~ $ sudo bluetoothctl
[bluetooth]# agent on
Agent registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# scan on
No default controller available
[bluetooth]# exit
Agent unregistered


pi@raspberrypi:~ $ dmesg | grep Blue
[   22.873317] Bluetooth: Core ver 2.22
[   22.873369] Bluetooth: HCI device and connection manager initialized
[   22.873381] Bluetooth: HCI socket layer initialized
[   22.873389] Bluetooth: L2CAP socket layer initialized
[   22.873408] Bluetooth: SCO socket layer initialized
[  103.040851] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[  103.040860] Bluetooth: BNEP filters: protocol multicast
[  103.040871] Bluetooth: BNEP socket layer initialized






so alles was mit Bluetooth zu tun hat gelöscht und folgendes getan

Code: [Auswählen]
sudo apt-get install raspberrypi-sys-mods

sudo apt-get --reinstall install pi-bluetooth

sudo shutdown -r now


dann 

Code: [Auswählen]
sudo systemctl start hciuart.service
pi@raspberrypi:~ $ systemctl status hciuart.service
● hciuart.service - Configure Bluetooth Modems connected by UART
   Loaded: loaded (/lib/systemd/system/hciuart.service; disabled)
   Active: active (running) since Fr 2017-03-10 00:17:11 CET; 5s ago
  Process: 951 ExecStart=/usr/bin/btuart (code=exited, status=0/SUCCESS)
 Main PID: 962 (hciattach)
   CGroup: /system.slice/hciuart.service
           └─962 /usr/bin/hciattach /dev/serial1 bcm43xx 460800 noflow -



und siehe da!!!

Code: [Auswählen]
pi@raspberrypi:~ $ hcitool dev
Devices:
	hci0	B8:27:EB:90:BC:6D

es geht!!

danke an alle!

HARDWARE

  1. pSoC
    • Raspberry Pi Zero W
  2. USB Dongle
  3. FINALLY: BLE 4.2 !!! USB-KW41Z from NXP
  4. Intel (List of drivers: https://www.intel.com/content/www/us/en/support/articles/000005559/network-and-i-o/wireless-networking.html)
  5. Unusable 4.0
  6. Thomas har en Intel(R) Dual Band Wireless-AC 7265 i en Dell E7250(?)

ASUS Dongle

ASUS ANOTHER
pi@raspberry:~ $ lsusb 
Bus 002 Device 003: ID 0a5c:5800 Broadcom Corp. BCM5880 Secure Applications Processor
Bus 002 Device 004: ID 0b05:17cb ASUSTek Computer, Inc. Broadcom BCM20702A0 Bluetooth
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Yadayada


ASUS ANOTHER
pi@raspberry:~ $ lsusb -v -d 0b05:17cb 

Bus 002 Device 004: ID 0b05:17cb ASUSTek Computer, Inc. Broadcom BCM20702A0 Bluetooth
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass         1 
  bDeviceProtocol         1 
  bMaxPacketSize0        64
  idVendor           0x0b05 ASUSTek Computer, Inc.
  idProduct          0x17cb Broadcom BCM20702A0 Bluetooth
  bcdDevice            1.12
  iManufacturer           1 
  iProduct                2 
  iSerial                 3 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          218
    bNumInterfaces          4
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      1 
      bInterfaceProtocol      1 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      1 
      bInterfaceProtocol      1 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      1 
      bInterfaceProtocol      1 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       2
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      1 
      bInterfaceProtocol      1 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       3
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      1 
      bInterfaceProtocol      1 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       4
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      1 
      bInterfaceProtocol      1 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       5
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      1 
      bInterfaceProtocol      1 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0020  1x 32 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0020  1x 32 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       254 Application Specific Interface
      bInterfaceSubClass      1 Device Firmware Update
      bInterfaceProtocol      1 
      iInterface              0 
      Device Firmware Upgrade Interface Descriptor:
        bLength                             9
        bDescriptorType                    33
        bmAttributes                        5
          Will Not Detach
          Manifestation Tolerant
          Upload Unsupported
          Download Supported
        wDetachTimeout                   5000 milliseconds
        wTransferSize                      64 bytes
        bcdDFUVersion                   1.10
pi@raspberry:~ $ 

root@raspberry:/home/pi/Downloads# lsusb -v -d 0a12:0001
Bus 002 Device 006: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Device Descriptor:
 bLength                18
 bDescriptorType         1
 bcdUSB               2.00
 bDeviceClass          224 Wireless
 bDeviceSubClass         1 Radio Frequency
 bDeviceProtocol         1 Bluetooth
 bMaxPacketSize0        64
 idVendor           0x0a12 Cambridge Silicon Radio, Ltd
 idProduct          0x0001 Bluetooth Dongle (HCI mode)
 bcdDevice           88.91
 iManufacturer           0 
 iProduct                2 CSR8510 A10
 iSerial                 0 
 bNumConfigurations      1
 Configuration Descriptor:
   bLength                 9
   bDescriptorType         2
   wTotalLength          177
   bNumInterfaces          2
   bConfigurationValue     1
   iConfiguration          0 
   bmAttributes         0xe0
     Self Powered
     Remote Wakeup
   MaxPower              100mA
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        0
     bAlternateSetting       0
     bNumEndpoints           3
     bInterfaceClass       224 Wireless
     bInterfaceSubClass      1 Radio Frequency
     bInterfaceProtocol      1 Bluetooth
     iInterface              0 
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x81  EP 1 IN
       bmAttributes            3
         Transfer Type            Interrupt
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0010  1x 16 bytes
       bInterval               1
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x02  EP 2 OUT
       bmAttributes            2
         Transfer Type            Bulk
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0040  1x 64 bytes
       bInterval               1
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x82  EP 2 IN
       bmAttributes            2
         Transfer Type            Bulk
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0040  1x 64 bytes
       bInterval               1
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       0
     bNumEndpoints           2
     bInterfaceClass       224 Wireless
     bInterfaceSubClass      1 Radio Frequency
     bInterfaceProtocol      1 Bluetooth
     iInterface              0 
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x03  EP 3 OUT
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0000  1x 0 bytes
       bInterval               1
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x83  EP 3 IN
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0000  1x 0 bytes
       bInterval               1
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       1
     bNumEndpoints           2
     bInterfaceClass       224 Wireless
     bInterfaceSubClass      1 Radio Frequency
     bInterfaceProtocol      1 Bluetooth
     iInterface              0 
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x03  EP 3 OUT
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0009  1x 9 bytes
       bInterval               1
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x83  EP 3 IN
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0009  1x 9 bytes
       bInterval               1
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       2
     bNumEndpoints           2
     bInterfaceClass       224 Wireless
     bInterfaceSubClass      1 Radio Frequency
     bInterfaceProtocol      1 Bluetooth
     iInterface              0 
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x03  EP 3 OUT
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0011  1x 17 bytes
       bInterval               1
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x83  EP 3 IN
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0011  1x 17 bytes
       bInterval               1
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       3
     bNumEndpoints           2
     bInterfaceClass       224 Wireless
     bInterfaceSubClass      1 Radio Frequency
     bInterfaceProtocol      1 Bluetooth
     iInterface              0 
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x03  EP 3 OUT
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0019  1x 25 bytes
       bInterval               1
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x83  EP 3 IN
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0019  1x 25 bytes
       bInterval               1
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       4
     bNumEndpoints           2
     bInterfaceClass       224 Wireless
     bInterfaceSubClass      1 Radio Frequency
     bInterfaceProtocol      1 Bluetooth
     iInterface              0 
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x03  EP 3 OUT
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0021  1x 33 bytes
       bInterval               1
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x83  EP 3 IN
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0021  1x 33 bytes
       bInterval               1
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       5
     bNumEndpoints           2
     bInterfaceClass       224 Wireless
     bInterfaceSubClass      1 Radio Frequency
     bInterfaceProtocol      1 Bluetooth
     iInterface              0 
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x03  EP 3 OUT
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0031  1x 49 bytes
       bInterval               1
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x83  EP 3 IN
       bmAttributes            1
         Transfer Type            Isochronous
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0031  1x 49 bytes
       bInterval               1
Device Status: 0x0001

 Self Powered
root@raspberry:/home/pi/Downloads#



pi@raspberry:~ $ hciconfig -a
hci0:	Type: Primary  Bus: USB
	BD Address: 5C:F3:70:90:38:32  ACL MTU: 1021:8  SCO MTU: 64:1
	UP RUNNING 
	RX bytes:1026 acl:0 sco:0 events:60 errors:0
	TX bytes:4176 acl:0 sco:0 commands:60 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: SLAVE ACCEPT 
	Name: 'raspberry'
	Class: 0x6c010c
	Service Classes: Rendering, Capturing, Audio, Telephony
	Device Class: Computer, Laptop
	HCI Version: 4.0 (0x6)  Revision: 0x1000
	LMP Version: 4.0 (0x6)  Subversion: 0x220e
	Manufacturer: Broadcom Corporation (15)

pi@raspberry:~ $ 

USB 4.2 Dongle

root@raspberry:/home/pi# lsusb
Bus 002 Device 003: ID 0a12:1020 Cambridge Silicon Radio, Ltd

root@raspberry:/home/pi/Downloads# lsusb -v -d  0a12:1020

Bus 002 Device 005: ID 0a12:1020 Cambridge Silicon Radio, Ltd 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0a12 Cambridge Silicon Radio, Ltd
  idProduct          0x1020 
  bcdDevice           63.02
  iManufacturer           0 
  iProduct                2 CSR Audio Adaptor
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          224
    bNumInterfaces          5
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower               96mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0 
      iInterface              0 
      AudioControl Interface Descriptor:
        bLength                10
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength           52
        bInCollection           2
        baInterfaceNr( 0)       1
        baInterfaceNr( 1)       2
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0203 Personal Microphone
        bAssocTerminal          0
        bNrChannels             1
        wChannelConfig     0x0000
        iChannelNames           0 
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             2
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID               1
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             3
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bNrChannels             2
        wChannelConfig     0x0003
          Left Front (L)
          Right Front (R)
        iChannelNames           0 
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             4
        wTerminalType      0x0302 Headphones
        bAssocTerminal          0
        bSourceID               3
        iTerminal               0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           3
        bDelay                  0 frames
        wFormatTag              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            1 Discrete
        tSamFreq[ 0]        48000
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x81
            Sampling Frequency
            MaxPacketsOnly
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay              0 Decoded PCM samples
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x00c0  1x 192 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           2
        bDelay                  0 frames
        wFormatTag              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             1
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            1 Discrete
        tSamFreq[ 0]        48000
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x00
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay              0 Decoded PCM samples
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0060  1x 96 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      44
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        4
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      47
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               1
Device Status:     0x0000
  (Bus Powered)
root@raspberry:/home/pi/Downloads#

Surface Pro, running raspbian Desktop

lsusb

root@surfacepi:/home/pi# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 045e:07e8 Microsoft Corp. 
Bus 001 Device 004: ID 1286:204c Marvell Semiconductor, Inc. 
Bus 001 Device 002: ID 0951:162a Kingston Technology DataTraveler 112 4GB Pen Drive
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@raspberrypi:/home/pi# lsusb -d 1286:204c
Bus 001 Device 004: ID 1286:204c Marvell Semiconductor, Inc. 
root@surfacepi:/home/pi# lsusb -v -d 1286:204c

Bus 001 Device 004: ID 1286:204c Marvell Semiconductor, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          224 Wireless
  bDeviceSubClass         1 Radio Frequency
  bDeviceProtocol         1 Bluetooth
  bMaxPacketSize0        64
  idVendor           0x1286 Marvell Semiconductor, Inc.
  idProduct          0x204c 
... etc etc

hciconfig

root@surfacepi:/home/pi# hciconfig
hci0:	Type: Primary  Bus: USB
	BD Address: B4:AE:2B:D0:CF:91  ACL MTU: 1021:7  SCO MTU: 240:3
	UP RUNNING 
	RX bytes:12731 acl:0 sco:0 events:321 errors:0
	TX bytes:3440 acl:0 sco:0 commands:58 errors:0
 
 root@surfacepi:/home/pi# hciconfig -a
  hci0:	Type: Primary  Bus: USB
	BD Address: B4:AE:2B:D0:CF:91  ACL MTU: 1021:7  SCO MTU: 240:3
	UP RUNNING 
	RX bytes:12731 acl:0 sco:0 events:321 errors:0
	TX bytes:3440 acl:0 sco:0 commands:58 errors:0
	Features: 0xff 0xfe 0x8f 0xfe 0xdb 0xff 0x7b 0x87
	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
	Link policy: RSWITCH HOLD SNIFF 
	Link mode: SLAVE ACCEPT 
	Name: 'raspberrypi'
	Class: 0x48010c
	Service Classes: Capturing, Telephony
	Device Class: Computer, Laptop
	HCI Version: 4.0 (0x6)  Revision: 0x8300
	LMP Version: 4.0 (0x6)  Subversion: 0x724d
	Manufacturer: Marvell Technology Group Ltd. (72)

USB 5.0 Dongle (makerspot)

root@raspberry:/home/pi/Downloads# lsusb
Bus 002 Device 004: ID 0a5c:5800 Broadcom Corp. BCM5880 Secure Applications Processor
Bus 002 Device 007: ID 10c4:ea80 Cygnal Integrated Products, Inc. CP210x UART Bridge
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@raspberry:/home/pi/Downloads# lsusb -d 10c4:ea80
Bus 002 Device 007: ID 10c4:ea80 Cygnal Integrated Products, Inc. CP210x UART Bridge
root@raspberry:/home/pi/Downloads# lsusb -v -d 10c4:ea80

Bus 002 Device 007: ID 10c4:ea80 Cygnal Integrated Products, Inc. CP210x UART Bridge
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x10c4 Cygnal Integrated Products, Inc.
  idProduct          0xea80 CP210x UART Bridge
  bcdDevice            1.00
  iManufacturer           1 Silicon Laboratories
  iProduct                2 CP2110 HID USB-to-UART Bridge
  iSerial                 3 005A9770
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     919
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
Device Status:     0x0000
  (Bus Powered)
root@raspberry:/home/pi/Downloads# 

IPSP (Internet Protocol Support Profile)

This is *not* Bluetooth, bluetooth has fixed profiles such as A2DP https://en.wikipedia.org/wiki/List_of_Bluetooth_profiles#Advanced_Audio_Distribution_Profile_(A2DP)


The Generic Attributes (GATT) define a hierarchical data structure that is exposed to connected Bluetooth Low Energy (LE) devices.

The Generic Attribute Profile (GATT) procedures define standard ways that services, characteristics and their descriptors can be discovered and then used to allow Bluetooth Low Energy devices to transfer data. The profile describes a use case, roles and general behaviors based on GATT functionality.

IPSP Profile

IPSP is one of GATT https://www.bluetooth.com/specifications/gatt

Maybe a hint on how to detect whats IPSP, and whats not

Code snippet from https://github.com/NordicSemiconductor/Linux-ble-6lowpan-joiner/blob/master/src/bluetooth_6lowpand.c

===/*  Parse EIR events for IPSP device. */===
static bool parse_ip_service(uint8_t *eir, size_t eir_len, char *buf, size_t buf_len)
{
	size_t offset = 0;
	bool ipsp_service = false;
	bool ssid_correct = false;
	uint8_t val[256];

	memset(val, 0, 256);

	while (offset < eir_len) {
		size_t field_len = eir[0];

		switch (eir[1]) {
		case EIR_UUID16_SOME:
		case EIR_UUID16_ALL:
			put_le16(IPSP_UUID, &val[0]);
			if (!memcmp(val, eir + 2, field_len/2))
				ipsp_service = true;
			break;
		case EIR_NAME_SHORT:
		case EIR_NAME_COMPLETE:
			if (field_len - 1 > buf_len)
				break;
			memcpy(buf, &eir[2], field_len - 1);
			break;
		case EIR_MANUF_SPECIFIC_DATA:
			put_le16(NORDIC_COMPANY_ID, &val[0]);
			if (auth_type == COMMISSIONING_AUTH_WIFI_CFG) {
				/* Reread configuration of WiFi. */
				if (read_wifi_cfg() == -1) {
					perror("Cannot read Wifi configuration.");
					return 0;
				}
			}

			memcpy(val + 2, auth_ssid_value, auth_ssid_len);
			if (!memcmp(val, eir + 2, auth_ssid_len + 2) &&
				auth_ssid_len == field_len - 3)
				ssid_correct = true;
			break;
		}

		offset += field_len + 1;
		eir += field_len + 1;
	}

	return ipsp_service && (ssid_correct || (auth_type == COMMISSIONING_AUTH_NONE));
}


===/* Scan the IPSP device */===
static bool scan_ipsp_device(int dd, unsigned int timeout, char *dev_name, char *dev_addr, bool use_whitelist)
{
	/* device scan parameters */
	uint8_t own_type = LE_PUBLIC_ADDRESS;
	uint8_t scan_type = 0x01; /* Active scanning. */
	uint8_t filter_policy = 0x00;
	uint16_t interval = htobs(0x0010);
	uint16_t window = htobs(0x0004);
	uint8_t filter_dup = 0x01;

	unsigned char buf[HCI_MAX_EVENT_SIZE], *ptr;
	struct hci_filter nf, of;
	struct sigaction sa;
	socklen_t olen;
	struct pollfd pollfd;
	int poll_ret;
	bool scan_ret = false;
	int err;
	time_t start_time;
	time_t curr_time;
	double running_time;

	start_time = time(NULL);

	/* Scan BLE devices */
	err = hci_le_set_scan_parameters(dd, scan_type, interval, window, own_type, filter_policy, 10000);
	if (err < 0) {
		perror("Set scan parameters failed");
		return scan_ret;
	}

	err = hci_le_set_scan_enable(dd, 0x01, filter_dup, 10000);
	if (err < 0) {
		perror("Enable scan failed");
		return scan_ret;
	}

	DEBUG_PRINT("LE Scan ...\n");

	olen = sizeof(of);
	if (getsockopt(dd, SOL_HCI, HCI_FILTER, &of, &olen) < 0) {
		printf("Could not get socket options\n");
		goto done;
	}

	hci_filter_clear(&nf);
	hci_filter_set_ptype(HCI_EVENT_PKT, &nf);
	hci_filter_set_event(EVT_LE_META_EVENT, &nf);

	if (setsockopt(dd, SOL_HCI, HCI_FILTER, &nf, sizeof(nf)) < 0) {
		printf("Could not set socket options\n");
		goto done;
	}

	memset(&sa, 0, sizeof(sa));
	sa.sa_flags = SA_NOCLDSTOP;
	sa.sa_handler = sigint_handler;
	sigaction(SIGINT, &sa, NULL);

	while (timeout > 0) {
		evt_le_meta_event *meta;
		le_advertising_info *info;
		char addr[DEVICE_ADDR_LEN];
		char name[DEVICE_NAME_LEN];

		curr_time = time(NULL);
		running_time = difftime(curr_time, start_time);

		if (running_time > timeout)
			goto done;

		memset(name, 0, sizeof(name));
		memset(addr, 0, sizeof(addr));
		memset(buf, 0, sizeof(buf));

		pollfd.fd = dd;
		pollfd.events = POLLIN;

		poll_ret = poll(&pollfd, 1, (timeout - running_time)*1000);
		if (poll_ret < 0) {
			printf("poll hci dev error\n");
			goto done;
		} else if (poll_ret == 0) {
			/* poll timeout */
			goto done;
		} else {
			if (pollfd.revents & POLLIN) {
				while ((read(dd, buf, sizeof(buf))) < 0) {
					if (errno == EINTR && signal_received == SIGINT)
						goto done;

					if (errno == EAGAIN || errno == EINTR)
						continue;

					goto done;
				}
			}
		}

		ptr = buf + (1 + HCI_EVENT_HDR_SIZE);
		meta = (void *) ptr;

		if (meta->subevent != EVT_LE_ADVERTISING_REPORT)
			goto done;

		/* Ignoring multiple reports */
<b>		info = (le_advertising_info *) (meta->data + 1);

		ba2str(&info->bdaddr, addr);
		if (parse_ip_service(info->data, info->length, name, sizeof(name) - 1)) {
			DEBUG_PRINT("Found IPSP supported device %s %s\n", name, addr);
			memcpy(dev_name, name, sizeof(name));
			memcpy(dev_addr, addr, sizeof(addr));
</b>			if (use_whitelist && (check_whitelist(addr) == false)) {
				/* Nothing to do. Check whitelist for next entry. */
			} else {
				scan_ret = true;
				break;
			}
		} else {
			DEBUG_PRINT("IPSP not supported device %s %s\n", name, addr);
		}
	}

done:
	setsockopt(dd, SOL_HCI, HCI_FILTER, &of, sizeof(of));
	err = hci_le_set_scan_enable(dd, 0x00, filter_dup, 10000);
	if (err < 0) {
		perror("Disable scan failed");
		scan_ret = false;
	}

	return scan_ret;
}
Personal tools
Namespaces

Variants
Actions
Navigation
Tools