freebsd - how to transfer files to/from a phone

  • load the bluetooth module: kldload ng_ubt

  • to load at boot: echo ng_ubt_load="YES" >>/boot/loader.conf

  • start stack at boot: echo bluetooth_enable="YES" >>/etc/rc.conf

  • start bluetooth stack: /etc/rc.d/bluetooth start ubt0

    • note the BD_ADDR in the output; the mac address of the bluetooth device

    • check dmesg if you get errors

  • search for the phone: hccontrol inquiry

    • note the BD_ADDR in the output

    • can query the phone’s name: hccontrol remote_name_request <BD_ADDR>

  • configure security:

    • create entries in /etc/bluetooth/hcsecd.conf for each device

    • assuming a phone with BD_ADDR of 00:11:22:33:44:55:66 and PIN of 2345:

      device {
        bdaddr 00:11:22:33:44:55:66;
        name   "my blue phone"
        key    nokey;
        pin    "2345";
    • execute:

      hccontrol write_authintication_enable 1
      hccontrol read_authintication_enable
  • install obexapp: pkg_add -r obexapp

  • pair the phone (might need to do multiple times: obexapp -c -a 00:11:22:33:44:55:66 -C ftrn

  • if a prompt appears, use just like ftp - ls, get, cd, etc.

note that if the computer’s bluetooth adapter is not embedded, e.g., usb, before unplugging it, do /etc/rc.d/bluetooth stop ubt0.