Collection: HowTo config various BT modules

Post Reply
User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Collection: HowTo config various BT modules

Post by Hamburger »

Hi,
in order to relieve myself from storing notes all over the place I start compiling info here.
From my experience the dealers' documentation usually is contradictory and not really helpful. In one case I got one BT module with 3 files stating 2 different hardware specifics and 2 config ways for configuration. Take your pick.
So it seems the only way to identify the proper way to config is by identifying the BT via its name if it is a slave module.
For master modules that does not seem to work as the master modules I know do not advertise a name.

Rules: label each post with the BT module's name.

Hamburger
Last edited by Hamburger on Sun Jun 12, 2011 12:12 pm, edited 1 time in total.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

linvar slave module

Post by Hamburger »

comes preconfigured with 9600 baud.
For setup, no hardware fiddling is required.
Ignore "PIO11 to high" notes, just run commands after power on. you have approx 1/2 second after poweron.
Best do it via a arduino sketch.
For setup with arduino use Serial.print("command");
no cr lf, no \r\n

prepare separate sketches for name setting and for baud setting or else the baud setting command becomes part of the name.
commands:
AT+NAMEname
AT+BAUDn with n from table (1=1200, 2=2400,...8=11520)

That's all there is to it.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Omnitek_bluetooth slave

Post by Hamburger »

- requires pio11 set high via 10k pullup.
- powerup
- connect with 38400,N,1
- run commands
AT+NAME=newName
AT+UART=115200,0,0
- query with AT+name? and AT+uart?
- remove pullup
- power cycle
done.

lazarus
Posts: 7
Joined: Fri Jul 22, 2011 9:16 pm

OBDII_Bluetooth Slave

Post by lazarus »

pre configured at 38400 baud
setting PIO4 high returned 'OK' to the wired serial interface- no idea what it is okaying
setting PIO11 high has no effect on entering AT mode (tested with and with out 10k pullup)

never did manage to program it before a mishap ended it
Attachments
bt.jpg

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Collection: HowTo config various BT modules

Post by Hamburger »

programming the BT module can be done by connecting it to an arduino and run a tailored sketch on the arduino.
Sketch could be something like (save to a file named bt.pde, open in the Arduino IDE and upload to your arduino

Code: Select all

void setup() {  
  pinMode(13, OUTPUT);     
  Serial.begin(9600);
  //Serial.print("AT+NAMEBT.SL.115k" );   //  BT slave  module linvar , no trailing cr+lf !!! must exit after name setting or else all following commands get appended to name !!
}

void loop() {
  Serial.print("AT+BAUD8" );   //  BT slave mit shield    und module linvar !!! no trailing cr+ lf
  digitalWrite(13, HIGH);   // set the LED on
  delay(600);              // wait f
  digitalWrite(13, LOW);    // set the LED off
  delay(4000);              // wait
}

Esquilax
Posts: 1
Joined: Sun Mar 11, 2012 10:02 pm

Re: Collection: HowTo config various BT modules

Post by Esquilax »

Hello

I know that it's been a while since somebody posted to this thread but i think this information can be useful for somebody :)

Lazarus, i love you ;) After i spent hours on getting this thing to work your post gave me the last clue.
I got a Bluetooth-Module from Ebay that looks very similar to yours. The difference is that the text "sct 1052" isn't on mine.
You nearly solved the problem.
If i set Pin 28 (PIO5?) to high level the devices sends "OK" and the blinking of the LED gets slower. Now the module is in "command-mode". I can send AT-Commands with 38400 Baud. Everything works fine :)

Bye,
Alex

Meenzer
Posts: 1
Joined: Wed Mar 28, 2012 10:59 pm

Re: Collection: HowTo config various BT modules

Post by Meenzer »

Hi there,
the info on this page did help me get my board up. :D

Got mine from e-bay too.
it did report
OBDII
as name

to identify the board :
the antenna has three loops toward the inside like so:
inside
|
| __ __ __
|_| |_| |_| |_______

Command mode can be enabled via pin 28 / pio5. gives an OK (*)
LED indicator is pin 31.
- command mode . slow blinking
- normal not active - fast blinking
- normal active - on
(*) Command mode will set 38k baud regardless of programmed baud rate

at+baud does not work
at+uart does work fine

at+pin does not work
at+pswd does work

I did use the at+name=
to change the device name

all AT commands also accept lower case

at+version reports +VERSION:Serial BT v2.1

maybe this picture will work ?

Image
Michael
Attachments
bc417.jpg
image
(21.52 KiB) Not downloaded yet
Last edited by Meenzer on Wed Apr 04, 2012 5:32 pm, edited 1 time in total.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Collection: HowTo config various BT modules

Post by Hamburger »

Michael,
for the OBDII module to set the name you use STNA= or NAME= ?

msev
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am

Re: Collection: HowTo config various BT modules

Post by msev »

The "linvar slave module" seems to be the easiest to config...Baud rate has to be changed to 11520 right? Where can I buy it? :)

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Collection: HowTo config various BT modules

Post by Hamburger »

glb or emartee?
Just get a cheap one and figure things out. Only caveat: make sure you get one that is _not_ explicitly fixed to _master_ mode.

Wayne
Posts: 86
Joined: Sun Jul 31, 2011 10:44 pm

Re: Collection: HowTo config various BT modules

Post by Wayne »

I have:
http://www.goodluckbuy.com/serial-bluet ... pin-1.html
It started as ‘linvar’.
I get no reply, ever…but I did stumble upon the correct Baud and could then see the LED slow when sending AT+BAUD8 and AT+NAMEwhatever.

I could always Pair and now MWConfig does open and close the correct port.
MWConfig will start but show nothing.
WinGui will start and show nothing but will pop-up ‘no valid answer’ error within a few seconds.

Am I correct in assuming that BT is connected to MEGAs serial 0? (MWv2.0)
Do I have to tell MW to speak BT? I see BTSERIAL but I do now want to fly via BT, just GUI.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Collection: HowTo config various BT modules

Post by Hamburger »

No btserial.
But try and swap tx rx lines between bt and mwii.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Collection: HowTo config various BT modules

Post by Hamburger »

to reconfigure 'linvar' modules, you can use the arduino sketch I posted earlier.

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Collection: HowTo config various BT modules

Post by PatrikE »

Or follow my guide to setup Linvor.

BT Configuration

Wayne
Posts: 86
Joined: Sun Jul 31, 2011 10:44 pm

Re: Collection: HowTo config various BT modules

Post by Wayne »

Thanks guys, I did see the guide and the sketch is just a little over my head but..
Back at trying to get my BT working after a great weekend of flying.
As before I never get a reply when sending AT commands to Linvar.
But I did get the light to slow when sending AT+BAUD8 and
I am able to change and have changed its name.
Today while trying to make it work I had BT plugged into RX0 & TX0.
MWCONFIG can open and close the COM but no data flow.
Here’s where it came together for me.
With BT hooked up I plugged a cable to MEGA and my desktop computer, selected the proper COMport and MWCONFIG would do the same thing as with BT, open the COM but no data flow.
Now I unplug BT, restart the desktop MWCF and it works as usual.
WHILE MWCF is running on the desktop I plug BT back in, open MWCF on my laptop, point to the BT COM, hit start and IT WORKS. (everything but read and write)
Bummer, as soon as I stop the desktop, BT stops also.

I now know two things:
My BT is working.
My MEGA2560 does not like BT piggybacked onto RX0 & TX0.

Cronalex
Posts: 51
Joined: Tue Mar 20, 2012 8:41 pm

Re: Collection: HowTo config various BT modules

Post by Cronalex »

Hello everyone I have a problem with crius SE second module is the "Serial Bluetooth RF Transceiver Module RS232" after a while I use gives me problems. connects to the phone but did not receive anything ... is the second module I is burned in this way ... I can only connect ... more why?

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: Collection: HowTo config various BT modules

Post by haydent »

so i have the jy-mcu bt from glb, have change the baud rate and it replies back OK to AT at new baud rate. i can pair it but there is no data read or shown in the app...

my fc is http://www.goodluckbuy.com/mwc-multi...lticopter.html
running MW 2.0

is there any tests i can do to narrrow in on where the problem is ?

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Collection: HowTo config various BT modules

Post by Hamburger »

Switch rx tx lines.

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: Collection: HowTo config various BT modules

Post by haydent »

ive tried both ways, and all 3 serial ports with no difference... thanks for your suggestion though

chris ables
Posts: 317
Joined: Wed Feb 08, 2012 8:42 pm
Location: United states

Re: Collection: HowTo config various BT modules

Post by chris ables »

You did click settings in android gui and choose the right mwc version didn't you ? I had that problem when i first used mine ! Said it was connected but i couldn't get any readings . It was set on 1.9 version and i needed it on 2.0 !

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Collection: HowTo config various BT modules

Post by Hamburger »

test against another computer with the correct GUI for your mwii version.
Use cable first, only then switch to BT bridging.

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: Collection: HowTo config various BT modules

Post by haydent »

i did set mw versien.

i also have no problems with ftdi usb cable and windows.

i will look into trying between my laptop bluetooth and mw instead of via fone

chris ables
Posts: 317
Joined: Wed Feb 08, 2012 8:42 pm
Location: United states

Re: Collection: HowTo config various BT modules

Post by chris ables »

http://www.rctimer.com/index.php?gOo=go ... oductname= i bought this and didnt have to configure anything in firmware and it works great ! CHEAP TOO! That is on my phone though , i havent tried pc yet and may have to change something to use on pc ! But i thought i'd share this with phone users !

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: Collection: HowTo config various BT modules

Post by haydent »

yeah im thinking i will just have to buy a new one considering how cheap they are.

User avatar
brettwal
Posts: 93
Joined: Mon Jun 18, 2012 4:51 pm
Location: Louisiana

Re: Collection: HowTo config various BT modules

Post by brettwal »

I have a Mega 2560 board (GLB $69 board w/ IMU) and a bluetooth module (JY-MCU v1.03). If I connect the BT module to the FTDI port on the FC, I get data in the GUI. If I connect the BT Module to any of the Serial ports on the FC, I do not get data. Is there anything that I need to change in the code to make this work on one of the Mega Serial ports instead of the FTDI?? Is it possible to run on a serial port?

Thanks

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: Collection: HowTo config various BT modules

Post by haydent »

i have this exact board and problem. ive tried two bluetooth boards now with no difference...

does anyone know if there's somewhere in the code to choose the port it is plugged into like with gps ?

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: Collection: HowTo config various BT modules

Post by haydent »

i got it working !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

i love open source !!!!!!!!!!!!!!!!!

so i started reading the code to work out how it does what it does via serial and it became clear that Serial 0 is the port its using for these messages for gui or phone via bt...

mega has 4 serial. on our board 0 is used for ftdi and bt, it would be nice to have bt on serial 1 (or whichever one you specify) instead !!!

ive been confused thinking ftdi pins on fc are a different type of port but they are really just a serial port with different pin numbers to the others, its on the ftdi/usb adapter where the translation occurs....

anyway you have to jack power from serial 1, here's my pic:

P1010875.JPG

User avatar
brettwal
Posts: 93
Joined: Mon Jun 18, 2012 4:51 pm
Location: Louisiana

Re: Collection: HowTo config various BT modules

Post by brettwal »

haydent wrote:i got it working !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

i love open source !!!!!!!!!!!!!!!!!

so i started reading the code to work out how it does what it does via serial and it became clear that Serial 0 is the port its using for these messages for gui or phone via bt...

mega has 4 serial. on our board 0 is used for ftdi and bt, it would be nice to have bt on serial 1 (or whichever one you specify) instead !!!

ive been confused thinking ftdi pins on fc are a different type of port but they are really just a serial port with different pin numbers to the others, its on the ftdi/usb adapter where the translation occurs....

anyway you have to jack power from serial 1, here's my pic:

P1010875.JPG




So did you find where in the code to change it from COM 0 ?

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: Collection: HowTo config various BT modules

Post by haydent »

i found areas where it is specifying serial 0 for this job, i didnt look for them all though. but if you chango it you will also be changing your ftdi connection to that port (eg 1) as it doesnt differentiate between bt and ftdi/usb communications, they are all handled by the same protocol code regardless.

for now im not bothered trying to mod it as i can just switch my bt and ftdi plug as needed.

i did start a fix request here though viewtopic.php?f=7&t=2218

Post Reply