Go Down

Topic: File transfer via Bluetooth Serial Communication (Read 23041 times) previous topic - next topic

srkarthik00

I am currently working on a project using HC-05 bluetooth module with UNO. Is it possible to transfer an entire file (Such as mp3, pdf, etc) via bluetooth using serial communication (Serial.h) ?

Nick_Pyner

#1
Jan 04, 2014, 01:18 am Last Edit: Jan 04, 2014, 02:12 am by Nick_Pyner Reason: 1
I don't think I have ever heard of Serial.h and I suspect you are using a very old version of the Arduino IDE. If so, upgrading to a current version is a good idea, and costs nothing.

You don't mention which direction you want to transfer the file, but I have not seen anything that will do either, so you have two problems - the ability of the sender to send a file, and the ability of the receiver to receive a file.

Your third problem is one of coming to terms with the practicalities - like what on earth would induce you to transfer a PDF file to or from an Arduino?

Having said that,  you can dump the contents of a data file on the Arduino SD card over bluetooth to a suitable terminal programme on a PC or Android. This is not the same as a file transfer but the end result can be the same and is probably all you need.  The Dumpfile programme in the SD section of the examples included in the Arduino IDE does this just fine. Bluetooth Terminal on Android can receive the dump OK, and I imagine any PC terminal programme will work.  I imagine you can work in the opposite direction but the method is far less obvious, and I guess the same can be said for the need.  

Here is some background on basic bluetooth comms

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf



mrburnette

Quote
I am currently working on a project using HC-05 bluetooth module with UNO. Is it possible to transfer an entire file (Such as mp3, pdf, etc) via bluetooth using serial communication


"Bluetooth" is just a transport media, like a copper USB or serial data cable.  The Arduino can buffer SD Flash card sectors of approximately 512 Bytes, so you can accept serial via Bluetooth and write the data to SD just like any logging information.
http://forum.arduino.cc/index.php?topic=154864.0
And, of course, if you can write the data to SD, you can read it, too, and send that out the serial port to a Bluetooth module.

Point is, the Arduino could care less what the information being stored-forward is as long as it does not have to "peek" into the information stream in order to make sense of the data stream.

Ray

srkarthik00

       Thanks for the reply.! My project is to just transfer files from SD card to another bluetooth device such as cell phones or PC's via HC-05 bluetooth module. I have tried with my cell phone. It gets connected with the SPP profile with HC-05.

      But the thing is i don't know how to transfer the entire file (like sending an mp3 or video file between two mobile phones via bluetooth).  I have searched through internet, but all i could find is just receive data via a Serial terminal such as teraterm or putty (in PC's) or some serial terminal apps (in android mobile phones).

      I think that there should be a way to transfer files via HC-05 just like transferring files between two mobile phones. Can anyone help..?

srkarthik00

Here is the project,
               It uses GR-Sakura that is compatible with Arduino-UNO.
                     http://www.youtube.com/watch?v=9kE2V2H-DLo

Nishant_Sood

Transferring of each type of content by a bluetooth IC needs to support the respective stack for example the SPP profile lets you establish a simple Rx and Tx connection to and fro! and similarly if you want to transmit videos/audio you need to have the AVDTP protocol which the HC-05 doesn't supports, so the bluetooth hardware needs to support that respective stack to achieve a certain function.
"Real Men can Accomplish  Anything"

- skype : nishants5  
ਫ਼ਤੇਹ ਕਰੁਂ!
www.winacro.com

naidu003

even i want transfer the audio files in arduino SD card to android mobile through HC-05 bluetooth

As per above discussion HC-05 wont support for AVDTP

If this is the case what we have to do , Do  we have to switch to AVDTP suppoting bluetooth module ?

what kind of module we need to replace or any arduino programming suggestions without changing HC-05

Nick_Pyner

even i want transfer the audio files in arduino SD card to android mobile through HC-05 bluetooth

As per above discussion HC-05 wont support for AVDTP

If this is the case what we have to do , Do  we have to switch to AVDTP suppoting bluetooth module ?

what kind of module we need to replace or any arduino programming suggestions without changing HC-05
If the HC-05 won't support AVDTP, no amount of Arduino programming will fix the problem. You need to find a Bluetooth module that supports AVDTP, maybe on those bluesmirfs.

aankur

#8
Mar 31, 2016, 07:49 pm Last Edit: Mar 31, 2016, 07:57 pm by aankur
I have been able to do a serial transfer of file byte by byte from HC-05 to my mobile phone using
arduino. But it is a slow process. Is there any other way to increase the speed of
transfer of data ?

Is it possible to transfer a block of data at once from arduino BLE to mobile phone to increase the transfer rate?

Thanks

Nick_Pyner

#9
Apr 01, 2016, 12:53 am Last Edit: Apr 01, 2016, 02:00 pm by Nick_Pyner
I have been able to do a serial transfer of file byte by byte from HC-05 to my mobile phone using
arduino. But it is a slow process. Is there any other way to increase the speed of
transfer of data ?
That depends entirely on the speed at which you are sending the file now, about which you say nothing. If you are using the HC-05 out of the box, it will probably be running at 9600. In that event, you can send data at twelve times the speed by configuring it to run at 115200.

You might also ensure that only real useful data is recorded in the first place, i.e. no extraneous junk.

Quote
Is it possible to transfer a block of data at once from arduino BLE to mobile phone to increase the transfer rate?
That depends on your willingness to hang around with the phone while the data is being created, but it is obviously possible, you simply Serial.print the data as you Myfile.print it. If you use a laptop instead of your phone, you don't need to transfer any time data, as the terminal can insert that locally.



 

aankur

I want to transfer the file from memory card to mobie phone..... How to achieve it? I wish to have a fast transfer of data.

One more question:- Is it possibe to transfer the video or audio from memory card to phone?

Nick_Pyner

The dumpfile example in the SD section of the IDE is probably all you need. An example is at

http://homepages.ihug.com.au/~npyner/Arduino/Bluetooth_graphic_5110_with_file_retrieve_DY.ino

which is derived from that.

I don't know anything about audio or video but a file is a file, and I guess the same applies.

fasih3

Hello Karthik,

I am trying to build a project where the user will be able to trnasfer media files from their android-phone to the micro SD card connected in circuit with arduino and HC-05. I think you have successfully done the same thing, I will be thankful i you can help me with that.

Thanks,
Fasih Ur Rehman

zdoucha

Hello, this is my first arduino project: sending a file (jpeg, pdf, txt) from an arduino sd card module to android phone using arduino uno and bluetooth module HC-05
It's possible with this hardware?

If it's possible can someone please send me the source code and android app use it to receive the file
thank you

Go Up