Bluetooth - connexion GSM / Raspberry

Piloter son installation depuis son smartphone, envoyer ou recevoir des SMS d'alerte... C'est ici !

Modérateur : Francois

Répondre
litteul
Messages : 14
Enregistré le : ven. 6 janv. 2017 22:21

Bluetooth - connexion GSM / Raspberry

Message par litteul » dim. 8 janv. 2017 10:50

Bonjour,

je projette de monter un système multimédia pour camping car. En tant que serveur de développement, je me suis monter une Debian sur Virtualbox (l'idée est d'avoir un serveur de développement le plus proche possible de Raspbian).

Mon soucis d'aujourd'hui est la connexion Bluetooth de mon téléphone avec mon serveur, pour faire un système kit main libre.

J'arrive bien à connecter mon téléphone à mon serveur et lire les services téléphone disponible à partir de mon serveur (utilisation de hcitool + bluetoothctl) :

[code]
root@Dev-Debian:~# hcitool scan
Scanning ...
9C:D2:1E:F7:EC:C0 TASSIN-PC
38:D4:0B:AE:25:F2 Freddy galaxy
root@Dev-Debian:~# rfkill unblock bluetooth
root@Dev-Debian:~# hciconfig hci0 up
root@Dev-Debian:~# bluetoothctl
[NEW] Controller 3C:15:C2:E4:55:E1 Dev-Debian [default]
[NEW] Device 38:D4:0B:AE:25:F2 Freddy galaxy
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# agent on
Agent registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# discoverable on
Changing discoverable on succeeded
[CHG] Controller 3C:15:C2:E4:55:E1 Discoverable: yes
[bluetooth]# pairable on
Changing pairable on succeeded
[bluetooth]# scan on
Discovery started
[CHG] Controller 3C:15:C2:E4:55:E1 Discovering: yes
[bluetooth]# devices
Device 38:D4:0B:AE:25:F2 Freddy galaxy
[NEW] Device 9C:D2:1E:F7:EC:C0 TASSIN-PC
[CHG] Device 38:D4:0B:AE:25:F2 RSSI: -55
[bluetooth]# trust 38:D4:0B:AE:25:F2
Changing 38:D4:0B:AE:25:F2 trust succeeded
[bluetooth]# connect 38:D4:0B:AE:25:F2
Attempting to connect to 38:D4:0B:AE:25:F2
[CHG] Device 38:D4:0B:AE:25:F2 Connected: yes
Connection successful
[bluetooth]# info 38:D4:0B:AE:25:F2
Device 38:D4:0B:AE:25:F2
Name: Freddy galaxy
Alias: Freddy galaxy
Class: 0x5a020c
Icon: phone
Paired: yes
Trusted: yes
Blocked: no
Connected: yes
LegacyPairing: no
UUID: OBEX Object Push (00001105-0000-1000-8000-00805f9b34fb)
UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: Headset AG (00001112-0000-1000-8000-00805f9b34fb)
UUID: PANU (00001115-0000-1000-8000-00805f9b34fb)
UUID: NAP (00001116-0000-1000-8000-00805f9b34fb)
UUID: Handsfree Audio Gateway (0000111f-0000-1000-8000-00805f9b34fb)
UUID: SIM Access (0000112d-0000-1000-8000-00805f9b34fb)
UUID: Phonebook Access Server (0000112f-0000-1000-8000-00805f9b34fb)
UUID: Message Access Server (00001132-0000-1000-8000-00805f9b34fb)
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
Modalias: bluetooth:v0075p0100d0200
[bluetooth]# quit
Agent unregistered
[DEL] Controller 3C:15:C2:E4:55:E1 Dev-Debian [default]
root@Dev-Debian:~# sdptool browse 38:D4:0B:AE:25:F2
Browsing 38:D4:0B:AE:25:F2 ...
Service RecHandle: 0x10000
Service Class ID List:
"Generic Attribute" (0x1801)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 31
"ATT" (0x0007)
uint16: 0x0001
uint16: 0x0005

Service RecHandle: 0x10001
Service Class ID List:
"Generic Access" (0x1800)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 31
"ATT" (0x0007)
uint16: 0x0014
uint16: 0x001e

Service Name: AV Remote Control Target
Service RecHandle: 0x10002
Service Class ID List:
"AV Remote Target" (0x110c)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 23
"AVCTP" (0x0017)
uint16: 0x0104
Profile Descriptor List:
"AV Remote" (0x110e)
Version: 0x0104

Service Name: Advanced Audio
Service RecHandle: 0x10003
Service Class ID List:
"Audio Source" (0x110a)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 25
"AVDTP" (0x0019)
uint16: 0x0102
Profile Descriptor List:
"Advanced Audio" (0x110d)
Version: 0x0102

Service Name: Headset Gateway
Service RecHandle: 0x10004
Service Class ID List:
"Headset Audio Gateway" (0x1112)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 2
Profile Descriptor List:
"Headset" (0x1108)
Version: 0x0102

Service Name: Handsfree Gateway
Service RecHandle: 0x10005
Service Class ID List:
"Handsfree Audio Gateway" (0x111f)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 3
Profile Descriptor List:
"Handsfree" (0x111e)
Version: 0x0106

Service Name: Sim Access Server
Service RecHandle: 0x10006
Service Class ID List:
"SIM Access" (0x112d)
"Generic Telephony" (0x1204)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 4
Profile Descriptor List:
"SIM Access" (0x112d)
Version: 0x0102

Service Name: Android Network Access Point
Service Description: NAP
Service RecHandle: 0x10007
Service Class ID List:
"Network Access Point" (0x1116)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 15
"BNEP" (0x000f)
Version: 0x0100
SEQ8: 0 6
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Network Access Point" (0x1116)
Version: 0x0100

Service Name: Android Network User
Service Description: PANU
Service RecHandle: 0x10008
Service Class ID List:
"PAN User" (0x1115)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 15
"BNEP" (0x000f)
Version: 0x0100
SEQ8: 0 6
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"PAN User" (0x1115)
Version: 0x0100

Service Name: OBEX Phonebook Access Server
Service RecHandle: 0x1000a
Service Class ID List:
"Phonebook Access - PSE" (0x112f)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 19
"OBEX" (0x0008)
Profile Descriptor List:
"Phonebook Access" (0x1130)
Version: 0x0101

Service Name: SMS/MMS Message Access
Service RecHandle: 0x1000b
Service Class ID List:
"Message Access - MAS" (0x1132)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 5
"OBEX" (0x0008)
Profile Descriptor List:
"Message Access" (0x1134)
Version: 0x0101

Service Name: OBEX Object Push
Service RecHandle: 0x1000c
Service Class ID List:
"OBEX Object Push" (0x1105)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 12
"OBEX" (0x0008)
Profile Descriptor List:
"OBEX Object Push" (0x1105)
Version: 0x0100
[/code]

Mon problème est que maintenant je n'arrive pas à trouver quoi faire pour m'abonner aux services proposés et échanger des commandes avec le téléphone...

J'ai essayer des commandes du types :
[code]freddy@Dev-Debian:~$ rfcomm connect /dev/rfcomm0 38:D4:0B:AE:25:F2 5
Connected /dev/rfcomm0 to 38:D4:0B:AE:25:F2 on channel 5
Press CTRL-C for hangup
[/code]
mais rien ne se passe lorsque je tape des commandes à la suite de la dernière ligne (commande du genre AT+GMGF=?)
[code]root@Dev-Debian:~# rfcomm connect /dev/rfcomm0 38:D4:0B:AE:25:F2 5
Connected /dev/rfcomm0 to 38:D4:0B:AE:25:F2 on channel 5
Press CTRL-C for hangup
AT+CMGF=?
[/code]
j'ai essayé la même chose en utilisant minicom (mini nom -D /dev/rfcomm0 9600), mais rien ne passe non plus... (pas de retour chariot non plus).

Pourriez m'aiguiller sur la marche à suivre post connexion ?

D'avance merci pour votre aide.

A bientôt,
Freddy.

Répondre

Retourner vers « Téléphonie et télécommunication »