Bluetooth text file transfer from mobile phone to PIC - rookie's question


+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    921

    Default Bluetooth text file transfer from mobile phone to PIC - rookie's question

    Hi All,

    Is is possible to send a text file from a smartphone's bluetooth standard to a PIC?

    I imagine there is a complex file transfert protocol to make sure things are send and received properly.

    Nevertheless, there might some "module" out there that could do this for me.

    Is it the case?
    Roger

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    955

    Default Re: Bluetooth text file transfet from mobile phone to PIC - rookie's question

    You could look at a module called the HC05. It will pair with your bluetooth phone and can talk on 5V UART with the PIC.

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    921

    Default Bluetooth text file transfet from mobile phone to PIC - rookie's question

    Thanks Jerson.

    I'll grab some of these modules and try
    Roger

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,515

    Default Re: Bluetooth text file transfet from mobile phone to PIC - rookie's question

    wifi is the easy way , just add an esp module or a socket for one
    Warning I'm not a teacher

  5. #5
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    921

    Default Bluetooth text file transfet from mobile phone to PIC - rookie's question

    Like i.e. this one?

    Name:  ESP8266_module.png
Views: 2819
Size:  105.2 KB


    Okay, and then, is there any particular protocol to involve or what is the idea to transmit data from à common smartphone to a PIC?
    Roger

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,515

    Default Re: Bluetooth text file transfet from mobile phone to PIC - rookie's question

    esp01 modules tend to have smallish flash chips installed something with a 4meg or bigger flash is better. [wemos d1 mini or d1 mini pro]
    i set the esp up as a simple web server. user can upload/download files from the server via a html script using any sort of browser.
    the esp can then send or fetch the file data from the pic via a ttl serial connection or spi or i2c or whatever floats your boat at whatever speed you like
    whenever you like. no special software is needed at all in your browser for most common file types to upload or download successfully

    https://www.picbasic.co.uk/forum/sho...776#post154776
    Warning I'm not a teacher

  7. #7

    Default Re: Bluetooth text file transfet from mobile phone to PIC - rookie's question

    Okay, and then, is there any particular protocol to involve or what is the idea to transmit data
    How big a file or text to send/receive ?

  8. #8
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    921

    Default Bluetooth text file transfet from mobile phone to PIC - rookie's question

    It would be a config file containing data like:

    001:123456789
    002:234567890
    ...
    ...
    ...
    254:456789012
    255:567890123

    So this makes a count of about 2'300 characters in total.
    Roger

  9. #9
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    921

    Default Re: Bluetooth text file transfer from mobile phone to PIC - rookie's question

    After many hours of trying and trying again, none of my four HC05 modules are willing to accept the "Master" Role. I assume this is why I couldn't establish a serial link between them

    This is the most common example of HC05 modules configuration:

    ' Slave Configuration:
    ' AT+RMAAD (To clear any paired devices)
    ' AT+ROLE=0 (To set it as slave)
    ' AT+ADDR (To get the address of this HC-05, remember to jot the address down as it will be used during master configuration)
    ' AT+UART=9600,0,0 (To fix the baud rate at 9600)

    ' Master Configuration:
    ' AT+RMAAD (To clear any paired devices)
    ' AT+ROLE=1 (To set it as master)
    ' AT+CMODE=0 (To connect the module to the specified Bluetooth address and this Bluetooth address can be specified by the
    ' binding command)
    ' AT+BIND=xxxx,xx,xxxxxx (Now, type AT+BIND=98d3,34,906554 obviously with your respective address to the slave. Note the
    ' commas instead of colons given by the slave module)
    ' AT+UART=9600,0,0 (To fix the baud rate at 9600)


    Every time I send the command AT+ROLE=1, the answer is OK but if I check with AT+ROLE, the answer is always +ROLE:0.

    I even found some information suggesting to have the MASTER role physically set with a jumper 3.3V <> Pin 28 or even 3.3V <> Pin 34, which I tried.
    https://www.martyncurrey.com/hc-05-f...-auto-connect/
    https://www.martyncurrey.com/arduino...odule-at-mode/


    But still nothing works...

    Is there a beam in my eye or can possibily all my four modules be malfunctioning? They're new....

    These are my modules:
    Name:  HC05_Front.jpg
Views: 2644
Size:  32.6 KB Name:  HC05_Back.jpg
Views: 2604
Size:  25.1 KB
    Roger

  10. #10
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    955

    Default Re: Bluetooth text file transfer from mobile phone to PIC - rookie's question

    Firstly, wishing all who read this post a happy and fruitful year ahead.

    I have used these modules. You need to ensure that the interface to the module works @3.3V not 5V. I just re-looked at my C code and see that there is zero initialisation that I have used with the modules. They natively connect akin to a serial UART and you can use a BT serial terminal to read/write to it. I have not used a single AT command in the code, and it works.

  11. #11
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    921

    Default Bluetooth text file transfer from mobile phone to PIC - rookie's question

    I use FTDI USB cables that have 5V power and 3.3v UART levels so it should be okay from this side.

    I finally ordered new and different (looking) HC05 modules.

    Name:  HC05_new.jpg
Views: 2489
Size:  31.5 KB

    These ones have two almost equally sized black chips unlike the ones I have on my desk so they might be a little différent.

    So wait and see...
    Roger

  12. #12
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    921

    Default Bluetooth text file transfer from mobile phone to PIC - rookie's question

    Just received the "new" modules and guess what?

    Name:  2024-01-15 17_40_18-AI-Thinker Serial Tool V1.2.3.0    www.ai-thinker.com.jpg
Views: 2484
Size:  72.7 KB


    These are the ones I have now.

    Name:  New-modules.jpg
Views: 2474
Size:  76.0 KB


    I finally can start my tests
    Roger

Similar Threads

  1. PIC18f2550 usb communication with a mobile phone
    By TD26 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 25th February 2008, 20:13
  2. Replies: 3
    Last Post: - 19th June 2007, 06:13
  3. Help with sending text file from pic
    By isaac in forum Serial
    Replies: 6
    Last Post: - 15th August 2006, 21:01
  4. IrOBEX transfer JPG to mobile phone
    By Jumper in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 27th March 2006, 19:19
  5. How to connect PIC16F84A to mobile phone
    By PoTeToJB in forum Schematics
    Replies: 2
    Last Post: - 8th March 2006, 16:32

Members who have read this thread : 16

You do not have permission to view the list of names.

Posting Permissions

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