xiphocoleon
Posts: 9
Joined: Mon Jan 30, 2017 3:27 pm

RPi3 to RPi3 bluetooth file transfer

Fri Feb 03, 2017 5:19 pm

Hello --
I hope this can be a helpful thread to many, as I see lots of people are having problems using bluetooth on RPis. And if this has been repeated elsewhere, please direct me.

I am trying to send a file from one RPi3 to another RPi3 via their preinstalled bluetooth hardware (no dongles or peripherals are used).

Both Pis are running Raspian/Linux 8 Jessie, both have Bluez 5.23 and Blueman 1.99

Problem: I use

Code: Select all

sudo bluetoothctl
to scan for the other Pi. The other Pi appears, and when I attempt to pair with it, it appears to connect for a moment, but it never "connects" permanently.

Code: Select all

pi@raspberrypi:~ $ sudo bluetoothctl
[NEW] Controller B8:27:EB:78:07:99 mirror-pi [default]
[NEW] Device B8:27:EB:6C:D2:39 raspberrypi
[bluetooth]# pair B8:27:EB:6C:D2:39
Attempting to pair with B8:27:EB:6C:D2:39
[CHG] Device B8:27:EB:6C:D2:39 Connected: yes
[CHG] Device B8:27:EB:6C:D2:39 UUIDs:
	0000110c-0000-1000-8000-00805f9b34fb
	0000110e-0000-1000-8000-00805f9b34fb
	00001200-0000-1000-8000-00805f9b34fb
	00001800-0000-1000-8000-00805f9b34fb
	00001801-0000-1000-8000-00805f9b34fb
[CHG] Device B8:27:EB:6C:D2:39 Paired: yes
Pairing successful
[CHG] Device B8:27:EB:6C:D2:39 Connected: no
[CHG] Device B8:27:EB:6C:D2:39 Connected: yes
[CHG] Device B8:27:EB:6C:D2:39 Connected: no
[CHG] Device B8:27:EB:6C:D2:39 Connected: yes
[CHG] Device B8:27:EB:6C:D2:39 Connected: no
[bluetooth]# 
Now if I try to pair again, I get:

Code: Select all

[bluetooth]# pair B8:27:EB:6C:D2:39
Attempting to pair with B8:27:EB:6C:D2:39
Failed to pair: org.bluez.Error.AlreadyExists
So, I suppose the Pis are paired, but I would like to send a file between them, and I cannot, and I am not sure why.

Can anyone tell me how I can now send a file between these Pis?

User avatar
Douglas6
Posts: 4860
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: RPi3 to RPi3 bluetooth file transfer

Fri Feb 03, 2017 5:48 pm

They don't connect because Pi's don't by default run any connectable services. You'll need to install and run either obexpushd (for OBEX push object) or obexftp on the receiving Pi. Re-pair them once the server is running, to pick up the new service. You should then be able to send files with blueman; it will make the connection for you.

[EDIT: Oh, here, I wrote a post on it: viewtopic.php?p=963751#p963751]

xiphocoleon
Posts: 9
Joined: Mon Jan 30, 2017 3:27 pm

Re: RPi3 to RPi3 bluetooth file transfer

Sun Feb 05, 2017 6:26 pm

They don't connect because Pi's don't by default run any connectable services. You'll need to install and run either obexpushd (for OBEX push object) or obexftp on the receiving Pi. Re-pair them once the server is running, to pick up the new service. You should then be able to send files with blueman; it will make the connection for you.

[EDIT: Oh, here, I wrote a post on it: view ... 51#p963751]
SOLVED:
I followed the instructions for the post you created at that link and I was able to send files between two different RPi 3s. I am not sure if it mattered, but I set one Pi to listen on Channel 22 and one to listen on Channel 23, as I received the error that they could not work on Channel 9.

On both pis I left terminal windows open allowing them to listen:

Code: Select all

pi@raspberrypi:~ $ sudo obexpushd -B23 -o /bluetooth -n
obexpushd 0.11.2 Copyright (C) 2006-2010 Hendrik Sattler
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
Listening on bluetooth/[00:00:00:00:00:00]:23
and on the other pi I would issue a ussp-push command to send a file, and it would work, and I didn't experience any connectivity problems or glitches. Wow!

Code: Select all

other_pi@raspberrypi:~ $ sudo ussp-push B8:27:EB:6C:D2:39@23 /home/pi/Desktop/test furthersuccess
Thank you.

User avatar
Douglas6
Posts: 4860
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: RPi3 to RPi3 bluetooth file transfer

Sun Feb 05, 2017 10:28 pm

You're very welcome.

healingeye
Posts: 55
Joined: Thu Jan 19, 2017 4:30 am

Re: RPi3 to RPi3 bluetooth file transfer

Wed Oct 25, 2017 12:13 am

Thank you Doug.

maranhao
Posts: 8
Joined: Thu Jun 13, 2019 9:39 pm

Re: RPi3 to RPi3 bluetooth file transfer

Sun Jun 16, 2019 8:53 pm

I'm a bit confused. After running obexpushd on both RPi 3s do I need to pair the devices, or will this occur automatically when I issue the ussr-push command?

When I try to connect the two devices after running obexpushd on both devices I get "Connection failed - No usable services on this device" error message.

When I try to run ussp-push it appears to hang and never transfer the file.

What is the exact sequence of events after running obexpushd on both devices?

Thanks!

User avatar
Douglas6
Posts: 4860
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: RPi3 to RPi3 bluetooth file transfer

Sun Jun 16, 2019 10:00 pm

1. No, pairing is never done automatically. Start obexpushd on one (the receiving) Pi. If you are starting obexpushd from a terminal window, leave that window open for the duration. If the Pis are already paired remove them both using bluetoothctl (in a separate window), and then pair and trust them.

2. Don't try to connect the devices.

3. On the sending Pi, run the ussp-push command.

maranhao
Posts: 8
Joined: Thu Jun 13, 2019 9:39 pm

Re: RPi3 to RPi3 bluetooth file transfer

Sun Jun 16, 2019 11:50 pm

1. Do I have to repair and retrust the devices every time I turn them off and then back on?

So on RPi #1 I executed

Code: Select all

sudo obexpushd -B23 -o /bluetooth -n
I have paired and trusted the devices in bluetoothctl.

On RPi #2 I executed

Code: Select all

sudo ussp-push B8:27:EB:B3:F4:F6@23 /home/pi/Documents/Attendance\ Kiosk/CRNA.txt CRNA.txt
It returns

Code: Select all

name=/home/pi/Documents/Attendance Kiosk/CRNA.txt, size=2383
but it hangs there. It never appears to transmit the file. Is there something wrong with my ussp-push command? Is there some way of troubleshooting this further?

Thanks.

maranhao
Posts: 8
Joined: Thu Jun 13, 2019 9:39 pm

Re: RPi3 to RPi3 bluetooth file transfer

Mon Jun 17, 2019 6:40 pm

So I was able to resolve the file transfer issues by utilizing obexftp instead of ussp-push.

After installing obexftp, the command is as follows:

Code: Select all

obexftp --nopath --noconn --bluetooth BT_MAC_ADDRESS --channel BT_COMM_CHANNEL --put FILE

Return to “Troubleshooting”