Ceci est une ancienne révision du document !
Table des matières
BlueTooth
Lien:
bases
Brancher
Au départ, il n'y a rien:
# hcitool dev Devices:
On branche la clé USB-Bluetooth en reluquant dans le syslog:
Oct 28 11:06:15 nin kernel: usb 2-7.1.4: new full speed USB device using ehci_hcd and address 13 Oct 28 11:06:25 nin kernel: usb 2-7.1.4: configuration #1 chosen from 1 choice Oct 28 11:06:25 nin hcid[21933]: HCI dev 0 registered Oct 28 11:06:25 nin hcid[21933]: Register path:/org/bluez/hci0 fallback:0 Oct 28 11:06:25 nin hcid[21933]: HCI dev 0 up Oct 28 11:06:25 nin hcid[21933]: Device hci0 has been added Oct 28 11:06:25 nin hcid[21933]: Starting security manager 0 Oct 28 11:06:25 nin hcid[21933]: Device hci0 has been activated
Notons le “lag” de 10 secondes entre le branchement et les logs.
Et alors:
# hcitool dev Devices: hci0 00:11:67:36:52:EF
La “config” de la clé Bluetooth:
# hciconfig hci0: Type: USB BD Address: 00:11:67:36:52:EF ACL MTU: 678:8 SCO MTU: 48:10 UP RUNNING PSCAN RX bytes:401 acl:0 sco:0 events:18 errors:0 TX bytes:320 acl:0 sco:0 commands:18 errors:0
Plus d'info:
# hciconfig hci0 -a hci0: Type: USB BD Address: 00:11:67:36:52:EF ACL MTU: 678:8 SCO MTU: 48:10 UP RUNNING PSCAN RX bytes:3362 acl:4 sco:0 events:137 errors:0 TX bytes:1268 acl:4 sco:0 commands:78 errors:0 Features: 0xbf 0xfe 0x8d 0x78 0x08 0x18 0x00 0x00 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 Link policy: RSWITCH HOLD SNIFF PARK Link mode: SLAVE ACCEPT Name: 'nin-0' Class: 0x3e0100 Service Classes: Networking, Rendering, Capturing, Object Transfer, Audio Device Class: Computer, Uncategorized HCI Ver: 1.2 (0x2) HCI Rev: 0x1fe LMP Ver: 1.2 (0x2) LMP Subver: 0x1fe Manufacturer: Integrated System Solution Corp. (57)
Rendons cette clé visible:
# hciconfig hci0 up piscan
Verifions:
# hciconfig hci0 -a hci0: Type: USB BD Address: 00:11:67:36:52:EF ACL MTU: 678:8 SCO MTU: 48:10 UP RUNNING PSCAN ISCAN ...
“ISCAN” ⇒ visible ???
Scan
MacBookPro
Y a t'il des equipements qui emettent sur le réseau “Bluethooth” (prévoir une attente d'une dizaine de secondes)
# hcitool scan Scanning ... 00:1B:63:aa:bb:cc MacBookPro_de_XXXXXX
On en veut plus:
# hcitool inq Inquiring ... 00:1B:63:43:B4:EE clock offset: 0x32a5 class: 0x30210c
La “class” donne le type d'equipement… ici, ce n'est pas un téléphone.
On peut pinguer:
# l2ping 00:1B:63:aa:bb:cc Ping: 00:1B:63:aa:bb:cc from 00:11:67:36:52:EF (data size 44) ... 44 bytes from 00:1B:63:aa:bb:cc id 0 time 195.02ms 44 bytes from 00:1B:63:aa:bb:cc id 1 time 35.50ms 44 bytes from 00:1B:63:aa:bb:cc id 2 time 35.15ms 3 sent, 3 received, 0% loss
On en veut encore plus:
# hcitool info 00:1B:63:aa:bb:cc Requesting information ... BD Address: 00:1B:63:aa:bb:cc Device Name: MacBookPro_de_XXXXXX LMP Version: 2.0 (0x3) LMP Subversion: 0x7ad Manufacturer: Cambridge Silicon Radio (10) Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80 <3-slot packets> <5-slot packets> <encryption> <slot offset> <timing accuracy> <role switch> <hold mode> <sniff mode> <park state> <RSSI> <channel quality> <SCO link> <HV2 packets> <HV3 packets> <u-law log> <A-law log> <CVSD> <paging scheme> <power control> <transparent SCO> <broadcast encrypt> <EDR ACL 2 Mbps> <EDR ACL 3 Mbps> <enhanced iscan> <interlaced iscan> <interlaced pscan> <inquiry with RSSI> <extended SCO> <EV4 packets> <EV5 packets> <AFH cap. slave> <AFH class. slave> <3-slot EDR ACL> <5-slot EDR ACL> <AFH cap. master> <AFH class. master> <EDR eSCO 2 Mbps> <EDR eSCO 3 Mbps> <3-slot EDR eSCO> <extended features>
Comprend rien… normal.
Téléphone
Activons le “Bluetooth” sur un téléphone.
# hcitool scan Scanning ... 00:17:B0:aa:bb:cc XXXXXX 00:0F:DE:16:E3:5C Benouze 00:1B:63:aa:bb:cc MacBookPro_de_XXXXXX
Mon téléphone est “Benouze”.
# hcitool inq Inquiring ... ... 00:0F:DE:16:E3:5C clock offset: 0x678c class: 0x520204 ...
D'aprés linux mag:
- 5(2) ⇒ Object Transfert
- 02 ⇒ Téléphone
- 04 ⇒ Cellulaire
A verifier!
Plus:
# hcitool info 00:0F:DE:16:E3:5C Requesting information ... BD Address: 00:0F:DE:16:E3:5C Device Name: Benouze LMP Version: 1.1 (0x1) LMP Subversion: 0x503 Manufacturer: Ericsson Technology Licensing (0) Features: 0x04 0xca 0x31 0x00 0x00 0x00 0x00 0x00 <encryption> <RSSI> <SCO link> <u-law log> <A-law log> <CVSD>
Il ne fait pas grand chose…
Verifions les services disponibles:
# sdptool browse 00:0F:DE:16:E3:5C | grep "Service Name" Service Name: Dial-up Networking Service Name: Voice gateway Service Name: Serial Port 1 Service Name: Serial Port 2 Service Name: OBEX Object Push Service Name: IrMC Synchronization Service Name: HF Voice gateway Service Name: OBEX Basic Imaging Service Name: OBEX File Transfer
Parfait !
Pairing
hcid.conf
Aprés avoir rendu la clé Bluetooth visible… Le telephone cherche…
Le nom affiché peut être un nom préalablement mémorisé |
Le téléphone trouve “nin-0” se qui correspond bien a la config.
La config /etc/bluetooth/hcid.conf
:
# cat hcid.conf | grep -v "^[[:space:]]*#" options { autoinit yes; security auto; pairing multi; passkey "1234"; pin_helper /etc/bluetooth/echopin; } device { name "%h-%d"; class 0x3e0100; iscan enable; pscan enable; lm accept,master; lp rswitch,hold,sniff,park; }
Ce qui a été modifié:
# security user security auto
#dbus_pin_helper; pin_helper /etc/bluetooth/echopin;
#lm accept; lm accept,master;
pin_helper
Contient le code PIN echangé.
# cd /etc/bluetooth # cat echopin #!/bin/sh echo "PIN:1234"
# chmod a+x echopin
Si ca ne fonctionne pas !
... nin hcid[26678]: pin_code_request (sba=00:11:67:36:52:EF, dba=00:0F:DE:16:E3:5C) ... nin hcid[26678]: call_passkey_agent(): no agent registered
Vérifier le code PIN !
et puis
A un certain moment…
# /etc/init.d/bluetooth restart
pairing
Normalement le telephone doit se joindre avec le serveur “nin-0”
gnokii
Installation
# apt-get update # apt-get install gnokii
configuration
En tant que 'root' et toujours en utilisant une clé Bluetooth.
gnokii ne pourra utiliser le telephone qu'au travers d'un pseudo modem AT C'est pas plus mal puisque ca fonctionne avec plein de telephone ! hu! |
Créé un fichier .gnokiirc
à la racine du Home de l'utilisateur.
Ici, c'est root, donc c'est dans /root/
.
En pratique, on va s'appuyer sur un exemple de la doc:
# zcat /usr/share/doc/gnokii/Docs/sample/gnokiirc.gz > ~/.gnokiirc
Et puis on change quelques lignes: ( # vi ~/.gnokiirc
)
[global] port = 00:0F:DE:16:E3:5C model = AT connection = bluetooth
On ne change pas le reste…
tests
# gnokii --identify gnokiid Version 0.6.14 LOG: debug mask is 0x1 phone instance config: model: AT port_device: 00:0F:DE:16:E3:5C connection_type: 5 init_length: 0 serial_baudrate: 19200 serial_write_usleep: -1 hardware_handshake: 0 require_dcd: 0 smsc_timeout: 100 connect_script: disconnect_script: rfcomm_cn: 1 sm_retry: off Initializing AT capable mobile phone ... Serial device: opening device 00:0F:DE:16:E3:5C Message sent: 0x00 / 0x0004 41 54 5a 0d | ATZ write: [ATZ<cr>] read : [ATZ<cr><cr><lf>OK<cr><lf>] Message received: 0x00 / 0x000a 02 41 54 5a 0d 0d 0a 4f 4b 0d | ATZ OK Received message type 00 Message sent: 0x00 / 0x0005 41 54 45 31 0d | ATE1 write: [ATE1<cr>] read : [ATE1<cr><cr><lf>OK<cr><lf>] Message received: 0x00 / 0x000b 02 41 54 45 31 0d 0d 0a 4f 4b 0d | ATE1 OK Received message type 00 Message sent: 0x00 / 0x000a 41 54 2b 43 4d 45 45 3d 31 0d | AT+CMEE=1 write: [AT+CMEE=1<cr>] read : [AT+CMEE=1<cr><cr><lf>OK<cr><lf>] Message received: 0x00 / 0x0010 02 41 54 2b 43 4d 45 45 3d 31 0d 0d 0a 4f 4b 0d | AT+CMEE=1 OK Received message type 00 Message sent: 0x06 / 0x0008 41 54 2b 43 47 4d 4d 0d | AT+CGMM write: [AT+CGMM<cr>] read : [AT+CGMM<cr><cr><lf>AAB-1021011-BV<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x06 / 0x0020 02 41 54 2b 43 47 4d 4d 0d 0d 0a 41 41 42 2d 31 | AT+CGMM AAB-1 30 32 31 30 31 31 2d 42 56 0d 0a 0d 0a 4f 4b 0d | 021011-BV OK Received message type 06 Message sent: 0x06 / 0x0008 41 54 2b 43 47 4d 49 0d | AT+CGMI write: [AT+CGMI<cr>] read : [AT+CGMI<cr><cr><lf>SONY ERICSSON<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x06 / 0x001f 02 41 54 2b 43 47 4d 49 0d 0d 0a 53 4f 4e 59 20 | AT+CGMI SONY 45 52 49 43 53 53 4f 4e 0d 0a 0d 0a 4f 4b 0d | ERICSSON OK Received message type 06 Message sent: 0x61 / 0x0009 41 54 2b 43 53 43 53 3f 0d | AT+CSCS? write: [AT+CSCS?<cr>] read : [AT+CSCS?<cr><cr><lf>+CSCS: "GSM"<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x61 / 0x001f 02 41 54 2b 43 53 43 53 3f 0d 0d 0a 2b 43 53 43 | AT+CSCS? +CSC 53 3a 20 22 47 53 4d 22 0d 0a 0d 0a 4f 4b 0d | S: "GSM" OK Received message type 61 Initialisation completed Message sent: 0x06 / 0x0008 41 54 2b 43 47 4d 4d 0d | AT+CGMM write: [AT+CGMM<cr>] read : [AT+CGMM<cr><cr><lf>AAB-1021011-BV<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x06 / 0x0020 02 41 54 2b 43 47 4d 4d 0d 0d 0a 41 41 42 2d 31 | AT+CGMM AAB-1 30 32 31 30 31 31 2d 42 56 0d 0a 0d 0a 4f 4b 0d | 021011-BV OK Received message type 06 Message sent: 0x06 / 0x0008 41 54 2b 43 47 4d 49 0d | AT+CGMI write: [AT+CGMI<cr>] read : [AT+CGMI<cr><cr><lf>SONY ERICSSON<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x06 / 0x001f 02 41 54 2b 43 47 4d 49 0d 0d 0a 53 4f 4e 59 20 | AT+CGMI SONY 45 52 49 43 53 53 4f 4e 0d 0a 0d 0a 4f 4b 0d | ERICSSON OK Received message type 06 Message sent: 0x06 / 0x0008 41 54 2b 43 47 4d 52 0d | AT+CGMR write: [AT+CGMR<cr>] read : [AT+CGMR<cr><cr><lf>R4C003 CXC125566^QEU^Q2<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x06 / 0x002c 02 41 54 2b 43 47 4d 52 0d 0d 0a 52 34 43 30 30 | AT+CGMR R4C00 33 20 20 20 20 20 20 43 58 43 31 32 35 35 36 36 | 3 CXC125566 11 45 55 11 32 0d 0a 0d 0a 4f 4b 0d | EU 2 OK Received message type 06 Message sent: 0x06 / 0x0008 41 54 2b 43 47 53 4e 0d | AT+CGSN write: [AT+CGSN<cr>] read : [AT+CGSN<cr><cr><lf>353989002606520<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x06 / 0x0021 02 41 54 2b 43 47 53 4e 0d 0d 0a 33 35 33 39 38 | AT+CGSN 35398 39 30 30 32 36 30 36 35 32 30 0d 0a 0d 0a 4f 4b | 9002606520 OK 0d | Received message type 06 IMEI : XXXXXXXXXXXXXXXXX Fabricant: SONY ERICSSON Modele : AAB-1021011-BV Product name : AAB-1021011-BV Revision : R4C003 CXC1255 Serial device: closing device
Yes !
Mais encore:
# gnokii --monitor once gnokiid Version 0.6.14 LOG: debug mask is 0x1 phone instance config: model: AT port_device: 00:0F:DE:16:E3:5C connection_type: 5 init_length: 0 serial_baudrate: 19200 serial_write_usleep: -1 hardware_handshake: 0 require_dcd: 0 smsc_timeout: 100 connect_script: disconnect_script: rfcomm_cn: 1 sm_retry: off Initializing AT capable mobile phone ... Serial device: opening device 00:0F:DE:16:E3:5C Message sent: 0x00 / 0x0004 41 54 5a 0d | ATZ write: [ATZ<cr>] read : [ATZ<cr><cr><lf>OK<cr><lf>] Message received: 0x00 / 0x000a 02 41 54 5a 0d 0d 0a 4f 4b 0d | ATZ OK Received message type 00 Message sent: 0x00 / 0x0005 41 54 45 31 0d | ATE1 write: [ATE1<cr>] read : [ATE1<cr><cr><lf>OK<cr><lf>] Message received: 0x00 / 0x000b 02 41 54 45 31 0d 0d 0a 4f 4b 0d | ATE1 OK Received message type 00 Message sent: 0x00 / 0x000a 41 54 2b 43 4d 45 45 3d 31 0d | AT+CMEE=1 write: [AT+CMEE=1<cr>] read : [AT+CMEE=1<cr><cr><lf>OK<cr><lf>] Message received: 0x00 / 0x0010 02 41 54 2b 43 4d 45 45 3d 31 0d 0d 0a 4f 4b 0d | AT+CMEE=1 OK Received message type 00 Message sent: 0x06 / 0x0008 41 54 2b 43 47 4d 4d 0d | AT+CGMM write: [AT+CGMM<cr>] read : [AT+CGMM<cr><cr><lf>AAB-1021011-BV<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x06 / 0x0020 02 41 54 2b 43 47 4d 4d 0d 0d 0a 41 41 42 2d 31 | AT+CGMM AAB-1 30 32 31 30 31 31 2d 42 56 0d 0a 0d 0a 4f 4b 0d | 021011-BV OK Received message type 06 Message sent: 0x06 / 0x0008 41 54 2b 43 47 4d 49 0d | AT+CGMI write: [AT+CGMI<cr>] read : [AT+CGMI<cr><cr><lf>SONY ERICSSON<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x06 / 0x001f 02 41 54 2b 43 47 4d 49 0d 0d 0a 53 4f 4e 59 20 | AT+CGMI SONY 45 52 49 43 53 53 4f 4e 0d 0a 0d 0a 4f 4b 0d | ERICSSON OK Received message type 06 Message sent: 0x61 / 0x0009 41 54 2b 43 53 43 53 3f 0d | AT+CSCS? write: [AT+CSCS?<cr>] read : [AT+CSCS?<cr><cr><lf>+CSCS: "GSM"<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x61 / 0x001f 02 41 54 2b 43 53 43 53 3f 0d 0d 0a 2b 43 53 43 | AT+CSCS? +CSC 53 3a 20 22 47 53 4d 22 0d 0a 0d 0a 4f 4b 0d | S: "GSM" OK Received message type 61 Initialisation completed Entree en mode surveillance... Message sent: 0x3c / 0x0009 41 54 2b 43 52 43 3d 31 0d | AT+CRC=1 write: [AT+CRC=1<cr>] read : [AT+CRC=1<cr><cr><lf>OK<cr><lf>] Message received: 0x3c / 0x000f 02 41 54 2b 43 52 43 3d 31 0d 0d 0a 4f 4b 0d | AT+CRC=1 OK Received message type 3c Message sent: 0x0a / 0x0007 41 54 2b 43 53 51 0d | AT+CSQ write: [AT+CSQ<cr>] read : [AT+CSQ<cr><cr><lf>+CSQ: 12,99<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x0a / 0x001c 02 41 54 2b 43 53 51 0d 0d 0a 2b 43 53 51 3a 20 | AT+CSQ +CSQ: 31 32 2c 39 39 0d 0a 0d 0a 4f 4b 0d | 12,99 OK Received message type 0a Niveau RF: 12 Message sent: 0x09 / 0x0007 41 54 2b 43 42 43 0d | AT+CBC write: [AT+CBC<cr>] read : [AT+CBC<cr><cr><lf>+CBC: 1,100<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x09 / 0x001c 02 41 54 2b 43 42 43 0d 0d 0a 2b 43 42 43 3a 20 | AT+CBC +CBC: 31 2c 31 30 30 0d 0a 0d 0a 4f 4b 0d | 1,100 OK Received message type 09 Batterie: 100 Message sent: 0x09 / 0x0007 41 54 2b 43 42 43 0d | AT+CBC write: [AT+CBC<cr>] read : [AT+CBC<cr><cr><lf>+CBC: 1,100<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x09 / 0x001c 02 41 54 2b 43 42 43 0d 0d 0a 2b 43 42 43 3a 20 | AT+CBC +CBC: 31 2c 31 30 30 0d 0a 0d 0a 4f 4b 0d | 1,100 OK Received message type 09 Source d'energie: Batterie Message sent: 0x00 / 0x000d 41 54 2b 43 50 42 53 3d 22 53 4d 22 0d | AT+CPBS="SM" write: [AT+CPBS="SM"<cr>] read : [AT+CPBS="SM"<cr><cr><lf>OK<cr><lf>] Message received: 0x00 / 0x0013 02 41 54 2b 43 50 42 53 3d 22 53 4d 22 0d 0d 0a | AT+CPBS="SM" 4f 4b 0d | OK Received message type 00 Message sent: 0x65 / 0x000a 41 54 2b 43 50 42 52 3d 3f 0d | AT+CPBR=? write: [AT+CPBR=?<cr>] read : [AT+CPBR=?<cr><cr><lf>+CPBR: (1-250),80,14<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x65 / 0x0028 02 41 54 2b 43 50 42 52 3d 3f 0d 0d 0a 2b 43 50 | AT+CPBR=? +CP 42 52 3a 20 28 31 2d 32 35 30 29 2c 38 30 2c 31 | BR: (1-250),80,1 34 0d 0a 0d 0a 4f 4b 0d | 4 OK Received message type 65 Message sent: 0x0c / 0x0009 41 54 2b 43 50 42 53 3f 0d | AT+CPBS? write: [AT+CPBS?<cr>] read : [AT+CPBS?<cr><cr><lf>+CPBS: "SM"<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x0c / 0x001e 02 41 54 2b 43 50 42 53 3f 0d 0d 0a 2b 43 50 42 | AT+CPBS? +CPB 53 3a 20 22 53 4d 22 0d 0a 0d 0a 4f 4b 0d | S: "SM" OK Received message type 0c Message sent: 0x00 / 0x000d 41 54 2b 43 50 42 53 3d 22 4d 45 22 0d | AT+CPBS="ME" write: [AT+CPBS="ME"<cr>] read : [AT+CPBS="ME"<cr><cr><lf>OK<cr><lf>] Message received: 0x00 / 0x0013 02 41 54 2b 43 50 42 53 3d 22 4d 45 22 0d 0d 0a | AT+CPBS="ME" 4f 4b 0d | OK Received message type 00 Message sent: 0x65 / 0x000a 41 54 2b 43 50 42 52 3d 3f 0d | AT+CPBR=? write: [AT+CPBR=?<cr>] read : [AT+CPBR=?<cr><cr><lf>+CPBR: (1-510),80,180<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x65 / 0x0029 02 41 54 2b 43 50 42 52 3d 3f 0d 0d 0a 2b 43 50 | AT+CPBR=? +CP 42 52 3a 20 28 31 2d 35 31 30 29 2c 38 30 2c 31 | BR: (1-510),80,1 38 30 0d 0a 0d 0a 4f 4b 0d | 80 OK Received message type 65 Message sent: 0x0c / 0x0009 41 54 2b 43 50 42 53 3f 0d | AT+CPBS? write: [AT+CPBS?<cr>] read : [AT+CPBS?<cr><cr><lf>+CPBS: "ME"<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x0c / 0x001e 02 41 54 2b 43 50 42 53 3f 0d 0d 0a 2b 43 50 42 | AT+CPBS? +CPB 53 3a 20 22 4d 45 22 0d 0a 0d 0a 4f 4b 0d | S: "ME" OK Received message type 0c Message sent: 0x00 / 0x000d 41 54 2b 43 50 42 53 3d 22 44 43 22 0d | AT+CPBS="DC" write: [AT+CPBS="DC"<cr>] read : [AT+CPBS="DC"<cr><cr><lf>OK<cr><lf>] Message received: 0x00 / 0x0013 02 41 54 2b 43 50 42 53 3d 22 44 43 22 0d 0d 0a | AT+CPBS="DC" 4f 4b 0d | OK Received message type 00 Message sent: 0x65 / 0x000a 41 54 2b 43 50 42 52 3d 3f 0d | AT+CPBR=? write: [AT+CPBR=?<cr>] read : [AT+CPBR=?<cr><cr><lf>+CPBR: (1-30),80,180<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x65 / 0x0028 02 41 54 2b 43 50 42 52 3d 3f 0d 0d 0a 2b 43 50 | AT+CPBR=? +CP 42 52 3a 20 28 31 2d 33 30 29 2c 38 30 2c 31 38 | BR: (1-30),80,18 30 0d 0a 0d 0a 4f 4b 0d | 0 OK Received message type 65 Message sent: 0x0c / 0x0009 41 54 2b 43 50 42 53 3f 0d | AT+CPBS? write: [AT+CPBS?<cr>] read : [AT+CPBS?<cr><cr><lf>+CPBS: "DC"<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x0c / 0x001e 02 41 54 2b 43 50 42 53 3f 0d 0d 0a 2b 43 50 42 | AT+CPBS? +CPB 53 3a 20 22 44 43 22 0d 0a 0d 0a 4f 4b 0d | S: "DC" OK Received message type 0c Message sent: 0x00 / 0x000d 41 54 2b 43 50 42 53 3d 22 45 4e 22 0d | AT+CPBS="EN" write: [AT+CPBS="EN"<cr>] read : [^@^Y+CPBS="EN"<cr><cr><lf>+CME ERROR: 25<cr><lf>] Message received: 0x00 / 0x001f 05 00 19 2b 43 50 42 53 3d 22 45 4e 22 0d 0d 0a | +CPBS="EN" 2b 43 4d 45 20 45 52 52 4f 52 3a 20 32 35 0d | +CME ERROR: 25 Received message type 00 Message sent: 0x65 / 0x000a 41 54 2b 43 50 42 52 3d 3f 0d | AT+CPBR=? write: [AT+CPBR=?<cr>] read : [AT+CPBR=?<cr><cr><lf>+CPBR: (1-30),80,180<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x65 / 0x0028 02 41 54 2b 43 50 42 52 3d 3f 0d 0d 0a 2b 43 50 | AT+CPBR=? +CP 42 52 3a 20 28 31 2d 33 30 29 2c 38 30 2c 31 38 | BR: (1-30),80,18 30 0d 0a 0d 0a 4f 4b 0d | 0 OK Received message type 65 Message sent: 0x0c / 0x0009 41 54 2b 43 50 42 53 3f 0d | AT+CPBS? write: [AT+CPBS?<cr>] read : [AT+CPBS?<cr><cr><lf>+CPBS: "DC"<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x0c / 0x001e 02 41 54 2b 43 50 42 53 3f 0d 0d 0a 2b 43 50 42 | AT+CPBS? +CPB 53 3a 20 22 44 43 22 0d 0a 0d 0a 4f 4b 0d | S: "DC" OK Received message type 0c Message sent: 0x00 / 0x000d 41 54 2b 43 50 42 53 3d 22 46 44 22 0d | AT+CPBS="FD" write: [AT+CPBS="FD"<cr>] read : [^@^P+CPBS="FD"<cr><cr><lf>+CME ERROR: 16<cr><lf>] Message received: 0x00 / 0x001f 05 00 10 2b 43 50 42 53 3d 22 46 44 22 0d 0d 0a | +CPBS="FD" 2b 43 4d 45 20 45 52 52 4f 52 3a 20 31 36 0d | +CME ERROR: 16 Received message type 00 Message sent: 0x65 / 0x000a 41 54 2b 43 50 42 52 3d 3f 0d | AT+CPBR=? write: [AT+CPBR=?<cr>] read : [AT+CPBR=?<cr><cr><lf>+CPBR: (1-30),80,180<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x65 / 0x0028 02 41 54 2b 43 50 42 52 3d 3f 0d 0d 0a 2b 43 50 | AT+CPBR=? +CP 42 52 3a 20 28 31 2d 33 30 29 2c 38 30 2c 31 38 | BR: (1-30),80,18 30 0d 0a 0d 0a 4f 4b 0d | 0 OK Received message type 65 Message sent: 0x0c / 0x0009 41 54 2b 43 50 42 53 3f 0d | AT+CPBS? write: [AT+CPBS?<cr>] read : [AT+CPBS?<cr><cr><lf>+CPBS: "DC"<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x0c / 0x001e 02 41 54 2b 43 50 42 53 3f 0d 0d 0a 2b 43 50 42 | AT+CPBS? +CPB 53 3a 20 22 44 43 22 0d 0a 0d 0a 4f 4b 0d | S: "DC" OK Received message type 0c Message sent: 0x00 / 0x000d 41 54 2b 43 50 42 53 3d 22 4c 44 22 0d | AT+CPBS="LD" write: [AT+CPBS="LD"<cr>] read : [AT+CPBS="LD"<cr><cr><lf>OK<cr><lf>] Message received: 0x00 / 0x0013 02 41 54 2b 43 50 42 53 3d 22 4c 44 22 0d 0d 0a | AT+CPBS="LD" 4f 4b 0d | OK Received message type 00 Message sent: 0x65 / 0x000a 41 54 2b 43 50 42 52 3d 3f 0d | AT+CPBR=? write: [AT+CPBR=?<cr>] read : [AT+CPBR=?<cr><cr><lf>+CPBR: (1-5),80,180<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x65 / 0x0027 02 41 54 2b 43 50 42 52 3d 3f 0d 0d 0a 2b 43 50 | AT+CPBR=? +CP 42 52 3a 20 28 31 2d 35 29 2c 38 30 2c 31 38 30 | BR: (1-5),80,180 0d 0a 0d 0a 4f 4b 0d | OK Received message type 65 Message sent: 0x0c / 0x0009 41 54 2b 43 50 42 53 3f 0d | AT+CPBS? write: [AT+CPBS?<cr>] read : [AT+CPBS?<cr><cr><lf>+CPBS: "LD"<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x0c / 0x001e 02 41 54 2b 43 50 42 53 3f 0d 0d 0a 2b 43 50 42 | AT+CPBS? +CPB 53 3a 20 22 4c 44 22 0d 0a 0d 0a 4f 4b 0d | S: "LD" OK Received message type 0c Message sent: 0x00 / 0x000d 41 54 2b 43 50 42 53 3d 22 4d 43 22 0d | AT+CPBS="MC" write: [AT+CPBS="MC"<cr>] read : [AT+CPBS="MC"<cr><cr><lf>OK<cr><lf>] Message received: 0x00 / 0x0013 02 41 54 2b 43 50 42 53 3d 22 4d 43 22 0d 0d 0a | AT+CPBS="MC" 4f 4b 0d | OK Received message type 00 Message sent: 0x65 / 0x000a 41 54 2b 43 50 42 52 3d 3f 0d | AT+CPBR=? write: [AT+CPBR=?<cr>] read : [AT+CPBR=?<cr><cr><lf>+CPBR: (1-30),80,180<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x65 / 0x0028 02 41 54 2b 43 50 42 52 3d 3f 0d 0d 0a 2b 43 50 | AT+CPBR=? +CP 42 52 3a 20 28 31 2d 33 30 29 2c 38 30 2c 31 38 | BR: (1-30),80,18 30 0d 0a 0d 0a 4f 4b 0d | 0 OK Received message type 65 Message sent: 0x0c / 0x0009 41 54 2b 43 50 42 53 3f 0d | AT+CPBS? write: [AT+CPBS?<cr>] read : [AT+CPBS?<cr><cr><lf>+CPBS: "MC"<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x0c / 0x001e 02 41 54 2b 43 50 42 53 3f 0d 0d 0a 2b 43 50 42 | AT+CPBS? +CPB 53 3a 20 22 4d 43 22 0d 0a 0d 0a 4f 4b 0d | S: "MC" OK Received message type 0c Message sent: 0x00 / 0x000d 41 54 2b 43 50 42 53 3d 22 4f 4e 22 0d | AT+CPBS="ON" write: [AT+CPBS="ON"<cr>] read : [^@^Y+CPBS="ON"<cr><cr><lf>+CME ERROR: 25<cr><lf>] Message received: 0x00 / 0x001f 05 00 19 2b 43 50 42 53 3d 22 4f 4e 22 0d 0d 0a | +CPBS="ON" 2b 43 4d 45 20 45 52 52 4f 52 3a 20 32 35 0d | +CME ERROR: 25 Received message type 00 Message sent: 0x65 / 0x000a 41 54 2b 43 50 42 52 3d 3f 0d | AT+CPBR=? write: [AT+CPBR=?<cr>] read : [AT+CPBR=?<cr><cr><lf>+CPBR: (1-30),80,180<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x65 / 0x0028 02 41 54 2b 43 50 42 52 3d 3f 0d 0d 0a 2b 43 50 | AT+CPBR=? +CP 42 52 3a 20 28 31 2d 33 30 29 2c 38 30 2c 31 38 | BR: (1-30),80,18 30 0d 0a 0d 0a 4f 4b 0d | 0 OK Received message type 65 Message sent: 0x0c / 0x0009 41 54 2b 43 50 42 53 3f 0d | AT+CPBS? write: [AT+CPBS?<cr>] read : [AT+CPBS?<cr><cr><lf>+CPBS: "MC"<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x0c / 0x001e 02 41 54 2b 43 50 42 53 3f 0d 0d 0a 2b 43 50 42 | AT+CPBS? +CPB 53 3a 20 22 4d 43 22 0d 0a 0d 0a 4f 4b 0d | S: "MC" OK Received message type 0c Message sent: 0x00 / 0x000d 41 54 2b 43 50 42 53 3d 22 52 43 22 0d | AT+CPBS="RC" write: [AT+CPBS="RC"<cr>] read : [AT+CPBS="RC"<cr><cr><lf>OK<cr><lf>] Message received: 0x00 / 0x0013 02 41 54 2b 43 50 42 53 3d 22 52 43 22 0d 0d 0a | AT+CPBS="RC" 4f 4b 0d | OK Received message type 00 Message sent: 0x65 / 0x000a 41 54 2b 43 50 42 52 3d 3f 0d | AT+CPBR=? write: [AT+CPBR=?<cr>] read : [AT+CPBR=?<cr><cr><lf>+CPBR: (1-30),80,180<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x65 / 0x0028 02 41 54 2b 43 50 42 52 3d 3f 0d 0d 0a 2b 43 50 | AT+CPBR=? +CP 42 52 3a 20 28 31 2d 33 30 29 2c 38 30 2c 31 38 | BR: (1-30),80,18 30 0d 0a 0d 0a 4f 4b 0d | 0 OK Received message type 65 Message sent: 0x0c / 0x0009 41 54 2b 43 50 42 53 3f 0d | AT+CPBS? write: [AT+CPBS?<cr>] read : [AT+CPBS?<cr><cr><lf>+CPBS: "RC"<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x0c / 0x001e 02 41 54 2b 43 50 42 53 3f 0d 0d 0a 2b 43 50 42 | AT+CPBS? +CPB 53 3a 20 22 52 43 22 0d 0a 0d 0a 4f 4b 0d | S: "RC" OK Received message type 0c Message sent: 0x12 / 0x0009 41 54 2b 43 50 4d 53 3f 0d | AT+CPMS? write: [AT+CPMS?<cr>] read : [AT+CPMS?<cr><cr><lf>+CPMS: "SM",0,30,"SM",0,30,"ME",0,70<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x12 / 0x0037 02 41 54 2b 43 50 4d 53 3f 0d 0d 0a 2b 43 50 4d | AT+CPMS? +CPM 53 3a 20 22 53 4d 22 2c 30 2c 33 30 2c 22 53 4d | S: "SM",0,30,"SM 22 2c 30 2c 33 30 2c 22 4d 45 22 2c 30 2c 37 30 | ",0,30,"ME",0,70 0d 0a 0d 0a 4f 4b 0d | OK Received message type 12 Message sent: 0x00 / 0x0017 41 54 2b 43 50 4d 53 3d 22 52 43 22 2c 22 52 43 | AT+CPMS="RC","RC 22 2c 22 4d 45 22 0d | ","ME" write: [AT+CPMS="RC","RC","ME"<cr>] read : [^AA+CPMS="RC","RC","ME"<cr><cr><lf>+CMS ERROR: 321<cr><lf>] Message received: 0x00 / 0x002a 04 01 41 2b 43 50 4d 53 3d 22 52 43 22 2c 22 52 | A+CPMS="RC","R 43 22 2c 22 4d 45 22 0d 0d 0a 2b 43 4d 53 20 45 | C","ME" +CMS E 52 52 4f 52 3a 20 33 32 31 0d | RROR: 321 Received message type 00 Message sent: 0x14 / 0x000a 41 54 2b 43 52 45 47 3d 32 0d | AT+CREG=2 write: [AT+CREG=2<cr>] read : [^@^D+CREG=2<cr><cr><lf>+CME ERROR: 4<cr><lf>] Message received: 0x14 / 0x001b 05 00 04 2b 43 52 45 47 3d 32 0d 0d 0a 2b 43 4d | +CREG=2 +CM 45 20 45 52 52 4f 52 3a 20 34 0d | E ERROR: 4 Received message type 14 Message sent: 0x14 / 0x0009 41 54 2b 43 52 45 47 3f 0d | AT+CREG? write: [AT+CREG?<cr>] read : [AT+CREG?<cr><cr><lf>+CREG: 0,1<cr><lf><cr><lf>OK<cr><lf>] Message received: 0x14 / 0x001d 02 41 54 2b 43 52 45 47 3f 0d 0d 0a 2b 43 52 45 | AT+CREG? +CRE 47 3a 20 30 2c 31 0d 0a 0d 0a 4f 4b 0d | G: 0,1 OK Received message type 14 strings[0] = +CREG: 0 strings[1] = 1 strings[2] = (null) strings[3] = (null) Appel0: inactif Appel1: inactif Sortie du mode surveillance... Serial device: closing device
Envoi SMS
# echo "Hello Ducon" | gnokii --sendsms +3360721abcd
Yes !
N80/N81
Problème
Problème… gnokii ne fonctionne pas avec… grrr
# sdptool browse 00:12:D2:CC:B8:8B | grep "Service Name" Service Name: AVRCP Target Service Name: Hands-Free Audio Gateway Service Name: Headset Audio Gateway Service Name: SyncMLClient Service Name: OBEX File Transfer Service Name: Nokia OBEX PC Suite Services Service Name: Nokia SyncML Server Service Name: OBEX Object Push Service Name: Dial-Up Networking Service Name: Imaging
Et pourtant:
$ obexftp -b 00:12:D2:CC:B8:8B -l Browsing 00:12:D2:CC:B8:8B ... Channel: 11 Connecting...done Receiving "(null)"... <?xml version="1.0"?> <!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd" [ <!ATTLIST folder mem-type CDATA #IMPLIED> <!ATTLIST folder label CDATA #IMPLIED> ]> <folder-listing version="1.0"> <folder name="C:" user-perm="RW" mem-type="DEV" label="Mémoire du téléphone"/> <folder name="E:" user-perm="RW" mem-type="MMC" label="Carte mém"/> </folder-listing>done Disconnecting...done
Soluce ?
Editer le fichier /etc/bluetooth/rfcomm.conf
afin d'avoir:
# # RFCOMM configuration file. # rfcomm0 { # Automatically bind the device at startup bind yes;
# Bluetooth address of the device device 00:12:D2:CC:B8:8B;
# RFCOMM channel for the connection channel 1;
# Description of the connection comment "Example Bluetooth device"; }
Et puis:
# /etc/init.d/bluetooth restart
Et là, un device apparait:
/dev/rfcomm0
Parce qu'il a vu le N80 branché ?