50ButtonsEach / fliclib-linux-dist

114 stars 19 forks source link

"Unable to bind socket" from daemon; no connection #40

Open faceless2 opened 8 years ago

faceless2 commented 8 years ago

I have compiled and installed bluez 5.37 on a Raspberry Pi and I am running "src/bluetoothd -nEd" to start it. Then in another window I run "./daemon -l -f test.sqlite3" (beta 3 build). Both run as root. The output from the "daemon" command is:

Successfully created D-Bus connection
Successfully created D-Bus object manager
Manager: checkObjects
Manager: new adapter, 5C:F3:70:76:C4:A3
Adapter: setProxies
Successfully registered profile
Successfully watching D-Bus
Unable to bind socket

The output from "bluetoothd" in the other window

bluetoothd[688]: Bluetooth daemon 5.37
bluetoothd[688]: src/adapter.c:adapter_init() sending read version command
...
bluetoothd[688]: src/gatt-database.c:manager_register_profile() sender :1.15
bluetoothd[688]: src/gatt-database.c:profile_add() Added ":1.15/org/flic/5C_F3_70_76_C4_A3/f02adfc0-26e7-11e4-9edc-0002a5d5c51b"

In a third window I run "flic" and then type "startScan", then press a button either briefly, or for eight seconds - nothing. I get no further output from bluetoothd or daemon from this point.

There is one USB BT LE adapter plugged in and it's up - output of "hciconfig -a"

hci0:   Type: BR/EDR  Bus: USB
    BD Address: 5C:F3:70:76:C4:A3  ACL MTU: 1021:8  SCO MTU: 64:1
    UP RUNNING 
    RX bytes:2103 acl:0 sco:0 events:118 errors:0
    TX bytes:1811 acl:0 sco:0 commands:110 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: 'BlueZ 5.37'
    Class: 0x400000
    Service Classes: Telephony
    Device Class: Miscellaneous, 
    HCI Version: 4.0 (0x6)  Revision: 0x1000
    LMP Version: 4.0 (0x6)  Subversion: 0x220e
    Manufacturer: Broadcom Corporation (15)

and if I run "hcitool lescan" I can see what I presume are my four buttons.

I have tried both "armv6l" and "armv7l" versions, and now I am at a loss how to proceed further. Which socket is daemon trying to bind to?

fabianbergmark commented 8 years ago

The daemon binds to port TCP port 5000, maybe you have something running on that port?

faceless2 commented 8 years ago

I do indeed. Can this be changed?

fabianbergmark commented 8 years ago

The next release will add this as a command line option. Right now I have my hands full of Android development so it might take a while :(

faceless2 commented 8 years ago

Well I suppose it is a beta! No problem. I look forward to a few more options, a bit more API documentation, "daemon" being renamed to "flicd", and maybe even stuff like service announcement with "avahi" to save you having to hardcode the port in the client :-)

I will leave this issue open for the edification of others.