User Tools

Site Tools


linux:modem3g

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:modem3g [2013/05/19 18:57] rlunarolinux:modem3g [2022/12/02 22: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 ======
  
-have a modem Huawei E1752Cu HSPA. What I want to do is the following1) 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/month) and in the case of the sms you only pay the sms you send, so in some cases is advisable using only sms.  +Please update your favourites.
- +
-===== Setup modem ===== +
- +
-Install modem-manager: +
- +
-<code> +
-# sudo apt-get install modemmanager +
-</code> +
- +
-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 ''--debug'' option enabled in order to see what is happening behind the scenes:  +
- +
-<code> +
-root@raspberrypi:/home/pi# modem-manager  --debug  +
-modem-manager[16723]: <info>  [1359305305.945270] [main.c:167] main(): ModemManager (version 0.5.2.0) starting... +
-modem-manager[16723]: <info>  [1359305305.993128] [mm-manager.c:120] load_plugin(): Loaded plugin Option +
-modem-manager[16723]: <info>  [1359305306.002902] [mm-manager.c:120] load_plugin(): Loaded plugin ZTE +
-modem-manager[16723]: <info>  [1359305306.013057] [mm-manager.c:120] load_plugin(): Loaded plugin Huawei +
-modem-manager[16723]: <info>  [1359305306.020689] [mm-manager.c:120] load_plugin(): Loaded plugin X22X +
-modem-manager[16723]: <info>  [1359305306.028594] [mm-manager.c:120] load_plugin(): Loaded plugin Gobi +
-modem-manager[16723]: <info>  [1359305306.036247] [mm-manager.c:120] load_plugin(): Loaded plugin Nokia +
-modem-manager[16723]: <info>  [1359305306.046679] [mm-manager.c:120] load_plugin(): Loaded plugin Samsung +
-modem-manager[16723]: <info>  [1359305306.054036] [mm-manager.c:120] load_plugin(): Loaded plugin Linktop +
-modem-manager[16723]: <info>  [1359305306.064143] [mm-manager.c:120] load_plugin(): Loaded plugin Ericsson MBM +
-modem-manager[16723]: <info>  [1359305306.072771] [mm-manager.c:120] load_plugin(): Loaded plugin Wavecom +
-modem-manager[16723]: <info>  [1359305306.081609] [mm-manager.c:120] load_plugin(): Loaded plugin Novatel +
-modem-manager[16723]: <info>  [1359305306.091642] [mm-manager.c:120] load_plugin(): Loaded plugin Option High-Speed +
-modem-manager[16723]: <info>  [1359305306.101939] [mm-manager.c:120] load_plugin(): Loaded plugin Sierra +
-modem-manager[16723]: <info>  [1359305306.110765] [mm-manager.c:120] load_plugin(): Loaded plugin Generic +
-modem-manager[16723]: <info>  [1359305306.118949] [mm-manager.c:120] load_plugin(): Loaded plugin SimTech +
-modem-manager[16723]: <info>  [1359305306.127009] [mm-manager.c:120] load_plugin(): Loaded plugin MotoC +
-modem-manager[16723]: <info>  [1359305306.134973] [mm-manager.c:120] load_plugin(): Loaded plugin Longcheer +
-modem-manager[16723]: <info>  [1359305306.142911] [mm-manager.c:120] load_plugin(): Loaded plugin AnyData +
-modem-manager[16723]: <debug> [1359305306.203809] [mm-manager.c:491] try_supports_port(): (Huawei): (ttyUSB1) deferring support check +
-</code> +
- +
-Many lines will evidence where is the modem located:  +
- +
-<code> +
- +
-modem-manager[16723]: <debug> [1359305306.394255] [mm-at-serial-port.c:333] debug_log(): (ttyUSB0): --> 'AT+GCAP<CR>' +
-modem-manager[16723]: <debug> [1359305307.099166] [mm-at-serial-port.c:333] debug_log(): (ttyUSB0): <-- 'AT+GCAP' +
-modem-manager[16723]: <debug> [1359305307.102651] [mm-at-serial-port.c:333] debug_log(): (ttyUSB0): <-- '<CR><CR><LF>+CME ERROR: SIM PIN required<CR><LF>' +
- +
-</code> +
- +
-In my case is /dev/ttyUSB0.  +
- +
- +
-===== 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.  +
- +
-<code> +
-# sudo apt-get install minicom +
-</code> +
- +
-<code> +
-# minicom --device /dev/ttyUSB0 +
-</code> +
- +
- +
-It is advisable to check out these pages in order to know the basic AT commands to do the task: +
- +
-  * [[http://www.shapeshifter.se/2008/04/30/list-of-at-commands/]] - Interesting to make a connection to the internet +
-  * [[http://www.developershome.com/sms/atCommandsIntro.asp]] +
- +
-==== Enter the pin, check pin status, etc ==== +
- +
-See pin status:  +
- +
-<code> +
-AT+CPIN? +
-+CPIN: SIM PIN   # it needs pin of the SIM +
- +
-OK +
-</code> +
- +
-Enter pin: +
- +
-<code> +
-AT+CPIN=9999 # put your pin here +
-OK +
-</code> +
- +
-==== Network registration ==== +
- +
-Check out network registration and register into network if neccesary: +
- +
-<code> +
-AT+CREG? +
-+CREG: 0,5   # 5 means connected +
-</code> +
- +
-Description of the values: +
- +
-<n> +
- +
-  * Disable unsolicited status callback. +
-  * Enable unsolicited status callback, +CREG: <stat> +
-  * Enable unsolicited status callback, +CREG: <stat>,[,<lac>,<ci>[,<AcT>]] +
- +
-<stat> +
- +
-  * 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:  +
- +
-<code> +
-AT+CREG=1 +
-</code> +
- +
-==== 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** +
- +
-<code> +
-AT+CMGF=1               # say the modem to operate in sms mode +
-OK +
-AT+CMGS="669807321"     # send a message directly +
-> text your message here, and end the message with ^Z (control+z) +
-</code> +
- +
-<code> +
-AT+CMGF=1               # say the modem to operate in sms mode +
-AT+CMGW="669807321" +
-> A simple demo of SMS text messaging. +
- +
-+CMSS: 1                # the ID of the message in memory +
- +
-AT+CMSS=1               # send the message with id = 1  +
-</code> +
- +
- +
-==== Read a message ==== +
- +
-To list all the messages in the memory: +
- +
-<code> +
- +
-</code> +
- +
-==== Delete a message ==== +
- +
-To delete a message: +
- +
-<code> +
- +
-AT+CMGD=2 +
- +
-</code> +
- +
- +
- +
-==== Lista de operadores moviles ====  +
- +
-<code> +
-AT+CGDCONT? +
-</code> +
- +
-Y usamos uno:  +
- +
-<code> +
- +
-AT+CGDCONT=1 +
-</code> +
- +
- +
- +
-===== Connect to internet ===== +
- +
-INSTALAMOS PPP Y WDIAL:  +
- +
-<code> +
-# sudo apt-get install wvdial ppp +
-</code> +
- +
-~~DISQUS~~+
  
linux/modem3g.1368982649.txt.gz · Last modified: 2022/12/02 22:02 (external edit)