Невозможно подключиться к Bluetooth Mate Silver

Я пытаюсь подключить свой ноутбук под управлением Ubuntu 12.04 к Bluetooth Mate Silver, подключенному к Arduino.

Электропроводка:

  • CTS-I-> Нет соединения (не подключен)
  • VCC-> 5 В
  • GND-> GND [ 114]
  • TX-O-> D2
  • RX-I-> D3
  • RTS-O-> Нет соединения (оставить без движения)

Код работает на 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!
    }

Когда я открываю менеджер Bluetooth в Ubuntu, я обнаруживаю, что помощник Bluetooth видим, но неизвестен, и нет никакой возможности подключения SPP, когда я щелкаю по нему правой кнопкой мыши. Все учебные пособия и блоги, через которые я прошел, подключены к bluetooth mate через опцию SPP.

Рисунок моего менеджера Bluetooth: http://www2.picturepush.com/photo/a/12001550/640/12001550.jpg

Так что теперь, как мне подключиться к блютузу, приятель?

0
задан 20 January 2013 в 09:18

1 ответ

После долгих поисков и поисков в различных блогах я наткнулся на эту команду:

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

где 00: 06: 66: 48: 71: 0C - это mac-адрес bluetooth mate silver. [ 112]

Как только я это сделал, я обнаружил, что опция последовательного порта для моего устройства в диспетчере Bluetooth была включена. Оттуда я продолжаю подключаться к устройству.

0
ответ дан 20 January 2013 в 09:18

Другие вопросы по тегам:

Похожие вопросы: