linux-nfc / neard

NFC Daemon for Linux
GNU General Public License v2.0
31 stars 11 forks source link

Error when running neard #14

Open kd496 opened 2 years ago

kd496 commented 2 years ago

Running neard results in the following error:

neard[31986]: Could not get Bluetooth default adapter Method "DefaultAdapter" with signature "" on interface "org.bluez.Manager" doesn't exist

I'm using linux 5.10.95-v8, bluez 5.63, neard 0.18. Please let me know if you need more information.

sudo ./neard -n -d
neard[31986]: NEAR daemon version 0.18
neard[31986]: src/dbus.c:__near_dbus_init() 
neard[31986]: src/netlink.c:__near_netlink_init() 
neard[31986]: src/netlink.c:nl_get_multicast_id() 
neard[31986]: src/netlink.c:__nl_send_msg() 
neard[31986]: src/netlink.c:family_handler() 
neard[31986]: src/netlink.c:ack_handler() 
neard[31986]: src/netlink.c:nl_get_multicast_id() multicast id 9
neard[31986]: src/agent.c:__near_agent_init() 
neard[31986]: src/tag.c:__near_tag_init() 
neard[31986]: src/device.c:__near_device_init() 
neard[31986]: src/adapter.c:__near_adapter_init() 
neard[31986]: src/ndef.c:__near_ndef_init() 
neard[31986]: src/manager.c:__near_manager_init() 
neard[31986]: src/manager.c:__near_manager_init() connection 0x55874bd670
neard[31986]: src/netlink.c:__near_netlink_get_adapters() 
neard[31986]: src/netlink.c:__nl_send_msg() 
neard[31986]: src/netlink.c:__finish_handler() 
neard[31986]: src/bluetooth.c:__near_bluetooth_init() 
neard[31986]: src/plugin.c:__near_plugin_init() 
neard[31986]: plugins/p2p.c:p2p_init() 
neard[31986]: plugins/phdc.c:phdc_init() 
neard[31986]: plugins/p2p.c:near_p2p_register() driver 0x555ec39ad8 name NPP service com.android.npp
neard[31986]: plugins/p2p.c:near_p2p_register() driver 0x555ec39b20 name SNEP service urn:nfc:sn:snep
neard[31986]: plugins/p2p.c:near_p2p_register() driver 0x555ec39b68 name VALIDATION_SNEP service urn:nfc:xsn:nfc-forum.org:snep-validation
neard[31986]: plugins/llcp-validation.c:llcp_validation_init() 
neard[31986]: plugins/p2p.c:near_p2p_register() driver 0x555ec39bb0 name VALIDATION_LLCP_CL service urn:nfc:sn:cl-echo
neard[31986]: plugins/p2p.c:near_p2p_register() driver 0x555ec39bf8 name VALIDATION_LLCP_CO service urn:nfc:sn:co-echo
neard[31986]: plugins/p2p.c:near_p2p_register() driver 0x555ec39c40 name Handover service urn:nfc:sn:handover
neard[31986]: src/device.c:near_device_driver_register() 
neard[31986]: plugins/nfctype5.c:nfctype5_init() 
neard[31986]: src/tag.c:near_tag_driver_register() 
neard[31986]: plugins/nfctype4.c:nfctype4_init() 
neard[31986]: src/tag.c:near_tag_driver_register() 
neard[31986]: src/tag.c:near_tag_driver_register() 
neard[31986]: plugins/nfctype3.c:nfctype3_init() 
neard[31986]: src/tag.c:near_tag_driver_register() 
neard[31986]: plugins/nfctype2.c:nfctype2_init() 
neard[31986]: src/tag.c:near_tag_driver_register() 
neard[31986]: plugins/nfctype1.c:nfctype1_init() 
neard[31986]: src/tag.c:near_tag_driver_register() 
neard[31986]: src/bluetooth.c:bt_connect() connection 0x55874bd670 with 0x555ec3d4a8
neard[31986]: src/bluetooth.c:register_bluez() 
neard[31986]: src/bluetooth.c:bt_refresh_adapter_props() 0x55874bd670 0x555ec3d4a8
neard[31986]: src/bluetooth.c:bt_generic_call() DefaultAdapter
neard[31986]: src/bluetooth.c:bt_get_default_adapter_cb() 
neard[31986]: Could not get Bluetooth default adapter Method "DefaultAdapter" with signature "" on interface "org.bluez.Manager" doesn't exist
pi@raspberrypi:~/neard/tools/nfctool $ sudo dbus-monitor --system
signal time=1644626555.908035 sender=org.freedesktop.DBus -> destination=:1.162 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.162"
signal time=1644626555.908099 sender=org.freedesktop.DBus -> destination=:1.162 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.162"
signal time=1644626555.908123 sender=org.freedesktop.DBus -> destination=(null destination) serial=53 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.162"
   string ":1.162"
   string ""
method call time=1644626555.911415 sender=:1.108 -> destination=org.freedesktop.DBus serial=225 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetConnectionUnixProcessID
   string ":1.162"
error time=1644626555.911476 sender=org.freedesktop.DBus -> destination=:1.108 error_name=org.freedesktop.DBus.Error.NameHasNoOwner reply_serial=225
   string "Could not get PID of name ':1.162': no such name"
method call time=1644626566.678461 sender=:1.163 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method return time=1644626566.678529 sender=org.freedesktop.DBus -> destination=:1.163 serial=1 reply_serial=1
   string ":1.163"
signal time=1644626566.678571 sender=org.freedesktop.DBus -> destination=(null destination) serial=54 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.163"
   string ""
   string ":1.163"
signal time=1644626566.678640 sender=org.freedesktop.DBus -> destination=:1.163 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.163"
method call time=1644626566.680666 sender=:1.163 -> destination=org.freedesktop.DBus serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RequestName
   string "org.neard"
   uint32 4
signal time=1644626566.685878 sender=org.freedesktop.DBus -> destination=(null destination) serial=55 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string "org.neard"
   string ""
   string ":1.163"
signal time=1644626566.688018 sender=org.freedesktop.DBus -> destination=:1.163 serial=3 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string "org.neard"
method return time=1644626566.688377 sender=org.freedesktop.DBus -> destination=:1.163 serial=4 reply_serial=2
   uint32 1
method call time=1644626566.688986 sender=:1.163 -> destination=org.freedesktop.DBus serial=3 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',interface='org.freedesktop.DBus.Local',member='Disconnected'"
method return time=1644626566.689953 sender=org.freedesktop.DBus -> destination=:1.163 serial=5 reply_serial=3
method call time=1644626566.690028 sender=:1.163 -> destination=org.freedesktop.DBus serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.bluez'"
method return time=1644626566.690452 sender=org.freedesktop.DBus -> destination=:1.163 serial=6 reply_serial=4
method call time=1644626566.690774 sender=:1.108 -> destination=org.freedesktop.DBus serial=226 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetConnectionUnixProcessID
   string ":1.163"
method return time=1644626566.691196 sender=org.freedesktop.DBus -> destination=:1.108 serial=294 reply_serial=226
   uint32 32275
method call time=1644626566.691592 sender=:1.163 -> destination=org.freedesktop.DBus serial=5 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner
   string "org.bluez"
method return time=1644626566.693228 sender=org.freedesktop.DBus -> destination=:1.163 serial=7 reply_serial=5
   string ":1.33"
method call time=1644626566.695528 sender=:1.108 -> destination=org.freedesktop.DBus serial=227 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetConnectionUnixProcessID
   string "org.neard"
method return time=1644626566.695621 sender=org.freedesktop.DBus -> destination=:1.108 serial=295 reply_serial=227
   uint32 32275
method call time=1644626569.187072 sender=:1.163 -> destination=org.freedesktop.DBus serial=6 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',interface='org.bluez.Manager',member='AdapterRemoved'"
method return time=1644626569.187124 sender=org.freedesktop.DBus -> destination=:1.163 serial=8 reply_serial=6
method call time=1644626569.187930 sender=:1.163 -> destination=org.freedesktop.DBus serial=7 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',interface='org.bluez.Manager',member='DefaultAdapterChanged'"
method return time=1644626569.187988 sender=org.freedesktop.DBus -> destination=:1.163 serial=9 reply_serial=7
method call time=1644626569.188888 sender=:1.163 -> destination=org.bluez serial=8 path=/; interface=org.bluez.Manager; member=DefaultAdapter
error time=1644626569.189737 sender=:1.33 -> destination=:1.163 error_name=org.freedesktop.DBus.Error.UnknownMethod reply_serial=8
   string "Method "DefaultAdapter" with signature "" on interface "org.bluez.Manager" doesn't exist
krzk commented 2 years ago

Thanks for the report. I saw it as well on every run. I wonder whether this might be some missing policy in /etc/dbus-1/system.d/org.neard.conf? Or other in service?

mgreeraz commented 2 years ago

@Soyal7, do you have a /etc/dbus-1/system.d/bluetooth.conf file? Mine looks like this (Ubuntu 20.04 so you may have to tweak):

<!-- This configuration file specifies the required security policies
     for Bluetooth core daemon to work. -->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <!-- ../system.conf have denied everything, so we just punch some holes -->

  <policy user="root">
    <allow own="org.bluez"/>
    <allow send_destination="org.bluez"/>
    <allow send_interface="org.bluez.Agent1"/>
    <allow send_interface="org.bluez.MediaEndpoint1"/>
    <allow send_interface="org.bluez.MediaPlayer1"/>
    <allow send_interface="org.bluez.Profile1"/>
    <allow send_interface="org.bluez.GattCharacteristic1"/>
    <allow send_interface="org.bluez.GattDescriptor1"/>
    <allow send_interface="org.bluez.LEAdvertisement1"/>
    <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
    <allow send_interface="org.freedesktop.DBus.Properties"/>
    <allow send_interface="org.mpris.MediaPlayer2.Player"/>
  </policy>

  <!-- allow users of bluetooth group to communicate -->
  <policy group="bluetooth">
    <allow send_destination="org.bluez"/>
  </policy>

  <policy context="default">
    <allow send_destination="org.bluez"/>
  </policy>

</busconfig>
kd496 commented 2 years ago

@mgreeraz I do and it is identical to yours.