2

I have a Raspberry Pi unit connected to a sensor. Sensor is writing measurements to the sd card of the Raspberry Pi unit every 10 hrs. Now I want to copy this data to a android phone to plot the graphs every month.

As of now I am able to pair the Raspberry Pi and the android phone using the application I am writing for plotting the graphs. The problem I am facing is with file transfer. Can anyone guide me on what are the steps to programmatically transfer the file/data from Raspberry Pi to android phone. I don't have a WiFi adaptor and I have a Bluetooth adaptor.

Tolga Varol
  • 589
  • 6
  • 17

1 Answers1

1

As for me, the simplest solution for such a task would be using OBEX profile as ppumkin suggested. Then you can write a simple bash script for doing the task(making the file transfer). If you want all to be automated you can launch the bash script as a Subprocess inside your main program(Python) so everything will be in one program.

Here is a explanatory tutorial for making both RPi and Android device a Bluetooth FTP : RPi to Android BT FTP

Outline of tutorial :

-Install Bluetooth software bluez.

-Make Android phone a BT FTP server.

-Make RPi a BT FTP client.

-Find phone's BT address(I suggest you do the scan (hcitool -i hciX scan) with root privileges since otherwise address might not show up.

-Pair devices.

-Send the file(in the tutorial it send an .mp3 extension file but you can send any file in any location with permissions provided of course)

After following the tutorial by Mirza, test the commands you have executed in order to transfer the file a few times and after finding a good pattern put them all in a shell script. Then arrange the changes in your main program to call that script as a subprocess.

Tolga Varol
  • 589
  • 6
  • 17