Go Down

Topic: Arduino Uno + Bluetooth Connectivity Issue (Read 21178 times) previous topic - next topic

uk350



On a side note, the Bluetooth module has a red LED which doesn't stop flashing. 

Should I expect the flashing to stop at some point if things are working properly?

Is it possible this isn't going to work because my bluetooth module is "Master-Only" ?



If led blink all time that mean you dont have paired it. when paired led stop blinking .
in device manager you can see all modules connected, not current one

go bluetooth devices and do search to see if you can find module


is it's name linvor or hc05?
are you sure it is master?

mwittmer

I recorded a screenshare video this morning to show in a bit more detail some of the configuration I mention above.
Please let me know your thoughts. 
http://michaelwittmer.com/wordpress/?cat=82

Also, I did uninstall all the drivers per dxw00d's suggestion.  Issue still exists.

uk350,
How do I initiate the pairing?
My device shows listed in control panel and when I detected the bt device, I entered a pairing code which was gracefully accepted, but how to I initiate a "pair" once the device is installed?

uk350

#17
Mar 30, 2012, 07:32 pm Last Edit: Mar 30, 2012, 07:47 pm by uk350 Reason: 1
I cant see any slave bt devices in device manager, i see only bt dongle and btcomports. maybe that is your btdongle driver/software thing.
i made dirty video for you how i make connection/pairing.
http://youtu.be/gW6cFymAzxU  (hope that doesnt break any rules here)
Once slave device is paired, i only need right click BT_AMEGA and click "connect serialport com10"
or if it's configured as "autoconnect", connection is made by software when needed.

if your module is configered as master i dont know if it can be paired.
if its master it must have HC05 firmware and it can be changed to slave by AT commands.

mwittmer

Thanks for the video.  Very cool of you to take the time.  I think it might help.  What OS are you running?  Some of your screens look quite different from mine but I'll see if I can recreate the steps somehow in Win7.  If not, I have an XP machine I can try as well.

uk350

windows 7

if you cant see bluetooth icon in taskbar, try to find bt software somewhere from hard-disk(look image).

uk350

About  master/slave, as you think your module is master there is simple way check it. can you look tracks or measure where status led on your btmodule is connected. if it's connected to pin 24 of module it then have hc04 firmware and its slave only. if led goes pin 31 or 32 then hc05 firmware and it can be master or slave.
to find right pins, tx and rx are 1 adn 2 and opposite side last pin is 34
pin 1 is also marked with white point

If its hc04 its ok for you as its slave and default baudrate is 9600, but if its hc05 you can change it to slave sending AT+ROLE=0\r\n command from arduino or terminal via tx/rx pins. before that you must put it in at mode by setting pin 34 of module to high state, dont use 5v but 3.3v for this, and powerup it. its now in at mode and baudrate must be now 38400.
when paired defaul baudrate for both is 9600.
you can also test ttl serial communication by sending AT (for hc04) or AT\r\n(hc05), module should reply OK, you can use led off/on to show ok reply.

Other thing, that module have onboard regulator so it can be connected to 5v, but rx and tx are still 3.3v tolerant. im not sure about atmel chips(i use schottky & pullup) but some other cases ttl serial communication is not working if it is connected to 5v logic. i suggest to add atleast resistor(maybe 1k)from arduino tx to module rx line.

hope that help you or someone else if your module is wrong mode.

pito

#21
Mar 31, 2012, 09:03 pm Last Edit: Mar 31, 2012, 09:19 pm by pito Reason: 1
Hi, I am using several cheap bt modules with my dev systems. I am using IVT BlueSoleil (the application/driver comes with the Sweex usb bt dongle) and I am in doubt whether it will work without this application (under XP). There are always two ports listed (ie com15, 16) - no idea why, when connected to the first bt module the third com appears (com17) and this is the com I connect myself to via ie teraterm. When you connect to the second bt module the com18 appears and so on. I do not care what XP device manager says, never checked that, everything is managed via BlueSoleil application/driver (a small BT icon in the taskbar). The bt modules need to be set to a specific baudrate, default was 9600 with mines. P.

mwittmer

I'm still not getting anywhere on this, but I very much appreciate all the details you have provided.  Since my original post, I moved on to a BT shield which is master/slave so I don't believe that is the issue currently (but then again, it still could be).  I will check the traces on the original module I was using to answer that question as suggested.

Currently, I'm trying to connect the itead module found here: http://iteadstudio.com/product/arduino-bluetooth-shield-upgrade-to-v2-2/
Here's the datasheet: http://iteadstudio.com/store/images/produce/Shield/BTshieldv2.2/BTShieldV2.2_DS.pdf

The data sheet it a bit hard to follow.  I've tried using tera-term to connect to the module but am not having success there either.  The problem connecting to the module via tera-term is the terminal is not echoing any of the keys pressed.  Not sure what the deal is but I assume it is some configuration issue I haven't worked out yet.  At any rate, any tips there would be appreciated.

As for the general bluetooth connectivity issue, it seems, based on what I understand from UK350, that my bluetooth module is connected but not "paired".  I do have an entry in device manager for the module: Ports (COM & LPT) > Standard Serial Over Bluetooth Link (COM14).  This coincides with port associated with the bluetooth module in control panel > devices & printers > bluetooth devices > itead.

The status of itead in control panel show it was last connected April 1, 2012 (today) but is not currently connected.  And, the connection type is "authenticated."  This seems to agree with UK350's assessment.

I have confirmed that no other services are using COM14 when attempting to run my Processing code, however, COM14 does not show in the Serial.write() output.  I suspect this is normal for a device that is not paired.

So, I think at this point, I need to figure out how to connect to the module through the arduino using tera-term or PuTTy.  Anyone have some experience with this that can offer some guidance?

Thanks again for all the support.

uk350

can it be that if both, dongle and  bt module/shield are in master mode you cant then get paired them. What status led do on bt shield, did you get it stop blinking?

as mode change is easy to do with btshield try change it to slave and check if you can then pair it.

did you see blue bluetooth icon next to clock? or as you say device manager >bluetoot devices , can you see bt wizard, search or something like that behind it if you click it?

mwittmer

>>did you see blue bluetooth icon next to clock?
I do have the bluetooth icon in the system tray and when I click it, I see my ardiuno/bluetooth module connected - it's named "itead".  I have removed it and rediscovered it to mimic what you do in your video, but this issue still exists for me.  In the above thread entries, where I reference

>>What status led do on bt shield, did you get it stop blinking?
This is another area of uncertainty for me with respect to my particular bluetooth shield.  Per it's datasheet:

"When power on and disconnect the port, states LED blinks 1time/2s ;
when the module connect and open the serial port, states LED blinks
2times/s."

I have gotten to the mode where it blinks twice per second.  But that doesn't appear to be the same a being paired.

The datasheet also seems to imply the default setting is "slave mode" with the following:
"Default state:
Slave mode, pin code  :1234, device name: H-C-2010-06-01 ,Baud
38400bits/s."

But I would like to confirm that by connecting with a terminal program - which I have been unsuccessful in to doing so far.

mwittmer

In my last post:
"In the above thread entries, where I reference"

Please disregard that incomplete thought...I meant to delete that text.

Thanks,
Mike

uk350

note!
4. Restore default
Command Respond Parameter
AT+ORGL OK -
Default state:
Slave mode, pin code  :1234, device name: H-C-2010-06-01 ,Baud
38400bits/s.

as datasheet say you can use that command to be sure about mode, baud and pairing code.
you only have to select CMD with switch, power it up and make sketch that send AT+ORGL\r\n via arduino serail port with baudrate 38400.

if you then think you got it paired,(in my video i use hc04 module so it stop blinking when paired, for hc05 led blink time thing is right as it's described in datatsheet)  make sketch that send some chars(just use loop to send something ) from arduino and try receive it via terminal on pc.

void loop()
{
  Serial.write("test");       
 
  delay(500);



florinc

I got the same cheap BT module you are trying to use.
I get exactly the same behavior in XP, with 2 COM ports listed after Windows connects to the BT module. One port is "outgoing", the other one is "incoming". I think that Bluesoleil software (and others like it) just hides the complexity underneath, so users don't get confused when they see the multitude of ports.

So, at this point, one can either receive from Arduino through BT on the incoming port, or send out to Arduino through BT on the outgoing port. Trying to connect with a terminal app (I tried CoolTermWin) on the incoming results in an error. I could connect on the incoming port with the HyperTerminal though, which allowed me to receive messages from Arduino. This is the sketch I am running (using an ATmega with 2 serial ports, but should be easily adapted to Atmega328):

Code: [Select]
#include <WProgram.h>

void setup()
{
  Serial.begin(9600);

  // bluetooth serial:
  Serial1.begin(9600);
}


void loop()
{
  while (Serial1.available())
  {
    // get char from bluetooth;
    char inChar = (char) Serial1.read();

    // output to serial monitor;
    Serial.println(inChar);
  }

  Serial1.println("from Arduino");
  delay(2000);
}


I am able to receive, sometimes, in HyperTerminal, the repeated message "from Arduino". So the connection works, but it is not reliable. Even after a fresh re-connect (in Windows), it may still not work. I suspect it is the USB dongle. I only have one, so I have no way to test it.

I tried sending messages from CoolTerm, through the outgoing port, but never got that to work.
I will keep you posted when I figure it out.

florinc

#28
Apr 06, 2012, 03:09 am Last Edit: Apr 06, 2012, 06:05 am by florinc Reason: 1
I found this thread talking about the same issue:
http://arduino.cc/forum/index.php?topic=64338.0

The solution, from truly knowledgeable fellows, seems to be the installation of the Toshiba BT driver.

I would also suggest trying the BT connection from an Android device (I don't have one at the moment).

florinc


Go Up