configuration_d_une_cle_4g_lte
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| configuration_d_une_cle_4g_lte [2016/09/21 18:39] – simon | configuration_d_une_cle_4g_lte [Date inconnue] (Version actuelle) – supprimée - modification externe (Date inconnue) 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== Installation et configuration d'une clé 4G LTE ====== | ||
| - | ===== Modèle testé ===== | ||
| - | D-Link, Model: | ||
| - | |||
| - | ===== Installation ===== | ||
| - | <code bash> | ||
| - | pi@raspberrypi(rw): | ||
| - | Bus 001 Device 010: ID 2001:a401 D-Link Corp. | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | pi@raspberrypi(rw): | ||
| - | |||
| - | Bus 001 Device 010: ID 2001:a401 D-Link Corp. | ||
| - | Device Descriptor: | ||
| - | bLength | ||
| - | bDescriptorType | ||
| - | bcdUSB | ||
| - | bDeviceClass | ||
| - | bDeviceSubClass | ||
| - | bDeviceProtocol | ||
| - | bMaxPacketSize0 | ||
| - | idVendor | ||
| - | idProduct | ||
| - | bcdDevice | ||
| - | iManufacturer | ||
| - | iProduct | ||
| - | iSerial | ||
| - | bNumConfigurations | ||
| - | Configuration Descriptor: | ||
| - | bLength | ||
| - | bDescriptorType | ||
| - | wTotalLength | ||
| - | bNumInterfaces | ||
| - | bConfigurationValue | ||
| - | iConfiguration | ||
| - | bmAttributes | ||
| - | (Bus Powered) | ||
| - | MaxPower | ||
| - | Interface Descriptor: | ||
| - | bLength | ||
| - | bDescriptorType | ||
| - | bInterfaceNumber | ||
| - | bAlternateSetting | ||
| - | bNumEndpoints | ||
| - | bInterfaceClass | ||
| - | bInterfaceSubClass | ||
| - | bInterfaceProtocol | ||
| - | iInterface | ||
| - | Endpoint Descriptor: | ||
| - | bLength | ||
| - | bDescriptorType | ||
| - | bEndpointAddress | ||
| - | bmAttributes | ||
| - | Transfer Type Bulk | ||
| - | Synch Type None | ||
| - | Usage Type Data | ||
| - | wMaxPacketSize | ||
| - | bInterval | ||
| - | Endpoint Descriptor: | ||
| - | bLength | ||
| - | bDescriptorType | ||
| - | bEndpointAddress | ||
| - | bmAttributes | ||
| - | Transfer Type Bulk | ||
| - | Synch Type None | ||
| - | Usage Type Data | ||
| - | wMaxPacketSize | ||
| - | bInterval | ||
| - | Device Qualifier (for other device speed): | ||
| - | bLength | ||
| - | bDescriptorType | ||
| - | bcdUSB | ||
| - | bDeviceClass | ||
| - | bDeviceSubClass | ||
| - | bDeviceProtocol | ||
| - | bMaxPacketSize0 | ||
| - | bNumConfigurations | ||
| - | Device Status: | ||
| - | (Bus Powered) | ||
| - | </ | ||
| - | |||
| - | On ajoute ces quatre lignes dans le fichier : | ||
| - | |||
| - | <WRAP center round important 60%> | ||
| - | Je ne sais pas s'il faut utiliser le fichier '' | ||
| - | [Edit: Il faut ! Pour ne pas avoir à utiliser la longue commande [[usb_modswitch]] ci-dessous et que le modem 3G soit prêt au démarrage! Il faut juste le configurer correctement! /Edit] | ||
| - | [Edit2: La configuration finale de ce fichier est plus bas./Edit2] | ||
| - | </ | ||
| - | <code bash> | ||
| - | $ sudo nano / | ||
| - | $ sudo cat / | ||
| - | (...) | ||
| - | DefaultVendor=0x2001 | ||
| - | DefaultProduct=0xa401 | ||
| - | MessageEndpoint=" | ||
| - | MessageContent=" | ||
| - | </ | ||
| - | |||
| - | On utilise la commande [[usb_modeswitch]] avec ces arguments (trouvé sur [[http:// | ||
| - | <code bash> | ||
| - | pi@raspberrypi(rw): | ||
| - | Take all parameters from the command line | ||
| - | |||
| - | |||
| - | * usb_modeswitch: | ||
| - | * Version 2.2.0 (C) Josua Dietze 2014 | ||
| - | * Based on libusb1/ | ||
| - | |||
| - | ! PLEASE REPORT NEW CONFIGURATIONS ! | ||
| - | |||
| - | DefaultVendor= | ||
| - | DefaultProduct= 0xa401 | ||
| - | MessageContent=" | ||
| - | MessageContent2=" | ||
| - | MessageContent3=" | ||
| - | NeedResponse=1 | ||
| - | |||
| - | Look for default devices ... | ||
| - | found USB ID 2001:a401 | ||
| - | | ||
| - | | ||
| - | found USB ID 0a5c:bd1e | ||
| - | found USB ID 0483:2016 | ||
| - | found USB ID 04b3:3021 | ||
| - | found USB ID 04b3:3022 | ||
| - | found USB ID 0424:ec00 | ||
| - | found USB ID 0424:9514 | ||
| - | found USB ID 1d6b:0002 | ||
| - | Found devices in default mode (1) | ||
| - | Access device 012 on bus 001 | ||
| - | Current configuration number is 1 | ||
| - | Use interface number 0 | ||
| - | Use endpoints 0x01 (out) and 0x81 (in) | ||
| - | |||
| - | USB description data (for identification) | ||
| - | ------------------------- | ||
| - | Manufacturer: | ||
| - | | ||
| - | Serial No.: 0123456789ABCDEF | ||
| - | ------------------------- | ||
| - | Looking for active driver ... | ||
| - | No active driver found. Detached before or never attached | ||
| - | Set up interface 0 | ||
| - | Use endpoint 0x01 for message sending ... | ||
| - | Trying to send message 1 to endpoint 0x01 ... | ||
| - | OK, message successfully sent | ||
| - | Read the response to message 1 (CSW) ... | ||
| - | | ||
| - | Trying to send message 2 to endpoint 0x01 ... | ||
| - | OK, message successfully sent | ||
| - | Read the response to message 2 (CSW) ... | ||
| - | | ||
| - | Trying to send message 3 to endpoint 0x01 ... | ||
| - | OK, message successfully sent | ||
| - | Read the response to message 3 (CSW) ... | ||
| - | | ||
| - | Reset response endpoint 0x81 | ||
| - | Reset message endpoint 0x01 | ||
| - | -> Run lsusb to note any changes. Bye! | ||
| - | |||
| - | pi@raspberrypi(rw): | ||
| - | Bus 001 Device 013: ID 2001:7e19 D-Link Corp. | ||
| - | Bus 001 Device 005: ID 0a5c:bd1e Broadcom Corp. | ||
| - | Bus 001 Device 011: ID 0483:2016 STMicroelectronics Fingerprint Reader | ||
| - | Bus 001 Device 010: ID 04b3:3021 IBM Corp. | ||
| - | Bus 001 Device 009: ID 04b3:3022 IBM Corp. | ||
| - | Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/ | ||
| - | Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. | ||
| - | Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | pi@raspberrypi(rw): | ||
| - | [ 806.074853] usb 1-1.5: GSM modem (1-port) converter now attached to ttyUSB0 | ||
| - | [ 806.075897] usb 1-1.5: GSM modem (1-port) converter now attached to ttyUSB1 | ||
| - | [ 806.076943] usb 1-1.5: GSM modem (1-port) converter now attached to ttyUSB2 | ||
| - | [ 806.077874] usb 1-1.5: GSM modem (1-port) converter now attached to ttyUSB3 | ||
| - | </ | ||
| - | |||
| - | J'ai un problème quand j' | ||
| - | <code bash> | ||
| - | $ sudo apt-get install minicom | ||
| - | </ | ||
| - | |||
| - | J'ai configuré minicom pour les quatre ttyUSB*, j'ai trouvé le baurdate via [[https:// | ||
| - | <code bash> | ||
| - | pi@raspberrypi(rw): | ||
| - | pu port / | ||
| - | pu baudrate 115200 | ||
| - | pu bits 8 | ||
| - | pu parity N | ||
| - | pu stopbits 1 | ||
| - | pu minit ATZ | ||
| - | pi@raspberrypi(rw): | ||
| - | pu port / | ||
| - | pu baudrate 115200 | ||
| - | pu bits 8 | ||
| - | pu parity N | ||
| - | pu stopbits 1 | ||
| - | pu minit ATZ | ||
| - | pi@raspberrypi(rw): | ||
| - | pu port / | ||
| - | pu baudrate 115200 | ||
| - | pu bits 8 | ||
| - | pu parity N | ||
| - | pu stopbits 1 | ||
| - | pu minit ATZ | ||
| - | pi@raspberrypi(rw): | ||
| - | pu port / | ||
| - | pu baudrate 115200 | ||
| - | pu bits 8 | ||
| - | pu parity N | ||
| - | pu stopbits 1 | ||
| - | pu minit ATZ | ||
| - | </ | ||
| - | |||
| - | Connexion!! | ||
| - | <code bash> | ||
| - | pi@raspberrypi(rw): | ||
| - | Bienvenue avec minicom 2.7 | ||
| - | |||
| - | OPTIONS: I18n | ||
| - | Compilé le Jan 12 2014, 05:42:53. | ||
| - | Port / | ||
| - | |||
| - | Tapez CTRL-A Z pour voir l'aide concernant les touches spéciales | ||
| - | |||
| - | ATZ | ||
| - | OK | ||
| - | |||
| - | CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.7 | VT102 | Connecté 0:0 | ttyUSB2 | ||
| - | </ | ||
| - | |||
| - | Une fois dans minicom, connecté au modem, on peut essayer plein de choses. Exemples avec une [[carte SIM de chez Proximus]] et une [[carte SIM de chez Base]]. | ||
| - | <code bash> | ||
| - | ATI | ||
| - | Manufacturer: | ||
| - | Model: +CGMM: DWM-221 | ||
| - | Revision: 2.3.2 | ||
| - | IMEI: 353880061962187 | ||
| - | +GCAP: +CGSM, | ||
| - | |||
| - | OK | ||
| - | </ | ||
| - | |||
| - | Mettre le code pin (1234 n'est pas mon vrai code...) : | ||
| - | <code bash> | ||
| - | AT+CPIN=" | ||
| - | +CME ERROR: incorrect password | ||
| - | AT+CPIN=" | ||
| - | OK | ||
| - | </ | ||
| - | |||
| - | Ne plus demander le code pin dans le futur pour se connecter : | ||
| - | <code bash> | ||
| - | AT+CLCK=" | ||
| - | OK | ||
| - | </ | ||
| - | |||
| - | Réactiver la demande du code pin : | ||
| - | <code bash> | ||
| - | AT+CLCK=" | ||
| - | OK | ||
| - | </ | ||
| - | |||
| - | Voir si la demande du code pin est activée ('' | ||
| - | <code bash> | ||
| - | AT+CLCK=" | ||
| - | +CLCK: 0 | ||
| - | </ | ||
| - | |||
| - | Force du signal (5 à 22) : | ||
| - | <code bash> | ||
| - | AT+CSQ | ||
| - | +CSQ: 15,99 | ||
| - | |||
| - | OK | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | AT&V | ||
| - | &C: 2; &D: 2; &E: 0; &F: 0; &S: 0; &W: 0; E: 1; L: 0; M: 0; Q: 0; V: 1; | ||
| - | X: 0; Z: 0; \Q: 3; \S: 0; \V: 0; O: 0; S0: 0; S2: 43; S3: 13; S4: 10; | ||
| - | S5: 8; S6: 2; S7: 50; S8: 2; S9: 6; S10: 14; S11: 95; S30: 0; S103: 1; | ||
| - | S104: 1; +FCLASS: 0; +ICF: 3,3; +IFC: 2,2; +IPR: 115200; +DR: 0; | ||
| - | +DS: 0,0,2048,6; +CMEE: 2; +WS46: 12; +CFUN:; +BMSETCUSTVER: | ||
| - | +BMEFSVER: ; +BMCGMR: 1158590976; +BMGMI: 1158590968; +QCGMI: 1158590968; | ||
| - | +BMGMM: 1158590960; +QCGMM: 1158590960; +BMCALLEN: 0; +BMMODODR: 2; | ||
| - | +BMSN: ""; | ||
| - | +BMESN: 1158590928; +BMMEID: 1158590920; +BMTFLAG: ; +BMCK: 1158590912; | ||
| - | +BMPCMLOOP: 0; +CBST: 0,0,1; | ||
| - | +CRLP: (61, | ||
| - | +CV120: 1, | ||
| - | +CEREG: 0; +CSCS: " | ||
| - | +CGDCONT: (1," | ||
| - | +CGEQREQ: ; +CGEQMIN: ; +CGEQOS: ; +CGQREQ: ; +CGQMIN: ; +CGEREP: 0,0; | ||
| - | +CGDATA: " | ||
| - | +CMGF: 0; +CSAS: 0; +CRES: 0; +CSCA: " | ||
| - | +CSDH: 0; +CSCB: 0,"",""; | ||
| - | +ESA: 0,,,, | ||
| - | +CMEC: 0,0,0,0; +CIND: 0, | ||
| - | +CGACT(1, | ||
| - | +CMMS: 0; +FTS: 0; +FRS: 0; +FTH: 3; +FRH: 3; +FTM: 96; +FRM: 96; | ||
| - | +CCUG: 0,0,0; +COPS: 0, | ||
| - | +CPOL: 0, | ||
| - | +CDIP: 0; +CLIR: 0; +CSDF: 1; +CEN: 0; +EB: 1,0,30; +EFCS: 1; +ER: 0; | ||
| - | +ESR: 1; +ETBM: 1,1,20; +MA: ; +MR: 0; +MS: ; +MV18R: 0; +MV18S: 0,0,0; | ||
| - | +CXT: 0; +CDR: 0; +CDS: 0,1,2048,6; +CFC: 0; +CFG: ""; | ||
| - | +CCRC: 0; +QCMUX: C,2; +CRM: 0; +CTA: 30; +ILRR: 0; +QCPIN: ,; +FAA: 0; | ||
| - | +FAP: 0,0,0; +FBO: 0; +FBU: 0; +FCQ: 1,0; +FCC: 0, | ||
| - | +FCT: 1E; +FEA: 0; +FFC: 0,0,0,0; +FHS: 0; +FIE: 0; +FIP: 0; | ||
| - | +FIS: 0, | ||
| - | +FNR: 0, | ||
| - | +FPW: ""; | ||
| - | ^DSCI: 0; ^CPIN: , | ||
| - | |||
| - | OK | ||
| - | </ | ||
| - | |||
| - | On peut configurer dans le fichier ''/ | ||
| - | <code bash> | ||
| - | pi@raspberrypi(rw): | ||
| - | # interfaces(5) file used by ifup(8) and ifdown(8) | ||
| - | |||
| - | # Please note that this file is written to be used with dhcpcd | ||
| - | # For static IP, consult / | ||
| - | |||
| - | # Include files from / | ||
| - | source-directory / | ||
| - | |||
| - | auto lo | ||
| - | iface lo inet loopback | ||
| - | |||
| - | iface eth0 inet manual | ||
| - | |||
| - | # | ||
| - | # | ||
| - | #iface wlan0 inet manual | ||
| - | # wpa-conf / | ||
| - | |||
| - | allow-hotplug wlan1 | ||
| - | iface wlan1 inet manual | ||
| - | wpa-conf / | ||
| - | |||
| - | #D-Link (3G,4G,LTE) | ||
| - | auto ppp0 | ||
| - | iface ppp0 inet wvdial | ||
| - | </ | ||
| - | |||
| - | <WRAP center round alert 60%> | ||
| - | Je pense que le fichier '' | ||
| - | </ | ||
| - | |||
| - | Et dans le fichier ''/ | ||
| - | <code bash> | ||
| - | pi@raspberrypi(rw): | ||
| - | user " | ||
| - | connect "/ | ||
| - | / | ||
| - | noipdefault | ||
| - | defaultroute | ||
| - | replacedefaultroute | ||
| - | hide-password | ||
| - | noauth | ||
| - | persist | ||
| - | usepeerdns | ||
| - | </ | ||
| - | |||
| - | Avec wvdial : | ||
| - | <code bash> | ||
| - | pi@raspberrypi(rw): | ||
| - | |||
| - | [Dialer Defaults] | ||
| - | Init1 = ATZ | ||
| - | Init2 = ATQ0 V1 E1 S0=0 +FCLASS=0 | ||
| - | Modem Type = Analog Modem | ||
| - | Baud = 460800 | ||
| - | Stupid Mode = 1 | ||
| - | New PPPD = yes | ||
| - | Modem = / | ||
| - | ISDN = 0 | ||
| - | Phone = *99# | ||
| - | Password = ''; | ||
| - | Username = ''; | ||
| - | </ | ||
| - | |||
| - | Enfin, on peut activer l' | ||
| - | <code bash> | ||
| - | pi@raspberrypi(rw): | ||
| - | </ | ||
| - | |||
| - | Et voir que tout roule dans [[ifconfig]] : | ||
| - | <code bash> | ||
| - | pi@raspberrypi(rw): | ||
| - | eth0 Link encap: | ||
| - | adr inet6: fe80:: | ||
| - | UP BROADCAST MULTICAST | ||
| - | RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | ||
| - | TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 | ||
| - | collisions: | ||
| - | RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) | ||
| - | |||
| - | lo Link encap: | ||
| - | inet adr: | ||
| - | adr inet6: ::1/128 Scope:Hôte | ||
| - | UP LOOPBACK RUNNING | ||
| - | RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | ||
| - | TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 | ||
| - | collisions: | ||
| - | RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) | ||
| - | |||
| - | ppp0 Link encap: | ||
| - | inet adr: | ||
| - | UP POINTOPOINT RUNNING NOARP MULTICAST | ||
| - | RX packets: | ||
| - | TX packets: | ||
| - | collisions: | ||
| - | RX bytes: | ||
| - | |||
| - | wlan1 Link encap: | ||
| - | inet adr: | ||
| - | adr inet6: fe80:: | ||
| - | UP BROADCAST RUNNING MULTICAST | ||
| - | RX packets: | ||
| - | TX packets: | ||
| - | collisions: | ||
| - | RX bytes: | ||
| - | |||
| - | wwan0 Link encap: | ||
| - | inet adr: | ||
| - | adr inet6: fe80:: | ||
| - | UP BROADCAST RUNNING MULTICAST | ||
| - | RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | ||
| - | TX packets:153 errors:0 dropped:0 overruns:0 carrier:0 | ||
| - | collisions: | ||
| - | RX bytes:0 (0.0 B) TX bytes:51271 (50.0 KiB) | ||
| - | </ | ||
| - | |||
| - | |||
| - | J'ai fait différents tests et j' | ||
| - | <code bash>$ cat / | ||
| - | # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) | ||
| - | # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN | ||
| - | nameserver 80.201.237.239 | ||
| - | nameserver 80.201.237.238 | ||
| - | </ | ||
| - | |||
| - | Il restait encore un problème. Au démarrage, il fallait lancer [[usb_modeswitch]] avec une commande longue : | ||
| - | <code bash> | ||
| - | $ sudo usb_modeswitch -v 2001 -p a401 -W -n -M 555342435b000000000000000001061e000000000000000000000000000000 -2 555342435c000000000000000001061b000000010000000000000000000000 -3 555342435d000000000000000001061b000000020000000000000000000000 | ||
| - | </ | ||
| - | |||
| - | On peut simplifier cette commande en configuration le fichier ' | ||
| - | <code bash> | ||
| - | $ sudo nano / | ||
| - | $ sudo cat / | ||
| - | #D-Link DWM-221 | ||
| - | TargetVendor=0x2001 | ||
| - | TargetProduct=0x7e19 | ||
| - | MessageContent=" | ||
| - | MessageContent2=" | ||
| - | MessageContent3=" | ||
| - | </ | ||
| - | |||
| - | On peut maintenant utiliser la commande suivante : | ||
| - | <code bash> | ||
| - | $ sudo usb_modeswitch -v 2001 -p a401 -c / | ||
| - | </ | ||
| - | |||
| - | C'est mieux, mais il faudrait que le réseau démarre correctement au démarrage. Il faudrait aussi qu'il (re)démarre automatiquement si on branche la clé 3G. Hop, un petit service [[systemd]] : | ||
| - | <code bash> | ||
| - | $ sudo nano / | ||
| - | $ sudo cat / | ||
| - | [Unit] | ||
| - | Description=Connexion 3G | ||
| - | After=network.target | ||
| - | |||
| - | [Service] | ||
| - | ExecStartPre=/ | ||
| - | ExecStart=/ | ||
| - | ExecStartPost=/ | ||
| - | Restart=always | ||
| - | RestartSec=5 | ||
| - | |||
| - | [Install] | ||
| - | WantedBy=multi-user.target | ||
| - | </ | ||
| - | |||
| - | On relance le daemon qui gère les services, on active le service et on regarde ce que ça donne! | ||
| - | <code bash> | ||
| - | $ sudo systemctl daemon-reload | ||
| - | $ sudo systemctl enable 3g.service | ||
| - | $ sudo systemctl status 3g.service | ||
| - | ● 3g.service - Connexion 3G | ||
| - | | ||
| - | | ||
| - | Main PID: 2672 (wvdial) | ||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | sep 07 15:27:44 raspberrypi wvdial[2672]: | ||
| - | sep 07 15:27:44 raspberrypi wvdial[2672]: | ||
| - | sep 07 15:27:44 raspberrypi wvdial[2672]: | ||
| - | sep 07 15:27:44 raspberrypi wvdial[2672]: | ||
| - | sep 07 15:27:44 raspberrypi wvdial[2672]: | ||
| - | sep 07 15:27:44 raspberrypi wvdial[2672]: | ||
| - | sep 07 15:27:44 raspberrypi wvdial[2672]: | ||
| - | sep 07 15:27:44 raspberrypi wvdial[2672]: | ||
| - | sep 07 15:27:44 raspberrypi wvdial[2672]: | ||
| - | sep 07 15:27:44 raspberrypi wvdial[2672]: | ||
| - | </ | ||
| - | |||
| - | ===== Sources ===== | ||
| - | * [[http:// | ||
| - | * [[http:// | ||
| - | * [[http:// | ||
| - | * [[https:// | ||
| - | * [[https:// | ||
| - | * [[http:// | ||
| - | * [[https:// | ||
| - | * [[http:// | ||
configuration_d_une_cle_4g_lte.1474483184.txt.gz · Dernière modification : (modification externe)
