linux:modem3g
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:modem3g [2013/02/06 18:34] – rlunaro | linux: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. | + | This topic have been moved to [[raspberrypi:modem3g|here]]. | 
| - | + | ||
| - | 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 and 2) using mobile broadband to communicate with the raspberry. The fares of having a mobile connected all the time (plain fare are about 15 euros/ | + | |
| - | + | ||
| - | ===== Setup modem ===== | + | |
| - | + | ||
| - | Install modem-manager: | + | |
| - | + | ||
| - | < | + | |
| - | # sudo apt-get install modemmanager | + | |
| - | </ | + | |
| - | + | ||
| - | 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 the modem it will be authomatically configured. | + | |
| - | + | ||
| - | I reommend to run it the '' | + | |
| - | + | ||
| - | < | + | |
| - | root@raspberrypi:/ | + | |
| - | 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: | + | |
| - | + | ||
| - | < | + | |
| - | + | ||
| - | modem-manager[16723]: | + | |
| - | 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 to the modem. | + | |
| - | + | ||
| - | < | + | |
| - | # sudo apt-get install minicom | + | |
| - | </ | + | |
| - | + | ||
| - | < | + | |
| - | # minicom --device / | + | |
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | It is advisable to check out these pages in order to know the basic AT commands to do the task: | + | |
| - | + | ||
| - | * [[http:// | + | |
| - | * [[http:// | + | |
| - | + | ||
| - | ==== Enter the pin, check pin status, etc ==== | + | |
| - | + | ||
| - | See pin status: | + | |
| - | + | ||
| - | < | + | |
| - | AT+CPIN? | + | |
| - | +CPIN: SIM PIN # it needs pin of the SIM | + | |
| - | + | ||
| - | OK | + | |
| - | </ | + | |
| - | + | ||
| - | Enter pin: | + | |
| - | + | ||
| - | < | + | |
| - | AT+CPIN=9999 # put your pin here | + | |
| - | OK | + | |
| - | </ | + | |
| - | + | ||
| - | ==== Network registration ==== | + | |
| - | + | ||
| - | Check out network registration and register into network if neccesary: | + | |
| - | + | ||
| - | < | + | |
| - | AT+CREG? | + | |
| - | +CREG: 0,5 # 5 means connected | + | |
| - | </ | + | |
| - | + | ||
| - | Description of the values: | + | |
| - | + | ||
| - | <n> | + | |
| - | + | ||
| - | * 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... | + | |
| - | + | ||
| - | **Direct sending** | + | |
| - | + | ||
| - | < | + | |
| - | AT+CMGF=1 | + | |
| - | OK | + | |
| - | AT+CMGS=" | + | |
| - | > text your message here, and end the message with ^Z (control+z) | + | |
| - | </ | + | |
| - | + | ||
| - | < | + | |
| - | AT+CMGF=1 | + | |
| - | AT+CMGW=" | + | |
| - | > A simple demo of SMS text messaging. | + | |
| - | + | ||
| - | +CMSS: 1 # the ID of the message in memory | + | |
| - | + | ||
| - | AT+CMSS=1 | + | |
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | ==== Read a message ==== | + | |
| - | + | ||
| - | To list all the messages in the memory: | + | |
| - | + | ||
| - | < | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | ==== Delete a message ==== | + | |
| - | + | ||
| - | To delete a message: | + | |
| - | + | ||
| - | < | + | |
| - | + | ||
| - | AT+CMGD=2 | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | ==== 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 | + | |
| - | </ | + | |
| + | Please update your favourites. | ||
linux/modem3g.1360175655.txt.gz · Last modified: 2022/12/02 21:02 (external edit)
                
                