takawata / FreeBSD-BLE

17 stars 9 forks source link

FreeBSD 12 and BLE #1

Open sparvu opened 5 years ago

sparvu commented 5 years ago

Hi,

Can we use BLE on FreeBSD 12 x64/arm64(raspberry pi) ? If yes is there any howto or README how to get started ?

Im trying to connect a BLE device like Airthings Radon sensor to a raspberry pi 3b+, running fbsd12.

sparvu commented 4 years ago

Should I try as well another BLE 4.0 USB dongle ?

takawata commented 4 years ago

Probably your dongle works correctly. If your device address is correct, are you sure to add -r option to specify random address?

sparvu commented 4 years ago

iPhone XS Max

This is what I get trying to search with my iphone and a Bluetooth scanner the devices near by:

IMG_2A008562DE2D-1

Note: the iphione is capable to discover lot more devices and more accurately than the FreeBSD.

And this is what I get from my Raspberry PI FreeBSD 12.1

FreeBSD 12.1 RBPI3B+

root@generic:~ # hccontrol read_neighbor_cache
T BD_ADDR           Features                Clock offset Page scan Rep. scan
P e0:7d:ea:07:1c:c7 00 00 00 00 00 00 00 00            0      0xaf         0
NDflag:6
Type17:06 ba 5c f7 
Type59:12 d3 89 e4 11 e7 ad 08 1c 2e b4 09 ff 34 03 58 94 a4 ae 08 00
sparvu commented 4 years ago

It seems that this might be a Airthings Wave+ device based on '34 03 58 94 a4 ae 08 00' . Right ?

Now trying to connect to this device results in nothing ...

root@generic:/home/freebsd/FreeBSD-BLE/lehid # ./lehid -r e0:7d:ea:07:1c:c7
CONNECT
connect: Operation timed out
CONNECTOK
no more rows available
Broken pipe

I used the BD_ADDR e0:7d:ea:07:1c:c7

sparvu commented 4 years ago

Another strange thing is after I restart the Bluetooth services I see totally different devices reported by read_neighbor_cache

root@generic:/home/freebsd/FreeBSD-BLE/lehid # hccontrol read_neighbor_cache
T BD_ADDR           Features                Clock offset Page scan Rep. scan
R 2f:22:48:28:09:20 00 00 00 00 00 00 00 00            0      0xad         0
NDflag:1b
Type11:ff 4c 00 09 06 03 1a c0 a8 01 b0 
sparvu commented 4 years ago

from syslog I see as well these:

ng_hci_process_command_complete: ubt0hci - HCI command failed, OGF=0x8, OCF=0xc, status=0xc
ng_hci_process_command_complete: ubt0hci - HCI command failed, OGF=0x8, OCF=0xc, status=0xc
ubt0: ubt_intr_read_callback:1004: interrupt transfer failed: USB_ERR_IOERROR
ubt0: ubt_bulk_read_callback:1103: bulk-in transfer failed: USB_ERR_IOERROR
sparvu commented 4 years ago

I have tried as well with the Bluetooth stick inserted to reboot my RBPI and check status after a clean reboot. These are reported after reboot:

uhub0: 1 port with 1 removable, self powered
ugen0.2: <vendor 0x0424 product 0x2514> at usbus0
uhub1 on uhub0
uhub1: <vendor 0x0424 product 0x2514, class 9/0, rev 2.00/b.b3, addr 2> on usbus0
uhub1: MTT enabled
uhub1: 4 ports with 3 removable, self powered
lo0: link state changed to UP
ugen0.3: <vendor 0x0424 product 0x2514> at usbus0
uhub2 on uhub1
uhub2: <vendor 0x0424 product 0x2514, class 9/0, rev 2.00/b.b3, addr 3> on usbus0
uhub2: MTT enabled
uhub2: 3 ports with 2 removable, self powered
ugen0.4: <vendor 0x0424 product 0x7800> at usbus0
muge0 on uhub2
muge0: <vendor 0x0424 product 0x7800, rev 2.10/3.00, addr 4> on usbus0
muge0: Chip ID 0x7800 rev 0002
miibus0: <MII bus> on muge0
ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto
ue0: <USB Ethernet> on muge0
ue0: Ethernet address: b8:27:eb:5a:3c:98
ugen0.5: <vendor 0x0a12 product 0x0001> at usbus0
ue0: link state changed to UP
muge0: Chip ID 0x7800 rev 0002
ue0: link state changed to DOWN
ue0: link state changed to UP
ubt0 on uhub1
ubt0: <vendor 0x0a12 product 0x0001, class 224/1, rev 2.00/75.58, addr 5> on usbus0
WARNING: attempt to domain_add(bluetooth) after domainfinalize()
WARNING: attempt to domain_add(netgraph) after domainfinalize()
ubt0: ubt_bulk_read_callback:1103: bulk-in transfer failed: USB_ERR_IOERROR
ubt0: ubt_bulk_read_callback:1103: bulk-in transfer failed: USB_ERR_IOERROR

but now I can see more devices !?

root@generic:~ # hccontrol  read_neighbor_cache
T BD_ADDR           Features                Clock offset Page scan Rep. scan
P a4:da:32:46:cd:31 00 00 00 00 00 00 00 00            0      0x9c         0
NDflag:6
Type17:06 ba 5c f7 
Type59:12 d3 89 e4 11 e7 ad 08 1c 2e b4 09 ff 34 03 00 96 a4 ae 08 00 

P e0:7d:ea:07:1c:c7 00 00 00 00 00 00 00 00            0      0xa7         0
NDflag:6
Type17:06 ba 5c f7 
Type59:12 d3 89 e4 11 e7 ad 08 1c 2e b4 09 ff 34 03 58 94 a4 ae 08 00 

P dc:56:e7:38:d6:35 00 00 00 00 00 00 00 00            0      0x9d         0
NDflag:1a
Type2:0a 0c 0a ff 4c 00 10 05 01 14 0c c9 79 

R 2f:22:48:28:09:20 00 00 00 00 00 00 00 00            0      0x9e         0
NDflag:1b
Type11:ff 4c 00 09 06 03 1a c0 a8 01 b0 
sparvu commented 4 years ago

And again I cannot fetch any info from any BLE devices around. I think these are my AirWave + devices:

T BD_ADDR           Features                Clock offset Page scan Rep. scan
P a4:da:32:46:cd:31 00 00 00 00 00 00 00 00            0      0x9c         0
NDflag:6
Type17:06 ba 5c f7 
Type59:12 d3 89 e4 11 e7 ad 08 1c 2e b4 09 ff 34 03 00 96 a4 ae 08 00 

P e0:7d:ea:07:1c:c7 00 00 00 00 00 00 00 00            0      0xa7         0
NDflag:6
Type17:06 ba 5c f7 
Type59:12 d3 89 e4 11 e7 ad 08 1c 2e b4 09 ff 34 03 58 94 a4 ae 08 00 

There are no any random addresses. So I tried to connect using lehid using the BT_ADDR but with no success.

root@generic:/home/freebsd/FreeBSD-BLE/lehid # ./lehid e0:7d:ea:07:1c:c7
CONNECT
connect: Operation timed out
CONNECTOK
no more rows available
Broken pipe

root@generic:/home/freebsd/FreeBSD-BLE/lehid # ./lehid  a4:da:32:46:cd:31
CONNECT
connect: Operation timed out
CONNECTOK
no more rows available
Broken pipe

I have ordered two more devices to try with FreeBSD 12.1 since I really want to make this working using the FreeBSD and not Linux.

https://www.amazon.co.uk/gp/product/B0126XU9CM/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

https://www.amazon.co.uk/gp/product/B01MR3BH4G/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

sparvu commented 4 years ago

Why this command does not return anything:

# hccontrol -n ubt0hci inquiry
Inquiry complete. Status: No error [00]

but this returns:

# hccontrol read_neighbor_cache
T BD_ADDR           Features                Clock offset Page scan Rep. scan
R 4f:cc:8f:71:11:36 00 00 00 00 00 00 00 00            0      0x9d         0
NDflag:1a
Type2:0a 0c 0b ff 4c 00 10 06 13 1e 8c 7e aa 8e 

P dc:56:e7:38:d6:35 00 00 00 00 00 00 00 00            0      0x9b         0
NDflag:1a
Type2:0a 0c 0a ff 4c 00 10 05 01 14 0c c9 79 

P f4:5c:89:a6:15:98 00 00 00 00 00 00 00 00            0      0xa4         0
NDflag:6
Type10:ff 4c 00 10 
Type75:1c 38 b7 

R 2f:22:48:28:09:20 00 00 00 00 00 00 00 00            0      0x9b         0
NDflag:1b
Type11:ff 4c 00 09 06 03 1d c0 a8 01 b0 

P a4:da:32:46:cd:31 00 00 00 00 00 00 00 00            0      0x9b         0
NDflag:6
Type17:06 ba 5c f7 
Type59:12 d3 89 e4 11 e7 ad 08 1c 2e b4 09 ff 34 03 00 96 a4 ae 08 00 

P e0:7d:ea:07:1c:c7 00 00 00 00 00 00 00 00            0      0xa1         0
NDflag:6
Type17:06 ba 5c f7 
Type59:12 d3 89 e4 11 e7 ad 08 1c 2e b4 09 ff 34 03 58 94 a4 ae 08 00 

R 61:59:1e:f7:5e:f4 00 00 00 00 00 00 00 00            0      0xa4         0
NDflag:6
Type19:ff 4c 00 0c 
Type8:0d 77 01 db 9b 71 0e de e8 01 73 ca 
sparvu commented 4 years ago

unfortunately I cant make progress using this model of USB dongle and BLE devices on FreeBSD. I will wait for the new devices to see if there are any differences.

sparvu commented 4 years ago

some success. It seems I should have compiled first le_enable and run against the BT_ADDR. Take a look:

root@generic:/home/freebsd/FreeBSD-BLE/le_enable # ./le_enable a4:da:32:46:cd:31
SET EVENT MASK0 0
LE_EVENT_MASK 0 0
READ_LE_BUFFER_SIZE 0 0 0 0
READ BUFFER SIZE 0 0 310 64 10 8 
LOCAL SUPPOREDED:0 0 1
SCANTYPE0 INTERVAL18 ADDRTYPE0 WINDOW18 POLICY0
SCAN_PARAM 0 0 1
SEt SCAN RESPONSE 0 0 1
LE_STATUS:0 0 1f3fffff
SCAN ENABLE0 0 1
START SCANNING
HOGEHOGE
SCAN_RESULT 3e 1d
Subevent  2
NumRecord 1
Eventtype 0
AddrType 0
Addr:[dc:56:e7:38:d6:35]
length_data 17
DATA:
02 01 1a 
02 0a 0c 
0a ff 4c 00 10 05 01 14 0c c9 79 
RSSI: ae (174 db)
SCAN ENABLE0 0 1
CONNECT
CONNECTOK
MTU 247
FIND_INFO
UIDS:0001:2800 0002:2803 0003:2a00 0004:2803 0005:2a01 0006:2803 0007:2a04 0008:2803 0009:2ac9 
FIND_INFO
UIDS:000a:2800 000b:2800 000c:2803 
FIND_INFO
000d:UUID128
0d 00 ba 5c f7 93 3b 12 d3 89 e4 11 e7 ad 68 2a 2e b4 
FIND_INFO
UIDS:000e:2901 000f:2803 
FIND_INFO
0010:UUID128
10 00 ba 5c f7 93 3b 12 d3 89 e4 11 e7 ad 06 2d 2e b4 
FIND_INFO
UIDS:0011:2901 0012:2902 0013:2803 
FIND_INFO
0014:UUID128
14 00 ba 5c f7 93 3b 12 d3 89 e4 11 e7 ad c2 2f 2e b4 
FIND_INFO
UIDS:0015:2901 0016:2902 0017:2800 0018:2803 
FIND_INFO
0019:UUID128
19 00 00 00 00 00 00 00 00 b0 00 40 51 04 c1 ff 00 f0 
FIND_INFO
UIDS:001a:2902 001b:2901 001c:2803 
FIND_INFO
001d:UUID128
1d 00 00 00 00 00 00 00 00 b0 00 40 51 04 c2 ff 00 f0 
FIND_INFO
UIDS:001e:2902 001f:2901 0020:2803 
FIND_INFO
0021:UUID128
21 00 00 00 00 00 00 00 00 b0 00 40 51 04 c5 ff 00 f0 
FIND_INFO
UIDS:0022:2902 0023:2901 0024:2800 0025:2803 0026:2a23 0027:2803 0028:2a24 0029:2803 002a:2a25 
FIND_INFO
UIDS:002b:2803 002c:2a26 002d:2803 002e:2a27 002f:2803 0030:2a29 
FIND_INFO
OP 4: Handle 0031 CODE a
HANDLE 1 Permission: 2
00 18 
primary service GAP
HANDLE 2 Permission: 2
02 03 00 00 2a 
permission 2 handle 3 char 2a00
HANDLE 3 Permission: 2
41 69 72 74 68 69 6e 67 73 20 57 61 76 65 2b 
Device Name: Airthings Wave+
HANDLE 4 Permission: 2
02 05 00 01 2a 
permission 2 handle 5 char 2a01
HANDLE 5 Permission: 2
00 00 
characteristic: 2a01
HANDLE 6 Permission: 2
02 07 00 04 2a 
permission 2 handle 7 char 2a04
HANDLE 7 Permission: 2
50 00 a0 00 00 00 e8 03 
characteristic: 2a04
HANDLE 8 Permission: 2
02 09 00 c9 2a 
permission 2 handle 9 char 2ac9
HANDLE 9 Permission: 2
OP a: Handle 0009 CODE 1
characteristic: 2ac9
HANDLE a Permission: 2
01 18 
primary service GATT
HANDLE b Permission: 2
ba 5c f7 93 3b 12 d3 89 e4 11 e7 ad 08 1c 2e b4 
primary service 5cba
HANDLE c Permission: 2
02 0d 00 ba 5c f7 93 3b 12 d3 89 e4 11 e7 ad 68 2a 2e b4 
permission 2 handle d char 5cba
HANDLE e Permission: 0
53 65 6e 73 6f 72 20 43 75 72 72 65 6e 74 20 56 61 6c 
characteristic: 2901
HANDLE f Permission: 2
2c 10 00 ba 5c f7 93 3b 12 d3 89 e4 11 e7 ad 06 2d 2e b4 
permission 2c handle 10 char 5cba
HANDLE 11 Permission: 0
41 63 63 65 73 73 20 43 6f 6e 74 72 6f 6c 20 50 6f 69 6e 74 
characteristic: 2901
HANDLE 12 Permission: 0
00 00 
characteristic: 2902
HANDLE 13 Permission: 2
10 14 00 ba 5c f7 93 3b 12 d3 89 e4 11 e7 ad c2 2f 2e b4 
permission 10 handle 14 char 5cba
HANDLE 15 Permission: 0
53 65 6e 73 6f 72 20 52 65 63 6f 72 64 
characteristic: 2901
HANDLE 16 Permission: 0
00 00 
characteristic: 2902
HANDLE 17 Permission: 2
00 00 00 00 00 00 00 b0 00 40 51 04 c0 ff 00 f0 
primary service 0
HANDLE 18 Permission: 2
1c 19 00 00 00 00 00 00 00 00 b0 00 40 51 04 c1 ff 00 f0 
permission 1c handle 19 char 0
HANDLE 1a Permission: 0
00 00 
characteristic: 2902
HANDLE 1b Permission: 0
49 6d 67 20 49 64 65 6e 74 69 66 79 
characteristic: 2901
HANDLE 1c Permission: 2
1c 1d 00 00 00 00 00 00 00 00 b0 00 40 51 04 c2 ff 00 f0 
permission 1c handle 1d char 0
HANDLE 1e Permission: 0
00 00 
characteristic: 2902
HANDLE 1f Permission: 0
49 6d 67 20 42 6c 6f 63 6b 
characteristic: 2901
HANDLE 20 Permission: 2
14 21 00 00 00 00 00 00 00 00 b0 00 40 51 04 c5 ff 00 f0 
permission 14 handle 21 char 0
HANDLE 22 Permission: 0
00 00 
characteristic: 2902
HANDLE 23 Permission: 0
4f 41 44 20 45 78 74 65 6e 64 65 64 20 43 6f 6e 74 72 6f 6c 
characteristic: 2901
HANDLE 24 Permission: 2
0a 18 
primary service DIS
HANDLE 25 Permission: 2
02 26 00 23 2a 
permission 2 handle 26 char 2a23
HANDLE 26 Permission: 2
31 cd 46 00 00 32 da a4 
characteristic: 2a23
HANDLE 27 Permission: 2
02 28 00 24 2a 
permission 2 handle 28 char 2a24
HANDLE 28 Permission: 2
32 39 33 30 
characteristic: 2a24
HANDLE 29 Permission: 2
02 2a 00 25 2a 
permission 2 handle 2a char 2a25
HANDLE 2a Permission: 2
30 32 31 38 38 38 
characteristic: 2a25
HANDLE 2b Permission: 2
02 2c 00 26 2a 
permission 2 handle 2c char 2a26
HANDLE 2c Permission: 2
47 2d 42 4c 45 2d 31 2e 32 2e 34 
Firmware Revision: G-BLE-1.2.4
HANDLE 2d Permission: 2
02 2e 00 27 2a 
permission 2 handle 2e char 2a27
HANDLE 2e Permission: 2
31 2e 30 
characteristic: 2a27
HANDLE 2f Permission: 2
02 30 00 29 2a 
permission 2 handle 30 char 2a29
HANDLE 30 Permission: 2
41 69 72 74 68 69 6e 67 73 20 41 53 
Manifacturare name: Airthings AS
sparvu commented 4 years ago

Then I tried lepair:

root@generic:/home/freebsd/FreeBSD-BLE/lepair # ./lepair a4:da:32:46:cd:31
CONNECT
connect: Operation now in progress
0
SubEvent0
1
Connection Event:Status0, handle40, role0, address_type:0
a4:da:32:46:cd:31 15 0 32768 12
handle28
HOGEHOGE
7, pi.code 2
C
CODE:2 IOCAP 0 0 13 16 1 1(7)
1
00:15:83:d1:e0:83
PIN requested:
0000
PIN:0 0
17
17
a9:a9,5d:5d,aa:aa,34:34,16:16,ec:ec,ea:ea,69:69,f7:f7,18:18,b6:b6,3a:3a,e5:e5,d9:d9,34:34,f8:f8,LE_ENC OK
6
1 0
7
1 1
EDIV:e66b 
RAND: fd06b9167e2525d8
KEY0xde, 0x61, 0x80, 0x0d, 0xb6, 0x34, 0xcb, 0xc0, 0xf0, 0xb5, 0x68, 0xf7, 0x07, 0xc2, 0x00, 0xc9, 

bloody well, it worked ?

sparvu commented 4 years ago

then I tried lehid:

root@generic:/home/freebsd/FreeBSD-BLE/lehid # ./lehid a4:da:32:46:cd:31
CONNECT
CONNECTOK
no more rows available
OP 4: Handle 0031 CODE a
UPDATE ble_service SET high_attribute_id=(SELECT max(attribute_id) from ble_attribute) WHERE (service_id = (SELECT max(service_id) FROM ble_service) AND device_id = (SELECT max(device_id) FROM ble_device));
0 1
00 18 
0 10
01 18 
0 11
ba 5c f7 93 3b 12 d3 89 e4 11 e7 ad 08 1c 2e b4 
0 23
00 00 00 00 00 00 00 b0 00 40 51 04 c0 ff 00 f0 
0 36
0a 18 
0x40c8bac8 0x40ca3188
1 2
0 2
02 03 00 00 2a 
2 4
0 4
02 05 00 01 2a 
3 6
0 6
02 07 00 04 2a 
4 8
0 8
02 09 00 c9 2a 
5 12
0 12
02 0d 00 ba 5c f7 93 3b 12 d3 89 e4 11 e7 ad 68 2a 2e b4 
6 15
0 15
2c 10 00 ba 5c f7 93 3b 12 d3 89 e4 11 e7 ad 06 2d 2e b4 
7 19
0 19
10 14 00 ba 5c f7 93 3b 12 d3 89 e4 11 e7 ad c2 2f 2e b4 
8 24
0 24
1c 19 00 00 00 00 00 00 00 00 b0 00 40 51 04 c1 ff 00 f0 
9 28
0 28
1c 1d 00 00 00 00 00 00 00 00 b0 00 40 51 04 c2 ff 00 f0 
10 32
0 32
14 21 00 00 00 00 00 00 00 00 b0 00 40 51 04 c5 ff 00 f0 
11 37
0 37
02 26 00 23 2a 
12 39
0 39
02 28 00 24 2a 
13 41
0 41
02 2a 00 25 2a 
14 43
0 43
02 2c 00 26 2a 
15 45
0 45
02 2e 00 27 2a 
16 47
0 47
02 30 00 29 2a 
PROBE_INCLUDE
0x40c83788 0x40ca3188
GAP:1
0 3
41 69 72 74 68 69 6e 67 73 20 57 61 76 65 2b 
Device Name  Airthings Wave+
0 5
00 00 
Apperance  0
0 7
50 00 a0 00 00 00 e8 03 
Connection Parameters 80 160 0
ID2: 00001801-0000-1000-8000-00805f9b34fb
ID3: b42e1c08-ade7-11e4-89d3-123b93f75cba
5 b42e2a68-ade7-11e4-89d3-123b93f75cba
6 b42e2d06-ade7-11e4-89d3-123b93f75cba
7 b42e2fc2-ade7-11e4-89d3-123b93f75cba
ID4: f000ffc0-0451-4000-b000-000000000000
8 f000ffc1-0451-4000-b000-000000000000
9 f000ffc2-0451-4000-b000-000000000000
a f000ffc5-0451-4000-b000-000000000000
DIS:5
0 38
31 cd 46 00 00 32 da a4 
SystemID 31cd4600 32daa4
0 40
32 39 33 30 
Model No 2930
0 42
30 32 31 38 38 38 
Serial Number 021888
0 44
47 2d 42 4c 45 2d 31 2e 32 2e 34 
Model Number G-BLE-1.2.4
0 46
31 2e 30 
Hardware Revision 1.0
0 48
41 69 72 74 68 69 6e 67 73 20 41 53 
Manifacture Name Airthings AS
^C
sdalu commented 4 years ago

I tried to follow your progress... But for me, I got a core dump:

root@rork:~/FreeBSD-BLE/le_enable # ./le_enable ff:1f:0a:3d:5a:c8
SET EVENT MASK0 0
LE_EVENT_MASK 0 0
READ_LE_BUFFER_SIZE 0 0 0 0
READ BUFFER SIZE 0 0 310 64 10 8 
LOCAL SUPPOREDED:0 0 1
SCANTYPE0 INTERVAL18 ADDRTYPE0 WINDOW18 POLICY0
SCAN_PARAM 0 0 1
SEt SCAN RESPONSE 0 0 1
LE_STATUS:0 0 1fffffff
Assertion failed: (*rp_size > 0), function hci_request, file send_recv.c, line 54.
Abort (core dumped)
sparvu commented 4 years ago

@sdalu: what device are you using ?

takawata commented 4 years ago

@sparvu your device works fine, then you may want to write driver to receive information. lepair is pairing tool for Security Manager Protocol. So if it does not support Security Manager Protocol, it will not respond.

takawata commented 4 years ago

lepair also works. it seems. You may want to add following entry on hcsecd.conf device { bdaddr a4:da:32:46:cd:31; addrtype lepub; ediv 0xe66b; rand 0xfd06b9167e2525d8; key 0xde61800db634cbc0f0b568f707c200c9; pin nopin; } and start lesecd . then use lehid with -s option. Then lesecd will respond on BLE connect and lehid will wait until the lesecd negotiate the key.

sdalu commented 4 years ago

@sparvu I'm using CSR8510 A10, I've also got an ASUS BT400 in stock. I'm on FreeBSD 12.0, trying to upgrade to 12.1 to see if things improve

takawata commented 4 years ago

ff:1f:0a:3d:5a:c8 ? It may be random address.(not valid public IEEE OUI, I think) Do you try lehid with -r option? le_enable is simply crude earlier version of lehid. Enabling bluetooth le itself is now done by stock hccontrol with le_enable subcommand.

sparvu commented 4 years ago

@sdalu: Raspberry PI 3B(aarch64) or AMD64 ? Take a stack trace on the crash using gdb if you have a core dump.

sparvu commented 4 years ago

@takawata: thanks. I am doing more tests. Then I should figure out how on earth I will get data from these sensors.

sdalu commented 4 years ago

@sparvu I'm on AMD64. Upgrade to 12.1 didn't change, I still have core dump for le_enable

* thread #1, name = 'le_enable.full', stop reason = signal SIGABRT
  * frame #0: 0x00000008006fc53a libc.so.7`__sys_thr_kill at thr_kill.S:3
    frame #1: 0x00000008006fa964 libc.so.7`__raise(s=6) at raise.c:52:10
    frame #2: 0x00000008006756a9 libc.so.7`abort at abort.c:67:8
    frame #3: 0x00000008006ea511 libc.so.7`__assert(func=<unavailable>, file=<unavailable>, line=<unavailable>, failedexpr=<unavailable>) at assert.c:51:2
    frame #4: 0x0000000000205c1e le_enable.full`hci_request(s=0, opcode=-5776, cp=<unavailable>, cp_size=19, rp="", rp_size=0x00007fffffffe9b0) at send_recv.c:54:2
    frame #5: 0x000000000020591f le_enable.full`main [inlined] le_set_scan_enable(s=3, enable=1) at le_enable.c:157:6
    frame #6: 0x00000000002058f2 le_enable.full`main(argc=<unavailable>, argv=<unavailable>) at le_enable.c:940
    frame #7: 0x000000000020310f le_enable.full`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1.c:76:7

Like you I got some error, about Bluetooth stack, but I'm not quite sure yet how I solved this (l'm looking at it). Rebooting for me seems to be a sure way to get:

/etc/rc.d/bluetooth: ERROR: Unable to setup Bluetooth stack for device ubt0
sparvu commented 4 years ago

@sdalu : you need to cp /etc/defaults/bluetooth.device.conf /etc/bluetooth/ubt0.conf in order to be able to stop|start|restart the bluetooth service.

sdalu commented 4 years ago

@sparvu didn't looked for that as I copied it yesterday, but you are right! It has been removed during the upgrade

sdalu commented 4 years ago

@sparvu It seems also to need time... It worked at the 3rd time

root@rork:~ # /etc/rc.d/bluetooth start ubt0
/etc/rc.d/bluetooth: ERROR: Unable to setup Bluetooth stack for device ubt0
root@rork:~ # /etc/rc.d/bluetooth start ubt0
/etc/rc.d/bluetooth: ERROR: Unable to setup Bluetooth stack for device ubt0
root@rork:~ # /etc/rc.d/bluetooth start ubt0