1

ubuntu 12.04を実行しているラップトップをarduinoに接続されたBluetooth Mate Silverに接続しようとしています。

配線は:

CTS-I->No connection (leave floating)
VCC->5V
GND->GND
TX-O->D2
RX-I->D3
RTS-O->No connection (leave floating)

arduino で実行されているコード:

$include <SoftwareSerial.h>  

int bluetoothTx = 2;  // TX-O pin of bluetooth mate, Arduino D2
int bluetoothRx = 3;  // RX-I pin of bluetooth mate, Arduino D3

SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

void setup()
{
  Serial.begin(9600);  // Begin the serial monitor at 9600bps

  bluetooth.begin(115200);  // The Bluetooth Mate defaults to 115200bps
  bluetooth.print("$$$");  // Enter command mode
  delay(100);  // Short delay, wait for the Mate to send back CMD
  bluetooth.println("U,9600,N");  // Temporarily Change the baudrate to 9600, no parity
  // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
  bluetooth.begin(9600);  // Start bluetooth serial at 9600
}

void loop()
{
  if(bluetooth.available())  // If the bluetooth sent any characters
  {
    // Send any characters the bluetooth prints to the serial monitor
    Serial.print((char)bluetooth.read());  
  }
  if(Serial.available())  // If stuff was typed in the serial monitor
  {
    // Send any characters the Serial monitor prints to the bluetooth
    bluetooth.print((char)Serial.read());
  }
  // and loop forever and ever!
}

ubuntu で bluetooth マネージャーを開くと、bluetooth mate が表示されているが不明であり、右クリックしても SPP 接続オプションがないことがわかります。私が行ったすべてのチュートリアルとブログは、SPP オプションを介して Bluetooth メイトに接続されていました。

私の bluetooth マネージャーの写真: http://www2.picturepush.com/photo/a/12001550/640/12001550.jpg

では、Bluetooth mate に接続するにはどうすればよいでしょうか。

4

1 に答える 1

1

多くのグーグルとさまざまなブログを読んだ後、私はこのコマンドに出くわしました:

    sudo rfcomm bind 0 00:06:66:48:71:0C

ここで、00:06:66:48:71:0C は、Bluetooth mate シルバーの MAC アドレスです。

これを行うと、Bluetooth マネージャーでデバイスのシリアル ポート オプションが有効になっていることがわかりました。そこから続けてデバイスに接続します。

于 2013-01-23T03:45:00.637 に答える