Modify

Opened 10 years ago

Closed 8 years ago

Last modified 4 years ago

#2539 closed defect (obsolete)

hcid fails to read /etc/bluetooth/givepin - pairing doesn't work

Reported by: loswillios Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Kamikaze trunk
Keywords: bluez bluetooth pairing Cc:

Description

I can't connect my mobile phone with openwrt via bluetooth. In the default configuration hcid fails with some weird error:

root@router:~# hcid -n -f /etc/bluetooth/hcid.conf 
hcid[2029]: Bluetooth HCI daemon
hcid[2029]: Can't open PIN file /etc/bluetooth/pin: No such file or directory (2)
hcid[2029]: Starting security manager 0
options {
[...]
	# PIN helper
	pin_helper /etc/bluetooth/givepin;
}

When I copy givepin to pin, it doesn't complain but I can't pair with my mobile. I can see my router but pairing fails. It does something though:

root@router:/etc/bluetooth# hcid -n -f /etc/bluetooth/hcid.conf        
hcid[2044]: Bluetooth HCI daemon
hcid[2044]: Starting security manager 0
hcid[2044]: Exit.
root@router:/etc/bluetooth# strace hcid -n -f /etc/bluetooth/hcid.conf 
execve("/usr/sbin/hcid", ["hcid", "-n", "-f", "/etc/bluetooth/hcid.conf"], [/* 9 vars */]) = 0
svr4_syscall()                          = -1 ERRNO_4090 (Unknown error 4090)
stat("/etc/ld.so.cache", 0x7fae2ac8)    = -1 ENOENT (No such file or directory)
open("/lib/libbluetooth.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/libbluetooth.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/libbluetooth.so.1", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=73006, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaae000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\3003\0"..., 4096) = 4096
old_mmap(NULL, 335872, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaed000
old_mmap(0x2aaed000, 69060, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2aaed000
old_mmap(0x2ab3e000, 3374, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x11000) = 0x2ab3e000
close(3)                                = 0
munmap(0x2aaae000, 4096)                = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=60758, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaae000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\200\31"..., 4096) = 4096
old_mmap(NULL, 323584, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab3f000
old_mmap(0x2ab3f000, 58652, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2ab3f000
old_mmap(0x2ab8d000, 3414, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xe000) = 0x2ab8d000
close(3)                                = 0
munmap(0x2aaae000, 4096)                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=389947, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaae000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\200\272"..., 4096) = 4096
old_mmap(NULL, 671744, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ab8e000
old_mmap(0x2ab8e000, 385348, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2ab8e000
old_mmap(0x2ac2c000, 4923, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x5e000) = 0x2ac2c000
old_mmap(0x2ac2e000, 16088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2ac2e000
close(3)                                = 0
munmap(0x2aaae000, 4096)                = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=60758, ...}) = 0
close(3)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=389947, ...}) = 0
close(3)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=389947, ...}) = 0
close(3)                                = 0
ioctl(0, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0
uname({sys="Linux", node="router", ...}) = 0
brk(0)                                  = 0x44b000
brk(0x44c000)                           = 0x44c000
umask(077)                              = 022
socket(PF_FILE, SOCK_DGRAM, 0)          = 3
connect(3, {sa_family=AF_FILE, path="/dev/log"}, 10) = 0
rt_sigaction(SIGPIPE, {SIG_DFL}, {SIG_DFL}, 16) = 0
time([1192406152])                      = 1192406152
open("/etc/TZ", O_RDONLY)               = 4
read(4, "CET-1CEST-2,M3.5.0/02:00:00,M10."..., 68) = 45
read(4, "", 23)                         = 0
close(4)                                = 0
getpid()                                = 2050
write(2, "hcid[2050]: Bluetooth HCI daemon"..., 33hcid[2050]: Bluetooth HCI daemon
) = 33
write(3, "<30>Oct 15 01:55:52 hcid[2050]: "..., 53) = 53
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 16) = 0
rt_sigaction(SIGTERM, {SIG_IGN}, NULL, 16) = 0
rt_sigaction(SIGINT, {SIG_IGN}, NULL, 16) = 0
rt_sigaction(SIGHUP, {SIG_IGN}, NULL, 16) = 0
rt_sigaction(SIGUSR1, {SIG_IGN}, NULL, 16) = 0
rt_sigaction(SIGUSR2, {SIG_IGN}, NULL, 16) = 0
rt_sigaction(SIGCHLD, {SIG_IGN}, NULL, 16) = 0
rt_sigaction(SIGPIPE, {SIG_IGN}, NULL, 16) = 0
socket(PF_BLUETOOTH, SOCK_RAW, 1)       = 4
setsockopt(4, SOL_IP, IP_TTL, "\20\0\0\0\0\0\0\0\0\0\0 \0\0\0\0", 16) = 0
bind(4, {sa_family=AF_BLUETOOTH, sa_data="\377\377\20\0\0\0\0\0\0\0\0\0\0 "}, 4) = 0
open("/etc/bluetooth/hcid.conf", O_RDONLY) = 5
ioctl(5, TIOCNXCL, 0x7fae2bb0)          = -1 ENOTTY (Inappropriate ioctl for device)
brk(0x44d000)                           = 0x44d000
brk(0x451000)                           = 0x451000
ioctl(5, TIOCNXCL, 0x7fae2668)          = -1 ENOTTY (Inappropriate ioctl for device)
read(5, "#\n# HCI daemon configuration fil"..., 8192) = 1340
read(5, "", 6852)                       = 0
ioctl(5, TIOCNXCL, 0x7fae2668)          = -1 ENOTTY (Inappropriate ioctl for device)
close(5)                                = 0
open("/etc/bluetooth/pin", O_RDONLY)    = 5
ioctl(5, TIOCNXCL, 0x7fae2b88)          = -1 ENOTTY (Inappropriate ioctl for device)
read(5, "#!/bin/sh\n\n# Write bluetooth PIN"..., 4096) = 232
close(5)                                = 0
ioctl(4, 0x400448d2, 0x44b1b8)          = 0
fork()                                  = 2051
fork()                                  = 2052
rt_sigaction(SIGPIPE, {SIG_DFL}, {SIG_IGN}, 16) = 0
time([1192406152])                      = 1192406152
open("/etc/TZ", O_RDONLY)               = 5
read(5, "CET-1CEST-2,M3.5.0/02:00:00,M10."..., 68) = 45
read(5, "", 23)                         = 0
close(5)                                = 0
getpid()                                = 2050
write(2, "hcid[2050]: Starting security ma"..., 40hcid[2050]: Starting security manager 0
) = 40
write(3, "<30>Oct 15 01:55:52 hcid[2050]: "..., 60) = 60
rt_sigaction(SIGPIPE, {SIG_IGN}, NULL, 16) = 0
socket(PF_BLUETOOTH, SOCK_RAW, 1)       = 5
bind(5, {sa_family=AF_BLUETOOTH, sa_data="\0\0@&\256\177\274\261D\0\270\261D\0"}, 4) = 0
setsockopt(5, SOL_IP, IP_TTL, "\20\0\0\0\356\330\340\1\4\200\0\0\0\0\0\0", 16) = 0
ioctl(5, 0x400448d3, 0x44b240)          = 0
writev(5, [{"\1", 1}, {"\r\f\7", 3}, {"\0\0\0\0\0\0\1", 7}], 3) = 11
getrlimit(RLIMIT_NOFILE, {rlim_cur=1024, rlim_max=1024}) = 0
brk(0x453000)                           = 0x453000
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN|POLLERR|POLLHUP|POLLNVAL, revents=POLLIN}], 2, -1) = 1
read(5, "\4\16\10\1\r\f\0\20\0\0\0", 260) = 11
ioctl(5, 0x400448d3, 0x44b240)          = 0
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN|POLLERR|POLLHUP|POLLNVAL, revents=POLLIN}], 2, -1) = 1
read(5, "\4\17\4\0\1\t\4", 260)         = 7
ioctl(5, 0x400448d3, 0x44b240)          = 0
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN|POLLERR|POLLHUP|POLLNVAL, revents=POLLIN}], 2, -1) = 1
read(5, "\4\3\v\0)\0\367`Km\16\0\1\0", 260) = 14
ioctl(5, 0x400448d3, 0x44b240)          = 0
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN|POLLERR|POLLHUP|POLLNVAL, revents=POLLIN}], 2, -1) = 1
read(5, "\4\17\4\0\0\33\4", 260)        = 7
ioctl(5, 0x400448d3, 0x44b240)          = 0
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN|POLLERR|POLLHUP|POLLNVAL, revents=POLLIN}], 2, -1) = 1
read(5, "\4\17\4\0\1\0\0", 260)         = 7
ioctl(5, 0x400448d3, 0x44b240)          = 0
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN|POLLERR|POLLHUP|POLLNVAL, revents=POLLIN}], 2, -1) = 1
read(5, "\4\16\6\1\r\10\0)\0", 260)     = 9
ioctl(5, 0x400448d3, 0x44b240)          = 0
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN|POLLERR|POLLHUP|POLLNVAL, revents=POLLIN}], 2, -1) = 1
read(5, "\4\17\4\0\1\17\4", 260)        = 7
ioctl(5, 0x400448d3, 0x44b240)          = 0
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN|POLLERR|POLLHUP|POLLNVAL, revents=POLLIN}], 2, -1) = 1
read(5, "\4\v\v\0)\0\277(!\0\0\0\0\0", 260) = 14
ioctl(5, 0x400448d3, 0x44b240)          = 0
socket(PF_BLUETOOTH, SOCK_RAW, 1)       = 7
ioctl(7, 0x400448d2, 0x44b378)          = 0
ioctl(7, 0x400448d3, 0x7fae2870)        = 0
close(7)                                = 0
ioctl(5, 0x400448d4, 0x44b2d0)          = 0
umask(022)                              = 077
stat("/var/lib/bluetooth/00:02:72:03:40:D9/features", {st_mode=S_IFREG|0644, st_size=35, ...}) = 0
open("/var/lib/bluetooth/00:02:72:03:40:D9/features", O_RDWR|O_CREAT, 0644) = 7
close(7)                                = 0
open("/var/lib/bluetooth/00:02:72:03:40:D9/features", O_RDWR) = 7
flock(7, LOCK_EX)                       = 0
fstat(7, {st_mode=S_IFREG|0644, st_size=35, ...}) = 0
old_mmap(NULL, 35, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_LOCKED, 7, 0) = 0x2aaae000
munmap(0x2aaae000, 35)                  = 0
ftruncate(7, 0)                         = 0
lseek(7, 0, SEEK_SET)                   = 0
write(7, "00:0E:6D:4B:60:F7 BF282100000000"..., 35) = 35
flock(7, LOCK_UN)                       = 0
close(7)                                = 0
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN|POLLERR|POLLHUP|POLLNVAL, revents=POLLIN}], 2, -1) = 1
read(5, "\4\5\4\0)\0\23", 260)          = 7
ioctl(5, 0x400448d3, 0x44b240)          = 0
poll(

In /var/lib/bluetooth/00\:02\:72\:03\:40\:D9/names I can see my mobile.

This is Kamikaze 7.09 on a WGT634U.

I've added a patch to update bluez-{libs,utils} to 2.25. Behavior doesn't change though :/

Attachments (1)

bluez-2.25.patch (1.1 KB) - added by loswillios 10 years ago.
update bluez-{libs,utils} to 2.25

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by loswillios

update bluez-{libs,utils} to 2.25

comment:1 Changed 8 years ago by thepeople

  • Resolution set to obsolete
  • Status changed from new to closed
  • Version set to Kamikaze trunk

comment:2 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.