Hello everyone!
After leaving the lab my brother told me he had a similar bluetooth issue once so he wrote this quick tutorial. I am sharing this information and will attach it in assembla as well. I hope this instructions solve our problems with Nero's bluetooth communication.
1. Instalar lo necesario:
sudo apt-get install bluez-pin
sudo apt-get install bluez-utils
2. Editar configuración del Bluetooth:
sudo gedit /etc/bluetooth/hcid.conf
3. Remplazar el contenido actuar del archivo por:
#
# HCI daemon configuration file.
#
# HCId options
options {
# Automatically initialize new devices
autoinit yes;
# Security Manager mode
# none - Security manager disabled
# auto - Use local PIN for incoming connections
# user - Always ask user for a PIN
#
security user;
# Pairing mode
# none - Pairing disabled
# multi - Allow pairing with already paired devices
# once - Pair once and deny successive attempts
pairing multi;
# PIN helper
pin_helper /usr/bin/bluepin;
# D-Bus PIN helper
#dbus_pin_helper;
}
# Default settings for HCI devices
device {
# Local device name
# %d - device id
# %h - host name
name "Nino's Laptop";
# Local device class
class 0x3e0100;
# Default packet type
#pkt_type DH1,DM1,HV1;
# Inquiry and Page scan
iscan enable; pscan enable;
# Default link mode
# none - no specific policy
# accept - always accept incoming connections
# master - become master on incoming connections,
# deny role switch on outgoing connections
lm accept;
# Default link policy
# none - no specific policy
# rswitch - allow role switch
# hold - allow hold mode
# sniff - allow sniff mode
# park - allow park mode
lp rswitch,hold,sniff,park;
# Authentication and Encryption (Security Mode 3)
#auth enable;
#encrypt enable;
}
4. Reiniciar los servicios de Bluetooth:
sudo /etc/init.d/bluez-utils restart
5. Para checar que todo esté bien hasta el momento
hcitool scan
Debe de devolver alguna lista de dispositivos cercanos…
6. Para obtener el canal donde se encuentra el puerto serial:
sdptool browse XX:XX:XX:XX:XX:XX
donde XX:XX:XX:XX:XX:XX es la dirección MAC del dispositivo Bluetooth
Debe de regresar algo parecido a:
Browsing XX:XX:XX:XX:XX:XX ...
Service Name: Bluetooth Serial Port
Service RecHandle: 0x10007
Service Class ID List:
"Serial Port" (0x1101)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Serial Port" (0x1101)
Version: 0x0100
Por lo que en ese caso sería el canal 1…
7. Editar el rfcomm.conf:
sudo gedit /etc/bluetooth/rfcomm.conf
De la siguiente forma:
rfcomm4 {
bind yes;
device XX:XX:XX:XX:XX:XX;
channel X;
comment "Serial Port";
}
8. Para terminar…
sudo rfcomm release 4
rfcomm connect 4
Si todo está bien, debe de aparecer algo parecido a:
$ rfcomm connect 4
Connected /dev/rfcomm4 to XX:XX:XX:XX:XX:XX on channel X
Press CTRL-C for hangup
No opriman en ningún momento CTRL-C hasta que sepan que todo está detenido y no hay peligro de que el robot pueda seguir caminando por su cuenta…
SU PUERTO SERIAL (PARA EL .CFG) SERÍA EL /dev/rfcomm4
Regards!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment