User Tools

Site Tools


informatica:linux:bluetooth

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
informatica:linux:bluetooth [2010/06/15 07:49] 192.168.1.50informatica:linux:bluetooth [2023/01/27 22:05] (current) javi
Line 1: Line 1:
 +====== parear cascos (actualizado) ======
 +
 +Instalar bluetooth
 +
 +  sudo apt update && sudo apt install bluetooth
 +  
 +Ejecutar:
 +
 +  bluetoothctl
 +  default-agent 
 +  pairable on
 +  devices
 +  
 +Si sale el mismo que hay que parear mejor olvidarlo:
 +
 +  remove F8:4D:89:25:92:89
 +
 +Poner el dispositivo bluetooth a parear en modo "descubrible". En mi caso unos airpods
 +
 +  scan on
 +  
 +Encontrar el ID del dispositivo
 +
 +  pair F8:4D:89:25:92:89
 +
 +En futuras ocasiones:
 +
 +  bluetoothctl
 +  connect F8:4D:89:25:92:89
 +  
 +  
 +
 +
 ====== bluetooth ====== ====== bluetooth ======
  
Line 61: Line 94:
  hci0 00:16:41:8A:27:B6  hci0 00:16:41:8A:27:B6
 </code> </code>
 +
  
  
Line 66: Line 100:
 ===== Parear los dispositivos =====  ===== Parear los dispositivos ===== 
  
-La + chachi piruli:+==== Arch Linux ====
  
 http://wiki.archlinux.org/index.php/Bluetooth#Pairing http://wiki.archlinux.org/index.php/Bluetooth#Pairing
 +
 +1. Lanzar como root el comando(parte del paquete 'bluez'):
 +
 +  sudo bluez-simple-agent
 +
 +Si todo va bien, se tiene que ver:
 +
 +  Agent registered
 +
 +Si aparece algun error de python, reiniciar el demonio bluetooth:
 +
 +  sudo /etc/rc.d/bluetooth restart
 +
 +2. Lanzar como usuario, y pasando la direccion MAC del dispositivo a parear:
 +
 +  bluez-simple-agent hci0 MAC_DISPOSITIVO_A_PAREAR
 +
 +3. (Movil) confirmar que se quiere parear
 +
 +4. (Pc) teclear el codigo que se quiere usar
 +
 +5. (Movil) Teclear el mismo codigo que el paso 4.
  
 Otra: Otra:
Line 212: Line 268:
  
 El archivo irá a parar al directorio desde el cual se ejecutó la instrucción 'bluetooth-agent 1234' El archivo irá a parar al directorio desde el cual se ejecutó la instrucción 'bluetooth-agent 1234'
 +
 +
  
 ===== Enviar archivos ===== ===== Enviar archivos =====
Line 227: Line 285:
   * Pc => móvil   * Pc => móvil
  
-  obexftp -b 00:17:83:ED:AD:14 -p /tmp/log.txt +  obexftp -b MAC_MOVIL -c DIRECTORIO_REMOTO -p ARCHIVO_LOCAL 
 + 
 +
 + 
 +  obexftp -b MAC_MOVIL -p ARCHIVO_LOCAL
  
 <code> <code>
Line 236: Line 298:
 Disconnecting..-done Disconnecting..-done
 </code> </code>
 +
 +
 +
 +===== Gnome applet debian lenny =====
 +
 +Módulos instalados:
 +
 +<code>
 +hci_usb                18460  3 
 +bluetooth              57636  9 rfcomm,l2cap,hci_usb
 +ehci_hcd               36620 
 +uhci_hcd               26272 
 +</code>
 +
 +Paquetes:
 +
 +<code>
 +ii  bluetooth                            3.36-3                     Bluetooth stack utilities
 +ii  bluez-audio                          3.36-3                     Bluetooth audio support
 +ii  bluez-gnome                          0.27-1                     Bluetooth utilities for GNOME
 +ii  bluez-utils                          3.36-3                     Bluetooth tools and daemons
 +ii  gnome-bluetooth                      0.9.1-1                    GNOME Bluetooth tools
 +ii  libbluetooth2                        3.36-1                     Library to use the BlueZ Linux Bluetooth stack
 +ii  gnome-vfs-obexftp                    0.4-1                      GNOME VFS module for OBEX FTP
 +ii  libopenobex1                         1.3+cvs20070425-2          OBEX protocol library
 +ii  obex-data-server                     0.3.4-1                    D-Bus service for OBEX client and server side functionality
 +ii  obexftp                              0.19-7                     file transfer utility for devices that use the OBEX protocol
 +ii  obexpushd                            0.7-1                      program for receiving files via Bluetooth or IRDA
 +</code>
 +
 +Servicios corriendo:
 +
 +<code>
 + 3885 ?        Ss     1:12 /usr/sbin/dhcdbd --system
 +14599 ?        Ss     0:00 /usr/sbin/hcid -x -s
 +14612 pts/0    S      0:00 /usr/bin/bluetooth-applet
 +14614 ?        S      0:00 /usr/bin/obex-data-server --no-daemon 
 +14616 ?        S      0:00 gnome-obex-server
 +14704 pts/0    S      0:00 /usr/bin/bluetooth-applet
 +</code>
 +
 +Hay algunos problemillas de instalación:
 +
 +http://lists.alioth.debian.org/pipermail/pkg-bluetooth-maintainers/2008-July/001636.html
 +
 +===== Guión para copiar archivos =====
 +
 +Pulir una miaja
 +
 +<code>
 +#!/bin/bash
 +
 +directorio="100MEDIA"
 +mac="00:17:83:ED:AD:14"
 +
 +rm /tmp/mobil.txt; for i in `obexftp  -c $directorio -l`;\
 +do name="` echo \"$i\" | grep name | sed 's/"//g' | sed 's/^name=//g' `";\
 +echo $name >> /tmp/mobil.txt; done; \
 +echo `cat /tmp/mobil.txt|sed 's/\n//g'` > /tmp/mobil2.txt; sleep 1;\
 +obexftp -b $mac -g $directorio/`cat /tmp/mobil2.txt`
 +</code>
 +
 +===== beacon =====
 +Lanzamos el scan y mientras está el scan el btmon:
 +  hcitool lescan
 +<code>
 +4A:F6:C7:2E:D3:DE (unknown)
 +44:9B:E0:3A:70:DA (unknown)
 +E7:9F:D3:88:87:66 (unknown)
 +42:AA:DA:C2:5D:5C (unknown)
 +14:51:9A:A1:9C:E3 (unknown)
 +F8:DF:15:C8:E0:E2 JBL Flip 4
 +</code>
 +
 +  sudo btmon
 +<code>
 +> HCI Event: LE Meta Event (0x3e) plen 42                                              [hci0] 662.852030
 +      LE Advertising Report (0x02)
 +        Num reports: 1
 +        Event type: Connectable undirected - ADV_IND (0x00)
 +        Address type: Random (0x01)
 +        Address: E7:9F:D3:88:87:66 (Static)
 +        Data length: 30
 +        Flags: 0x06
 +          LE General Discoverable Mode
 +          BR/EDR Not Supported
 +        Company: Apple, Inc. (76)
 +          Type: iBeacon (2)
 +          UUID: 25786407-ebc6-cfaf-b14f-e2a49306a5fd
 +          Version: 256.512
 +          TX power: -40 dB
 +        RSSI: -61 dBm (0xc3)
 +</code>
 +
 +Para buscar dispositivos que también nos sirve para ver la señal:
 +  sudo btmgmt find
 +<code>
 +Discovery started
 +hci0 type 7 discovering on
 +hci0 dev_found: 67:27:CE:8B:B9:47 type LE Random rssi -89 flags 0x0000 
 +AD flags 0x1a 
 +eir_len 30
 +hci0 dev_found: 73:02:AE:3E:48:1D type LE Random rssi -72 flags 0x0000 
 +AD flags 0x1a 
 +eir_len 30
 +hci0 dev_found: 72:9B:24:DA:2E:6D type LE Random rssi -63 flags 0x0004 
 +AD flags 0x00 
 +eir_len 31
 +hci0 dev_found: 0F:CE:FC:59:11:D2 type LE Random rssi -92 flags 0x0004 
 +AD flags 0x00 
 +eir_len 31
 +hci0 dev_found: 28:11:A5:33:A0:B7 type LE Public rssi -87 flags 0x0000 
 +AD flags 0x19 
 +eir_len 25
 +hci0 dev_found: 49:ED:F5:D8:8E:FA type LE Random rssi -87 flags 0x0000 
 +</code>
 +  
 +
informatica/linux/bluetooth.1276588150.txt.gz · Last modified: 2015/04/13 20:19 (external edit)