Pages: [1]   Go Down
Author Topic: "Send" PC -> Arduino via Bluetooth  (Read 1168 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I have an Arduino Uno, and this bluetooth module
http://www.lctech-inc.com/Hardware/Detail.aspx?id=25662aa3-0517-4d3d-960e-ff261d5ef28c

I am trying to understand nature of PC->Arduino, Arduino->PC by bluetooth, in order to implement it in my program.

My Arduino sends to my PC Serial monitor all commands correctly no problem by bluetooth. (Arduino IDE 1.0.3)

However, the problem is that i am unable to send data from PC->Arduino via Bluetooth .
I am able to do send data PC->Arduino via USB.
I am using "toggle LED on/off" to test it.

Tried using SoftwareSerial.h , no luck.

Rabee
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 551
Posts: 46265
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you just tape the BT module to the Arduino?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you mean if I changed factory settings modes ? (the slave/master) ?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 551
Posts: 46265
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Do you mean if I changed factory settings modes ? (the slave/master) ?
We've hired a psychic to help out when people do not describe the hardware that they have, how it is connected to the Arduino, or what code is running on the Arduino.

His start data is the 12th of never. Can you wait that long, or do you maybe have an idea what you need to do?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Do you mean if I changed factory settings modes ? (the slave/master) ?
We've hired a psychic to help out when people do not describe the hardware that they have, how it is connected to the Arduino, or what code is running on the Arduino.

His start data is the 12th of never. Can you wait that long, or do you maybe have an idea what you need to do?
Arduino Uno R2.
LED is on pin 13
My bluetooth module is on 3.3V/GND, and digital pins (0,1) rx,tx
Arduino operating on 9V adapter, and using my Toshiba's laptop bluetooth stack, COM40

as for my code

byte byteRead;

void setup() {               

  Serial.begin(9600);
  pinMode(13,OUTPUT);
}

void loop() {
   
  if (Serial.available()) {
   
    byteRead = Serial.read();
   
    digitalWrite(13,HIGH);
  }
}
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Refresh
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 30
Posts: 1702
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have the same module, I think. I have been sitting on this for a while. I think your problem may be in the first line. Try it.
Code:
int incomingByte = 0;   // for incoming serial data

void setup() {
        Serial.begin(9600);     // opens serial port, sets data rate to 9600 bps
}

void loop() {

        // send data only when you receive data:
        if (Serial.available() > 0) {
                // read the incoming byte:
                incomingByte = Serial.read();

                // say what you got:
                Serial.print("I received: ");
                Serial.println(incomingByte, DEC);
        }
}
 
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have the same module, I think. I have been sitting on this for a while. I think your problem may be in the first line. Try it.
Code:
int incomingByte = 0;   // for incoming serial data

void setup() {
        Serial.begin(9600);     // opens serial port, sets data rate to 9600 bps
}

void loop() {

        // send data only when you receive data:
        if (Serial.available() > 0) {
                // read the incoming byte:
                incomingByte = Serial.read();

                // say what you got:
                Serial.print("I received: ");
                Serial.println(incomingByte, DEC);
        }
}
 

Nope same problem, i don't get any response on Arduino's Serial moniter when i enter something
Same code works over USB
I believe it is a connectivity error , as even if i try the "AT" commands, i get no response from the module.
As i mentioned before , i have it connected on Toshiba Bluetooth stack, COM40, and i can only recieve data programmed from arduino, obviously sending from PC-module-arduino is going wrong
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2945
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dont use the serial monitor to send things over bluetooth, it doesn't work. Use either Putty or hyperterminal. Setup your COM channel and see if they connect. Do a simple message to like "I have connected to the PC", ok. Then try to read something from the PC. NOTE you will not see what you enter unless you echo the input, back to the monitor.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dont use the serial monitor to send things over bluetooth, it doesn't work. Use either Putty or hyperterminal. Setup your COM channel and see if they connect. Do a simple message to like "I have connected to the PC", ok. Then try to read something from the PC. NOTE you will not see what you enter unless you echo the input, back to the monitor.

Thanks for reply
Tried it over COM4 (USB) on Putty and it gives me back a message
Then I switch to COM40 (Bluetooth) , don't get any messages
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2945
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you know if your computer pairs with the BT module? Do you know what the factory baud rate is?

Edit: did you cross connect the Rx and Tx pins? Also when you did pair it, (if you got it to pair correctly), did you get another COM number?
« Last Edit: February 12, 2013, 03:36:17 pm by HazardsMind » Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you know if your computer pairs with the BT module? Do you know what the factory baud rate is?

Baud rate is 9600, but also tried other common Bluetooth rates
I do not get the device in the "devices and printers" , but i get it in the Toshiba Bluetooth stack as a connected and paired device
Hence i can receive data from it, but can't send to it
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Any ideas guys ?
Logged

Pages: [1]   Go Up
Jump to: