Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: HOWTO: Send/Receive/Setup File Transfers to Bluetooth Phones using Gnome Scripts!

  1. #1
    Join Date
    Apr 2005
    Beans
    320
    Distro
    Kubuntu 10.10 Maverick Meerkat

    HOWTO: Send/Receive/Setup File Transfers to Bluetooth Phones using Gnome Scripts!

    Introduction

    Hey all, if you are like me then you are kinda tired of having to go into your terminal to setup a Bluetooth connection, and even go there to send and receive files. What IF, there was a nicer, easier way to do it? I just may have the solution.

    First of all, this is my first ever script, and this comes from reading the HOWTO on installing a deb via right clicking. So, please be patient with me while I perfect these. These do however, work so far for me.

    First of all, if you don't already have a working Bluetooth Connection to your phone (or any other device, this should work for all Bluetooth devices) then read this excellent HOWTO: http://ubuntuforums.org/showthread.p...ight=bluetooth

    It talks about Nokia phones, but this will work for any phone. It worked great for my Motorola V551.

    After you have a working connection, we need to make some scripts. This is VERY easy to do with Gnome, and this will probably be the last time you will have to open up a terminal for anything Bluetooth again.

    Script Setup

    Start off like this.

    gedit ~/.gnome2/nautilus-scripts/Bluetooth\ Setup

    If you read the howto, you will notice that after every reboot, we have to re-pair the devices and activate the proper Bluetooth modules. This script will do it all for us, just have to insert in out sudo password.

    Enter this into your gedit window:

    #!/bin/bash
    modprobe l2cap
    gksudo modprobe rfcomm
    gksudo mknod /dev/rfcomm0 c 216 0
    sdptool add --channel=10 OPUSH
    gksudo rfcomm bind /dev/rfcomm0 YOUR_PHONE_ADDRESS 10
    done

    REMEMBER to change YOUR_PHONE_ADDRESS and put in your phones proper address. An example of a working script is this:

    #!/bin/bash
    modprobe l2cap
    gksudo modprobe rfcomm
    gksudo mknod /dev/rfcomm0 c 216 0
    sdptool add --channel=10 OPUSH
    gksudo rfcomm bind /dev/rfcomm0 00:12:8A:C9:5A:8B 10
    done

    Close and Save.

    Next, we need to make a script to receive files from our phone. NOTE: All files are saved in your /tmp directory, so remember to copy and paste them where you want them. Also, you can currently with the Bluetooth utils, only send ONE FILE AT A TIME. So, that means this script will have to be used for every file sent. Sorry, I know it's a pain.

    gedit ~/.gnome2/nautilus-scripts/Bluetooth\ Receive\ File

    Copy and Paste

    #!/bin/bash
    obexserver
    done

    Save and Close

    Next up, we are going to send files to phones.

    gedit ~/.gnome2/nautilus-scripts/Bluetooth\ Send\ File

    Copy and Paste

    #!/bin/bash
    for uri in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do
    gnome-obex-send $uri
    done

    Save and Close

    Now, we have to make this script executable from our menu. Copy and paste the lines below one at a time.

    chmod +x ~/.gnome2/nautilus-scripts/Bluetooth\ Setup
    chmod +x ~/.gnome2/nautilus-scripts/Bluetooth\ Receive\ File
    chmod +x ~/.gnome2/nautilus-scripts/Bluetooth\ Send\ File

    Now, on your Right click menu you will have another option called "Scripts". Here is what you do to get transferin' (this would be an example of what you would do after a reboot)

    Right click---Scripts---Bluetooth Setup
    (enter root password twice)
    Right click---Scripts---Bluetooth Receive File
    (obexserver is now started, send a file from your phone to your Linux box's /tmp folder)
    Right click on a file---Scripts---Bluetooth Send File
    (sends selected file(s) to bluetooth paired device)

    Closing

    Again, these are my first scripts, so I don't expect them to work right away. Please post any comments you have and I will try my best to help everyone with their problem. Also note, this is assuming you have only ONE bluetooth device, so if you want to pair up with another device, you would change the lines in the first scirpt, Bluetooth Setup.

    I hope someone finds this useful.

    Good luck

  2. #2
    Join Date
    Jun 2005
    Location
    USA
    Beans
    80

    Re: HOWTO: Send/Receive/Setup File Transfers to Bluetooth Phones using Gnome Scripts!

    Very nice! I just added obexserver to the Bluetooth Setup script, as it seems a bit redundant to make a script to run one simple command. But anyway, thanks a lot for these scripts!
    Eh.. actually the send script is not working for me, I have no idea why. hmm..
    Last edited by oofnik; June 27th, 2005 at 08:21 AM.

  3. #3
    Join Date
    Apr 2005
    Beans
    320
    Distro
    Kubuntu 10.10 Maverick Meerkat

    Re: HOWTO: Send/Receive/Setup File Transfers to Bluetooth Phones using Gnome Scripts!

    Quote Originally Posted by oofnik
    Very nice! I just added obexserver to the Bluetooth Setup script, as it seems a bit redundant to make a script to run one simple command. But anyway, thanks a lot for these scripts!
    Eh.. actually the send script is not working for me, I have no idea why. hmm..
    Yeah, the reason obexserver isn't in the setup script is because obexserver has to be started up again for every file downloaded. So, if you have 10 files to transfer, you have to turn on obexserver 10 times (one after another after the file has downloaded)

    And as for your send script, make sure that you can send files to your phone using the terminal. If you can, then check the scripts. I've included a tar.gz file of the scripts i'm using.

    Hope that helped.
    Attached Files Attached Files

  4. #4
    Join Date
    Jul 2005
    Location
    FRANCE
    Beans
    162
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HOWTO: Send/Receive/Setup File Transfers to Bluetooth Phones using Gnome Scripts!

    Hmm I have little problem, all is working but when I want to send a file to my sgh-d500 it ask me a password, for exemple i say 0000 but next computer must ask me the password too.But it isn't...so computer say me can't connect to phone or something like that ..
    How to do?
    Do you understand me?

    Thanks :/

  5. #5
    Join Date
    Jul 2005
    Beans
    12

    Re: HOWTO: Send/Receive/Setup File Transfers to Bluetooth Phones using Gnome Scripts!

    Hi! Thanks for this wonderful script. It works perfectly for me. Tried the terminal but this scripts are just so great. Thanks!!!

  6. #6
    Join Date
    Jun 2005
    Beans
    504

    Re: HOWTO: Send/Receive/Setup File Transfers to Bluetooth Phones using Gnome Scripts!

    Quote Originally Posted by keltong
    Hi! Thanks for this wonderful script. It works perfectly for me. Tried the terminal but this scripts are just so great. Thanks!!!
    I have no idea how to receive stuff on bluetooth which is annoying because I want to transfer my photos to my computer. Should I not be seeing my Samsung D500 in the filesystem? I can send files to it no problem at all.

  7. #7
    Join Date
    Jun 2005
    Beans
    504

    Re: HOWTO: Send/Receive/Setup File Transfers to Bluetooth Phones using Gnome Scripts!

    anyone?

  8. #8
    Join Date
    Apr 2005
    Location
    Connecticut, USA
    Beans
    87
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Send/Receive/Setup File Transfers to Bluetooth Phones using Gnome Scripts!

    Thanks, the scripts are perfect. Works great with Motorola V3.

  9. #9
    Join Date
    Jun 2005
    Beans
    504

    Re: HOWTO: Send/Receive/Setup File Transfers to Bluetooth Phones using Gnome Scripts!

    Quote Originally Posted by AndrewB
    Thanks, the scripts are perfect. Works great with Motorola V3.
    Anyone got any advice on my problem?

  10. #10
    Join Date
    Aug 2005
    Location
    Catalunya
    Beans
    25
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Angry Re: HOWTO: Send/Receive/Setup File Transfers to Bluetooth Phones using Gnome Scripts!

    What about connecting to TWO phones? Could modify the script to use several phones?
    -----------
    REMEMBER to change YOUR_PHONE_ADDRESS and put in your phones proper address. An example of a working script is this:

    #!/bin/bash
    modprobe l2cap
    gksudo modprobe rfcomm
    gksudo mknod /dev/rfcomm0 c 216 0
    sdptool add --channel=10 OPUSH
    gksudo rfcomm bind /dev/rfcomm0 00:12:8A:C9:5A:8B 10
    done

    Close and Save.
    -----------

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •