Archive for the 'mobile' Category

Send and receive files via Bluetooth

Using Bluetooth, you can transfer data to basically any other desktop or mobile (particularly phones) device having a Bluetooth interface. Doing so in Ubuntu is a simple operation once you’re finished with the configuration.

Configuration

  1. First install the required packages from the shell by executing:
    sudo apt-get install gnome-bluetooth bluez-utils
  2. Make sure the Bluetooth adapter is enabled on your machine. That is make sure your USB adapter is connected, or the Bluetooth switch on your laptop is set on. To be certain, you can execute hcitool dev which will tell you if any Bluetooth interfaces exist on your machine.
  3. Now restart the Bluetooth interface by executing:
    sudo /etc/init.d/bluetooth restart
  4. Enable the Bluetooth File Sharing service by simply executing it from the Gnome menu. It can be found under Applications -> Accessories -> Bluetooth File Sharing. This will start gnome-obex-server which allows you to receive files as well as facilitates the sending operation.
    Bluetooth File Sharing

Receiving a file
Once the configuration completed, you’ll be able to receive files via Bluetooth.

  1. You just need to make sure your interface is visible so that other devices can find you. Visibility can be configured in the Bluetooth Preferences which can be found under System -> Preferences -> Bluetooth Preferences. Set the Mode of operation to Visible and connectable for other devices.
  2. Your machine is now discoverable, and external devices are able to send you data. Once you receive a file, a window will popup to notify you this is the case.
    Receiving a file via Bluetooth
  3. You are advised to change back the visibility settings once the transmission is complete.

Sending a file
Bluetooth File Sharing makes it quite easy to send data accross Bluetooth. Simply right click on the file you wish to send, then select Send to.... In the new window:

  • Set the Send as field to Bluetooth (OBEX Push)
  • Set the Send to field to destination Bluetooth device
  • Click Send and you’re done!
    Send a file via Bluetooth

Alternative method to send files using the shell:

  1. Execute hcitool scan to scan for Bluetooth devices within range. Something similar will be displayed:
    Scanning ...
    00:11:24:B1:11:05 iMac G5
    00:11:9F:BE:47:CB michael-phone

    The hexadecimal series (eg. 00:11:9F:BE:47:CB) displayed near the device name (eg. michael-phone) is the mac address associated with the Bluetooth device.
  2. Send the file by executing the following (replace the file and the mac address appropriately):
    gnome-obex-send sample/file.txt --dest=00:11:9F:BE:47:CB