Outils pour utilisateurs

Outils du site


brouillon_bluetooth

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
Dernière révisionLes deux révisions suivantes
brouillon_bluetooth [2008/10/28 11:16] thierrybrouillon_bluetooth [2009/02/01 17:51] thierry
Ligne 3: Ligne 3:
   *http://www.meeus-d.be/linux/bluetooth.html   *http://www.meeus-d.be/linux/bluetooth.html
   *http://www.nerux.org/index.php/Bluetooth_irda   *http://www.nerux.org/index.php/Bluetooth_irda
-  *http://www.developershome.com/sms/smsLinux.asp+  *http://www.developershome.com/sms/ 
 +  *http://www.michaelwood.me.uk/wordpress/2007/03/ 
 + 
 ===== bases ===== ===== bases =====
  
Ligne 151: Ligne 154:
   Service Name: OBEX File Transfer   Service Name: OBEX File Transfer
 Parfait ! Parfait !
 +
 +
  
  
 ==== Pairing ==== ==== Pairing ====
 +
 +=== hcid.conf ===
 +
 Aprés avoir rendu la clé Bluetooth visible... Le telephone cherche... Aprés avoir rendu la clé Bluetooth visible... Le telephone cherche...
 | :!: Le nom affiché peut être un nom préalablement mémorisé | | :!: 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 dans **''/etc/bluetooth/hcid.conf''** :\\+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:]]*#"   # cat hcid.conf | grep -v "^[[:space:]]*#"
      
Ligne 185: Ligne 195:
  
 Ce qui a été modifié: Ce qui a été modifié:
-  security+  security user 
 +  security auto
  
-  ... +  #dbus_pin_helper; 
-  Local device name +  pin_helper /etc/bluetooth/echopin; 
-  #   %d - device id + 
-  #   %h - host name +  #lm accept;
-  name "%h-%d"; +
-Dans le même fichier, ne pas oublier la ligne:+
   lm accept,master;   lm accept,master;
  
-Mais ca ne fonctionne pas !+=== 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]: 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    ... nin hcid[26678]: call_passkey_agent(): no agent registered
-Uh!\\ +Vérifier le code PIN ! 
-Et pourtant, on mis le code+ 
 +=== 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:
 +  init_length:
 +  serial_baudrate: 19200 
 +  serial_write_usleep: -1 
 +  hardware_handshake:
 +  require_dcd:
 +  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 
 +   
 +  .. <snip> ... 
 +   
 +  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:
 +  init_length:
 +  serial_baudrate: 19200 
 +  serial_write_usleep: -1 
 +  hardware_handshake:
 +  require_dcd:
 +  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 
 +   
 +  ... <snip> ... 
 +   
 +  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 2; 
 +   
 +        # Description of the connection 
 +        comment "Example Bluetooth device"; 
 +  } 
 + 
 +| :!: "channel 2" et pas autre chose! pourquoi ? mystère! et pas de rapport évident avec ".gnokiirc" ... | 
 + 
 +Et puis: 
 +  # /etc/init.d/bluetooth restart 
 +  Restarting bluetooth: hcid sdpd rfcomm. 
 +Et làun device apparait: 
 +  /dev/rfcomm0 
 +Parce qu'il vu le N80 branché ? 
 + 
 +Editer **''.gnokiirc''** (toujours a la racine de la home de votre user), afin d'avoir: 
 +  [global] 
 +  port = /dev/rfcomm0 
 +  model = AT 
 +  connection = serial 
 +   
 +  rfcomm_channel = 2 
 +(Ne pas toucher le reste) 
 + 
 +Et puis ca marche. 
 + 
 + 
 + 
 +====== Internet Nokia Orange ====== 
 + 
 +Lien: http://www.equinoxefr.org/post/2008/07/02/ubuntu-3g-et-nokia-n95-avec-orange/ 
 + 
 + 
 +===== brancher ===== 
 +Brancher par cable USB au eeePC... sur le Nokia, choisir "PC SUITE"
 + 
 +Dans les logs on voit ça: 
 + 
 +  Feb  1 17:58:20 tj-eeePC kernel: [   63.665586] usb 1-2: new full speed USB device using uhci_hcd and address 2 
 +  Feb  1 17:58:20 tj-eeePC kernel: [   63.669892] usb 1-2: configuration #1 chosen from 1 choice 
 +  Feb  1 17:58:20 tj-eeePC NetworkManager: <debug> [1233507500.386933] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_421_4f0_noserial'). 
 +  Feb  1 17:58:22 tj-eeePC NetworkManager: <debug> [1233507502.211950] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_421_4f0_noserial_if0'). 
 +  Feb  1 17:58:22 tj-eeePC kernel: [   65.700553] cdc_acm 1-2:1.10: ttyACM0: USB ACM device 
 +  Feb  1 17:58:22 tj-eeePC kernel: [   65.707535] usbcore: registered new interface driver cdc_acm 
 +  Feb  1 17:58:22 tj-eeePC kernel: [   65.708052] /build/buildd/linux-2.6.24/drivers/usb/class/cdc-acm.c: v0.25:USB Abstract Control Model driver for USB modems and ISDN adapters 
 +  Feb  1 17:58:22 tj-eeePC NetworkManager: <debug> [1233507502.459817] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_421_4f0_noserial_if1'). 
 +  Feb  1 17:58:22 tj-eeePC kernel: [   65.763344] usbcore: registered new interface driver cdc_ether 
 +  Feb  1 17:58:22 tj-eeePC kernel: [   65.770646] usb 1-2: bad CDC descriptors 
 +  Feb  1 17:58:22 tj-eeePC kernel: [   65.771110] usbcore: registered new interface driver rndis_host 
 +  ... <snip> ... 
 + 
 + 
 +===== wvdial ===== 
 + 
 +==== installer ==== 
 +Il faut installer "wvdial" , car ce qui va etablir la connexion "PPP" over Nokia. 
 + 
 +  # aptitude update 
 +  # aptitude install wvdial 
 + 
 +==== configurer ==== 
 +Preparer la configuration en apportant les modifications suivantes dans **''/etc/wvdial.conf''** : 
 +  [Dialer Defaults] 
 +  Modem = /dev/ttyACM0 
 +  Baud = 460800 
 +  Init1 = ATZ 
 +  Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 
 +  Init5 = AT+CGDCONT=1,”IP”,”orange”; 
 +  ISDN = 0 
 +  Modem Type = Analog Modem 
 +  Phone = *99***1# 
 +  username = orange 
 +  password = orange 
 +  Stupid Mode = 1 
 + 
 +==== connecter ==== 
 +Dans un terminal: 
 +  $ pon.wvdial 
 +(sinon: ''$ sudo wvdial''
 +==== deconnecter ==== 
 +Dans un autre terminal: 
 +  $ poff.wvdial 
 + 
 +==== log ==== 
 +  $ plog 
 + 
 +===== Conclusion ===== 
 +Ca marche super !
  
- +Reste a voir les surprises avec la facturation !!! :-\
brouillon_bluetooth.txt · Dernière modification : 2009/02/01 17:55 de thierry