Shop OBEX P1 Docs P2 Docs Learn Events
Easy Bluetooth Module (Need Help) Urgent!! — Parallax Forums

Easy Bluetooth Module (Need Help) Urgent!!

computer guycomputer guy Posts: 1,113
edited 2010-01-04 12:08 in BASIC Stamp
Does anyone have an object for the Easy Bluetooth Module.

I need to pair two modules together and communicate back and forth between the two modules and an object would be handy.



Thank you smile.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"powered by Propeller" domed stickers $1.50 - Find them here
Check out my Design and Technology project for my Higher School Certificate www.ecosureblog.net

Post Edited (computer guy) : 1/1/2010 12:51:28 PM GMT

Comments

  • SamMishalSamMishal Posts: 468
    edited 2009-12-22 11:40
    Hi Guy,

    The bluetooth module uses Serial comms with the propeller to operate and to give/get the data
    received/sent from the propeller.

    So all you need to operate the module is a FullDuplexSerial or FullDuplexSerialPlus or similar serial
    object. Make sure you have the right PINS and Baudrate and that is it.

    Use the Serial object to comm with the module and command it or give it data to send or to get
    data received from it.

    Other than the need to initialize the module with certain initial commands and settings from then onwards
    for all intents and purposes you are communicating with the other Propeller as if there were a direct
    Serial link between the two.

    As fas as the initialization this too is done using the Serial comm object to comm with the module
    but you need to use certain preamble bytes etc. This you can figure out from the module's manual.

    So all you need is a Serial comms object (e.g. FullDuplexSerial) and you are up and running. The only hard
    bit is figuring out how to configure the modules using their command sequences etc.





    Samuel
  • computer guycomputer guy Posts: 1,113
    edited 2009-12-22 14:42
    I know this probably means nothing without the datasheet but does this look right so far?

    CON
    
    StartDelimiter         = $02
    EndDelimiter           = $03
    REQ_PACKET             = $52
    CFM_PACKET             = $43
    IND_PACKET             = $69
    RES_PACKET             = $72
    
    GAP_WRITE_LOCAL_NAME = $04
    
    PUB setName(name) : okay | ptr, csum, chars, Length 
    
      ptr := 0
      Length := StrSize(name)
      dataSet[noparse][[/noparse]ptr++] := StartDelimiter
      dataSet[noparse][[/noparse]ptr++] := REQ_PACKET
      dataSet[noparse][[/noparse]ptr++] := GAP_WRITE_LOCAL_NAME                                
      dataSet[noparse][[/noparse]ptr++] := Length >> 8          
      dataSet[noparse][[/noparse]ptr++] := Length
      csum := $FF
      Repeat chars from 1 to ptr-1
        csum := csum - dataSet[noparse][[/noparse]chars]
      dataSet[noparse][[/noparse]ptr] := csum
      Repeat strsize(name)         ' Add name to packet
         dataSet[noparse][[/noparse]ptr++] := byte[noparse][[/noparse]name++]
      dataSet[noparse][[/noparse]ptr++] := EndDelimiter 
     
      Repeat chars from 0 to ptr
        tx(dataSet[noparse][[/noparse]chars])
    
    




    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "powered by Propeller" domed stickers $1.50 - Find them here

    Post Edited (computer guy) : 12/22/2009 2:48:35 PM GMT
  • computer guycomputer guy Posts: 1,113
    edited 2010-01-01 10:24
    So that I can get used to the operation of the Easy Bluetooth Module I decided to start with a BS2.

    I tried to use this code to get the local name, however it's not working.

    SEROUT TX, Baud, [noparse][[/noparse]$02,$52,$03,$00,$00,$55,$03]
    SERIN RX, Baud, [noparse][[/noparse]var1]
    DEBUG var1
    
    



    Can anyone help me, please?


    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "powered by Propeller" domed stickers $1.50 - Find them here
    Check out my Design and Technology project for my Higher School Certificate www.ecosureblog.net
  • computer guycomputer guy Posts: 1,113
    edited 2010-01-02 00:09
    All of those demos are for sending data to the Easy Bluetooth module. Thank you anyway Stefan.
    I need to know how to send commands to it and read its response. I have read the manual and I understand the UART packet format, I just can't figure out how to read in the response.


    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "powered by Propeller" domed stickers $1.50 - Find them here
    Check out my Design and Technology project for my Higher School Certificate www.ecosureblog.net
  • computer guycomputer guy Posts: 1,113
    edited 2010-01-03 04:06
    I think I have identified the problem.
    By default the Easy Bluetooth module appears to be defaulting to transparent mode.

    According to the manual "As the RBT-001 does not listen to commands, UART Break has to be used to tell the
    device to leave the transparent mode"

    I have tried
    LOW TX
    PAUSE 1000
    
    AND
    
    SEROUT TX, Baud, [noparse][[/noparse]$00,$00,$00,$00,$00,$00,$00,$00]
    
    



    Before I try and send a command, from reading around these appear to be two different ways of sending a UART break signal.
    Both of these have made no difference though.

    Has anyone else got some ideas.


    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "powered by Propeller" domed stickers $1.50 - Find them here
    Check out my Design and Technology project for my Higher School Certificate www.ecosureblog.net
  • blittledblittled Posts: 681
    edited 2010-01-03 04:34
    There is another post referring to this issue as well. It is http://forums.parallax.com/showthread.php?p=863561. I haven't had a chance to look into this myself so I would be interested in what you find out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Will work for Propeller parts!
  • computer guycomputer guy Posts: 1,113
    edited 2010-01-03 05:07
    Thank you blittled. I had that link bookmarked after I found it earlier today.
    It appears to be a huge problem with the module and both the datasheet for the BT chip itself and the Parallax manual for the Easy Bluetooth appear to have no helpful information.
    Hopefuly when everyone gets back from holidays they will be able to help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "powered by Propeller" domed stickers $1.50 - Find them here
    Check out my Design and Technology project for my Higher School Certificate www.ecosureblog.net
  • computer guycomputer guy Posts: 1,113
    edited 2010-01-03 07:21
    OK. Correct me if I am wrong but in command mode this
     SEROUT TX, Baud, [noparse][[/noparse]"Message"]
    
    


    Shouldn't print "Message" on the Bluetooth serial port.

    So by the fact that it is printing the above, I can safely assume that it isn't in command mode.

    Therefore This:
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    RX PIN 2 'Receive Pin
    TX PIN 0 'Transmit Pin
    Baud CON 84 '9600 Baud
    var1 VAR Byte
    MAIN:
     LOW TX
     PAUSE 100
     HIGH TX
     PAUSE 100
     DEBUG "Sending message", CR
     SEROUT TX, Baud, [noparse][[/noparse]"Message"]
     GOTO MAIN
    
    


    Isn't putting it into command mode as I expect it should from reading 4 Datasheets and 3 Manuals.


    Plz, can anyone help me with this. This is part of a school project and is urgent.


    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "powered by Propeller" domed stickers $1.50 - Find them here
    Check out my Design and Technology project for my Higher School Certificate www.ecosureblog.net
  • computer guycomputer guy Posts: 1,113
    edited 2010-01-04 12:08
    It would appear that this issue has been moved to "Basic Stamp". I would be happy with propeller code if it worked as I am intending to use it with the propeller.
    I'm just using the BS2 to work out how to use it. Guess I can always request that it get moved back later, when it starts flooding with spin code. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "powered by Propeller" domed stickers $1.50 - Find them here
    Check out my Design and Technology project for my Higher School Certificate www.ecosureblog.net
Sign In or Register to comment.