raspberrypi:modem3g
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| raspberrypi:modem3g [2014/12/24 09:42] – external edit 127.0.0.1 | raspberrypi:modem3g [2022/12/02 21:02] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Connect with a 3G modem with command line ====== | ====== Connect with a 3G modem with command line ====== | ||
| - | I have a modem Huawei E1752Cu HSPA. What I want to do is the following: 1) send and receive an SMS using the modem and 2) establish a broadband connection using the modem. | + | I have a modem Huawei E1752Cu HSPA, and I want it to connect |
| - | Because I don't have a concrete idea of what to do next, I am exploring both sides: 1) using sms to communicate with the raspberry | + | ===== Detect |
| - | ===== Setup modem ===== | + | After connecting the modem, perform a lookup of the syslog. It will show you the vendor and the product: |
| - | + | ||
| - | Install modem-manager: | + | |
| < | < | ||
| - | # sudo apt-get install modemmanager | + | Feb 28 21:18:39 raspi kernel: [ 1432.602724] usb 1-1.2: new full-speed USB device number 12 using dwc_otg |
| + | Feb 28 21:18:39 raspi kernel: [ 1432.737215] usb 1-1.2: New USB device found, idVendor=12d1, | ||
| + | Feb 28 21:18:39 raspi kernel: [ 1432.737239] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 | ||
| + | Feb 28 21:18:39 raspi kernel: [ 1432.737250] usb 1-1.2: Product: HUAWEI Mobile | ||
| + | Feb 28 21:18:39 raspi kernel: [ 1432.737259] usb 1-1.2: Manufacturer: | ||
| </ | </ | ||
| - | it will detect the modem, do necessary loading of modules and things like that. It is advisable to use it as a service, so when plugin | + | So, in my case the vendor id is 12d1 and the product is 1004. |
| - | I reommend to run it the '' | + | ===== Install usb_modeswitch ===== |
| < | < | ||
| - | root@raspberrypi:/ | + | # apt-get install usb-modeswitch |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| </ | </ | ||
| - | Many lines will evidence where is the modem located: | + | ===== Configure |
| - | < | + | Then open the modem definition file, which in my case is '' |
| - | + | and then copy one existing similar to ours. In my case, I've found the 12d1:1003, so I've | |
| - | modem-manager[16723]: | + | copied it to create my own configuration of modeswitch: |
| - | modem-manager[16723]: | + | |
| - | modem-manager[16723]: | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | In my case is / | + | |
| - | + | ||
| - | + | ||
| - | ===== Send and receive SMS ===== | + | |
| - | + | ||
| - | My next step is to send and receive a test sms. First, I will install minicom to do the test directly typing the AT commands | + | |
| < | < | ||
| - | # sudo apt-get install minicom | + | cp 12d1:1003 /etc/usb-modeswitch.d/ |
| </ | </ | ||
| - | < | + | So, after that we will see that the modem is recognized. |
| - | # minicom --device / | + | |
| - | </ | + | |
| - | It is advisable to check out these pages in order to know the basic AT commands to do the task: | + | ===== Install wvdial and ppp ===== |
| - | * [[http:// | + | The configuration for me resulted as: |
| - | * [[http:// | + | |
| - | + | ||
| - | ==== Enter the pin, check pin status, etc ==== | + | |
| - | + | ||
| - | See pin status: | + | |
| < | < | ||
| - | AT+CPIN? | + | [Dialer Defaults] |
| - | +CPIN: SIM PIN # it needs pin of the SIM | + | Modem Type = USB Modem |
| - | + | Phone = *99# | |
| - | OK | + | ISDN = 0 |
| + | Username = " | ||
| + | Password = " | ||
| + | Stupid Mode = 1 | ||
| + | New PPPD = yes | ||
| + | Modem = / | ||
| + | Baud = 460800 | ||
| + | Init1 = ATZ | ||
| + | Init2 = AT+CPIN=" | ||
| + | Init3 = ATQ0 V1 E1 S0=0 &C1 & | ||
| + | Init4 = AT+CGDCONT=1," | ||
| + | Auto DNS = 1 | ||
| + | Dial Command = ATDT | ||
| + | Carrier Check = yes | ||
| + | Stupid Mode = 1 | ||
| </ | </ | ||
| - | Enter pin: | ||
| - | < | + | This was the most difficult part, because It requested me to guess what the configuration |
| - | AT+CPIN=9999 # put your pin here | + | optimum for the modem. |
| - | OK | + | |
| - | </ | + | |
| - | ==== Network registration ==== | + | In " |
| - | Check out network registration | + | The date " |
| + | guess the at commands that suits your modem. | ||
| - | < | ||
| - | AT+CREG? | ||
| - | +CREG: 0,5 # 5 means connected | ||
| - | </ | ||
| - | Description of the values: | ||
| - | <n> | + | ===== Send an sms ===== |
| - | + | ||
| - | * Disable unsolicited status callback. | + | |
| - | * Enable unsolicited status callback, +CREG: < | + | |
| - | * Enable unsolicited status callback, +CREG: < | + | |
| - | + | ||
| - | < | + | |
| - | + | ||
| - | * Not registered, not searching | + | |
| - | * Registered to home network | + | |
| - | * Not registered, searching for network | + | |
| - | * Registration denied | + | |
| - | * Registered, roaming | + | |
| - | + | ||
| - | You can change the status with the following command: | + | |
| - | + | ||
| - | < | + | |
| - | AT+CREG=1 | + | |
| - | </ | + | |
| - | + | ||
| - | ==== Send an sms ==== | + | |
| There are many ways to send an sms. You can send it directly, write first the message into the memory of the modem, etc... | There are many ways to send an sms. You can send it directly, write first the message into the memory of the modem, etc... | ||
| Line 165: | Line 116: | ||
| - | ==== Lista de operadores moviles ==== | ||
| - | |||
| - | < | ||
| - | AT+CGDCONT? | ||
| - | </ | ||
| - | |||
| - | Y usamos uno: | ||
| - | |||
| - | < | ||
| - | |||
| - | AT+CGDCONT=1 | ||
| - | </ | ||
| - | |||
| - | |||
| - | |||
| - | ===== Connect to internet ===== | ||
| - | |||
| - | INSTALAMOS PPP Y WDIAL: | ||
| - | |||
| - | < | ||
| - | # sudo apt-get install wvdial ppp | ||
| - | </ | ||
| - | |||
| - | ~~DISQUS~~ | ||
raspberrypi/modem3g.1419414128.txt.gz · Last modified: 2022/12/02 21:02 (external edit)
