informatica:linux:bluetooth
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| informatica:linux:bluetooth [2009/11/14 17:46] – 192.168.1.30 | informatica: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: | ||
| + | |||
| + | Poner el dispositivo bluetooth a parear en modo " | ||
| + | |||
| + | scan on | ||
| + | | ||
| + | Encontrar el ID del dispositivo | ||
| + | |||
| + | pair F8: | ||
| + | |||
| + | En futuras ocasiones: | ||
| + | |||
| + | bluetoothctl | ||
| + | connect F8: | ||
| + | | ||
| + | | ||
| + | |||
| + | |||
| ====== bluetooth ====== | ====== bluetooth ====== | ||
| bluetooth bluez obexftp obexftpd bluetoothd | bluetooth bluez obexftp obexftpd bluetoothd | ||
| - | **NOTA** Hay que pulir la receta, porque probé muchas cosas | + | Requisitos: |
| + | |||
| + | | ||
| + | | ||
| + | |||
| + | Lo interesante de esta receta es poder enviar/ | ||
| + | |||
| + | ===== Habilitar bluetooth ===== | ||
| 1. Habilitar módulos del kernel | 1. Habilitar módulos del kernel | ||
| Line 16: | Line 56: | ||
| aptitude update && aptitude install bluetooth obexftp obexpushd | aptitude update && aptitude install bluetooth obexftp obexpushd | ||
| + | |||
| + | Por si ascaso listo los paquetes que yo tengo instalados: | ||
| < | < | ||
| Line 53: | Line 95: | ||
| </ | </ | ||
| - | Para rastrear | + | |
| + | |||
| + | |||
| + | ===== Parear los dispositivos | ||
| + | |||
| + | ==== Arch Linux ==== | ||
| + | |||
| + | http://wiki.archlinux.org/ | ||
| + | |||
| + | 1. Lanzar como root el comando(parte del paquete ' | ||
| + | |||
| + | sudo bluez-simple-agent | ||
| + | |||
| + | Si todo va bien, se tiene que ver: | ||
| + | |||
| + | Agent registered | ||
| + | |||
| + | Si aparece algun error de python, reiniciar | ||
| + | |||
| + | sudo / | ||
| + | |||
| + | 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: | ||
| + | |||
| + | * Desde el teléfono | ||
| + | |||
| + | 4.1.1 Situarse en el directorio en el que se quiere recibir los archivos | ||
| + | |||
| + | bluetooth-agent 1234 | ||
| + | |||
| + | 4.1.2 Desde el móvil buscar dispositivos, | ||
| + | |||
| + | * Desde el pc | ||
| + | |||
| + | 4.2.1 Situarse en el directorio en el que se quiere recibir los archivos y escribir: | ||
| + | |||
| + | bluetooth-agent 1234 | ||
| + | |||
| + | 4.2.2 Teclear: | ||
| + | |||
| + | rfcomm connect mac_telefono_movil | ||
| + | |||
| + | Error: | ||
| + | |||
| + | Can't find a config entry for rfcomm0 | ||
| + | |||
| + | Tengo que depurarlo | ||
| + | |||
| + | * Desde el pc 2 (funciona 14/ | ||
| + | |||
| + | 4.3.1 Situarse en el directorio en el que se quiere recibir los archivos y escribir: | ||
| + | |||
| + | bluetooth-agent 1234 | ||
| + | |||
| + | 4.3.2 Desde otra consola averiguar la dirección mac del móvil: | ||
| hcitool scan | hcitool scan | ||
| Line 61: | Line 166: | ||
| 00: | 00: | ||
| </ | </ | ||
| + | |||
| + | 4.3.3 Listar el contenido del móvil (no se si todos los móviles soportan esta opción): | ||
| + | |||
| + | obexftp -b 00: | ||
| + | |||
| + | 4.3.4 En el móvil teclear ' | ||
| ===== Recibir archivos ===== | ===== Recibir archivos ===== | ||
| - | 4. Arrancar el demonio para recibir archivos: | + | 1. Arrancar el demonio para recibir archivos: |
| obexpushd | obexpushd | ||
| - | 5. Hacer visible nuestro dispositivo: | + | 2. Hacer visible nuestro dispositivo: |
| * NO funciona | * NO funciona | ||
| Line 91: | Line 202: | ||
| Tienen que estar presente los valores 'ISCAN PSCAN' | Tienen que estar presente los valores 'ISCAN PSCAN' | ||
| - | 6. Parear los dispositivos | + | 3. Ahora podemos recibir archivos de dos formas: |
| - | * Desde el teléfono móvil | + | * Desde el pc (recomendado, |
| - | 6.1.1 Situarse en el directorio en el que se quiere recibir los archivos | + | 3.1.1 Rastrear dispositivos. Lógicamente hay que habilitar el usb del móvil |
| - | | + | |
| + | < | ||
| + | Scanning ... | ||
| + | 00: | ||
| + | 00: | ||
| + | </ | ||
| - | 6.1.2 Desde el móvil buscar dispositivos, | + | 3.1.2 **NOTA** No se si todos los móviles soportan la capacidad |
| - | * Desde el pc | + | Listar |
| - | 6.2.1 Situarse en el directorio en el que se quiere recibir los archivos y escribir: | + | obexftp -b 00: |
| + | < | ||
| + | Browsing 00: | ||
| + | Connecting..\done | ||
| + | Tried to connect for 27ms | ||
| + | Receiving " | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | <folder name=" | ||
| + | </ | ||
| + | done | ||
| + | Disconnecting../ | ||
| + | </ | ||
| - | bluetooth-agent 1234 | + | En mi caso vemos que el directorio que comparte contiene únicamente otro directorio, ' |
| - | 6.2.2 Teclear: | + | obexftp -b 00: |
| + | < | ||
| + | Browsing 00: | ||
| + | Connecting..\done | ||
| + | Tried to connect for 16ms | ||
| + | Receiving " | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | <file name=" | ||
| + | <file name=" | ||
| + | <file name=" | ||
| + | </ | ||
| + | done | ||
| + | Disconnecting..\done | ||
| + | </ | ||
| - | rfcomm connect mac_telefono_movil | + | 3.1.3 Situarnos en el directorio en el que queramos recibir el archivo: |
| - | Error: | + | cd /tmp/ |
| + | |||
| + | 3.1.4 Recibir el archivo: | ||
| + | |||
| + | obexftp -b 00: | ||
| + | |||
| + | * Desde el móvil | ||
| + | |||
| + | 3.2.1 Seleccionamos el archivo (depende del modelo de móvil el como hacerlo) | ||
| + | |||
| + | 3.2.2 Seleccionar ' | ||
| + | |||
| + | El archivo irá a parar al directorio desde el cual se ejecutó la instrucción ' | ||
| - | Can't find a config entry for rfcomm0 | ||
| - | Tengo que depurarlo | ||
| ===== Enviar archivos ===== | ===== Enviar archivos ===== | ||
| - | 7. Enviar archivos | + | 1. Enviar archivos |
| * Móvil => pc | * Móvil => pc | ||
| Line 131: | Line 285: | ||
| * Pc => móvil | * Pc => móvil | ||
| + | obexftp -b MAC_MOVIL -c DIRECTORIO_REMOTO -p ARCHIVO_LOCAL | ||
| - | | + | o |
| + | |||
| + | | ||
| < | < | ||
| Line 141: | Line 298: | ||
| Disconnecting..-done | Disconnecting..-done | ||
| </ | </ | ||
| + | |||
| + | |||
| + | |||
| + | ===== Gnome applet debian lenny ===== | ||
| + | |||
| + | Módulos instalados: | ||
| + | |||
| + | < | ||
| + | hci_usb | ||
| + | bluetooth | ||
| + | ehci_hcd | ||
| + | uhci_hcd | ||
| + | </ | ||
| + | |||
| + | Paquetes: | ||
| + | |||
| + | < | ||
| + | ii bluetooth | ||
| + | ii bluez-audio | ||
| + | ii bluez-gnome | ||
| + | ii bluez-utils | ||
| + | ii gnome-bluetooth | ||
| + | ii libbluetooth2 | ||
| + | ii gnome-vfs-obexftp | ||
| + | ii libopenobex1 | ||
| + | ii obex-data-server | ||
| + | ii obexftp | ||
| + | ii obexpushd | ||
| + | </ | ||
| + | |||
| + | Servicios corriendo: | ||
| + | |||
| + | < | ||
| + | 3885 ? Ss 1:12 / | ||
| + | 14599 ? Ss 0:00 / | ||
| + | 14612 pts/0 S 0:00 / | ||
| + | 14614 ? S 0:00 / | ||
| + | 14616 ? S 0:00 gnome-obex-server | ||
| + | 14704 pts/0 S 0:00 / | ||
| + | </ | ||
| + | |||
| + | Hay algunos problemillas de instalación: | ||
| + | |||
| + | http:// | ||
| + | |||
| + | ===== Guión para copiar archivos ===== | ||
| + | |||
| + | Pulir una miaja | ||
| + | |||
| + | < | ||
| + | #!/bin/bash | ||
| + | |||
| + | directorio=" | ||
| + | mac=" | ||
| + | |||
| + | rm / | ||
| + | do name=" | ||
| + | echo $name >> / | ||
| + | echo `cat / | ||
| + | obexftp -b $mac -g $directorio/ | ||
| + | </ | ||
| + | |||
| + | ===== beacon ===== | ||
| + | Lanzamos el scan y mientras está el scan el btmon: | ||
| + | hcitool lescan | ||
| + | < | ||
| + | 4A: | ||
| + | 44: | ||
| + | E7: | ||
| + | 42: | ||
| + | 14: | ||
| + | F8: | ||
| + | </ | ||
| + | |||
| + | sudo btmon | ||
| + | < | ||
| + | > 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: | ||
| + | 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) | ||
| + | </ | ||
| + | |||
| + | Para buscar dispositivos que también nos sirve para ver la señal: | ||
| + | sudo btmgmt find | ||
| + | < | ||
| + | Discovery started | ||
| + | hci0 type 7 discovering on | ||
| + | hci0 dev_found: 67: | ||
| + | AD flags 0x1a | ||
| + | eir_len 30 | ||
| + | hci0 dev_found: 73: | ||
| + | AD flags 0x1a | ||
| + | eir_len 30 | ||
| + | hci0 dev_found: 72: | ||
| + | AD flags 0x00 | ||
| + | eir_len 31 | ||
| + | hci0 dev_found: 0F: | ||
| + | AD flags 0x00 | ||
| + | eir_len 31 | ||
| + | hci0 dev_found: 28: | ||
| + | AD flags 0x19 | ||
| + | eir_len 25 | ||
| + | hci0 dev_found: 49: | ||
| + | </ | ||
| + | | ||
| + | |||
informatica/linux/bluetooth.1258220799.txt.gz · Last modified: (external edit)
