HOWTO get personal with your 3G (etc.) cellular modem

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
dogle
Posts: 409
Joined: Thu 11 Oct 2007, 12:41

HOWTO get personal with your 3G (etc.) cellular modem

#1 Post by dogle »

- without wasting your time and money!

Communication with modems has been accomplished - since (almost) the days when they were driven by steam - via special character combinations known variously as e.g. 'AT codes' or 'Hayes strings'. It is very easy to use these, to your advantage, in Puppy .... if you know how.

In the following examples, it is assumed that Puppy has recognised your modem as /dev/ttyUSB0 (your mileage may vary, adjust the device indentifier if need be).

What cellular services can I pick up at my location?


- to find out which Internet Service Providers (ISPs) are within range, open a terminal (e.g. rxvt) and do-

Code: Select all

modem-stats  -c AT+COPS=? /dev/ttyUSB0
- allow Puppy half a minute or so for scratting and sniffing; your modem will report all the services which it can 'see', each one in brackets with the following format:
(service status, numeric, e.g. 0=unknown, 1=available, 2=current, 3='forbidden'; abbreviated ISP identity; ?base station ID; service category, numeric, e.g. 0=GSM, 1='compact GSM', 2=UTRAN/3G).

Note that:

- you do not have to rush out and buy a set of SIMcards to see what is available! The AT+COPS=? should tell you anyway, even if you are using a specific, old, time-expired SIMcard in your device, and even if your modem thought it was "locked" to a particular outfit.

- the string AT+COPS=? will report services even if their signal is too weak to be useful for practical purposes. To find out what signal strength you can pick up from a given ISP, read on ....

What sort of signal can I get from that ISP?

To 'target' the signal from a particular ISP, you will need to have inserted a SIMcard associated with that ISP .... but, as before, don't waste your money whilst trying find out what's available by buying a new SIMcard, unless you must ... even a time/credit-expired voice (telephone) SIM for that provider's local service should suffice to check your signal strength.

- in the terminal, do-

Code: Select all

modem-stats  -c  AT+CSQ  /dev/ttyUSB0
AT+CSQ will swiftly tell you the score, e.g. +CSQ: 18, 99

Here, the trailing 99 is just a dummy number indicating that there is no info on speed/bandwidth .... the leading number tells you the signal strength. Here is a rough guide:-

Code: Select all

1		-111 dBm     (very very weak)
5 		-103 dBm
10		 -93  dBm
15 		 -83  dBm
20		 -73  dBm
25 		 -63  dBm
30		 -53  dBm	(super strong)
It is suggested that a signal strength in the range -75 to -85 dBm, i.e. the +CSQ -reported numbers 14 to 17, should be sufficient for a reasonably reliable data connection. It may not be worth striving for anything better than -60 dBm, say +CSQ -reported 26, because the base station may start to wind down transmit power if it thinks things are that good.

Note that there is no need to transmit ISP 'phone numbers', passwords and stuff for the purpose of running these tests, because Puppy is just sniffing the signals rather than establishing a connection to a service.

AT+CSQ is very useful, also, for experimenting to find the optimal position for your device, e.g. the 'sweet spot' for your dongle within your den which offers the best signal.

(Edit - note that you use this code BEFORE - not whilst! - you are connected to a particular service).

Don't forget that, if you get bored with repeatedly shoving out AT codes manually on the command line as above, PupDial can do this for you very nicely; f'rinstance, I keep the line

Code: Select all

Init6 = AT+CSQ
in my /etc/wvdial.config, so that PupDial reports the signal strength whenever I connect.

Although much of this 'gen is available elsewhere on the forum, it is in bits and hard to find, so I thought it worth trying to pull it together in this HOWTO ..... but I am so far only just scratching the surface of the power which AT codes can place at your fingertips (there are so many of them!) .... if you know how to use them. Any corrections and contributions are most welcome, especially if you have succeeded in using any particular AT code to sort out a problem.

Edit: Big thanks to Karl Godt, here is a link to a site which offers a real wealth of hard-to-find information on these and many, many other less-well-known AT commands -
http://m2msupport.net/m2msupport/atclac ... -commands/
- he draws particular attention to the following, which demands that your modem lists all the AT codes which it recognises:

Code: Select all

modem-stats -c AT+CLAC /dev/ttyUSB0

- try it ... and be ready to be amazed!

(Do remember to disconnect from your ISP first - modems do not respond to some AT commands when they are busy with other duties).

(Just be a bit careful when using stuff on 3rd-party websites, which may not be 100% error free ... and keep in mind that individual manufacturers' modems are ever likely to have a few of their own 'non-standard' deviations from the norm).
Last edited by dogle on Mon 22 Dec 2014, 20:11, edited 5 times in total.

User avatar
mister_electronico
Posts: 969
Joined: Sun 20 Jan 2008, 20:20
Location: Asturias_ España
Contact:

Thanks for this post

#2 Post by mister_electronico »

Thanks for this post is very interesting, I'll try in my mobile phone.

See you.

User avatar
mister_electronico
Posts: 969
Joined: Sun 20 Jan 2008, 20:20
Location: Asturias_ España
Contact:

Interesting

#3 Post by mister_electronico »

For me it is interesting to remote automatism, able to send messages via GSM, and control of distant automatons.

Thank you.

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#4 Post by nic007 »

All good tips. Now that we're talking 3G cellphone modems, I strongly suggest trying Opera Mini as your browser like I do. You will need java installed and an emulator (I use microemulator) to run it on your desktop/laptop.

dogle
Posts: 409
Joined: Thu 11 Oct 2007, 12:41

#5 Post by dogle »

Thanks nic007 (and my apologies for my late reply).

Could you perhaps expand your kind suggestion a little - e.g. what particular advantages do you find with Opera Mini, in the cellular context, (and why the Java install requirement)?

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#6 Post by nic007 »

dogle wrote:Thanks nic007 (and my apologies for my late reply).

Could you perhaps expand your kind suggestion a little - e.g. what particular advantages do you find with Opera Mini, in the cellular context, (and why the Java install requirement)?
Hi Dogle, I just put out the suggestion as a matter of interest.. Opera Mini is a Java application, therefor you need JRE. With Opera Mini the data is compressed through Opera Mini's proxy server in real time. You can save up to 90% on data usage which obviously has a data cost advantage. It's fast and great for general browsing, I use it every day (on my computer).

donkeymilk1
Posts: 11
Joined: Thu 02 Oct 2014, 22:25

#7 Post by donkeymilk1 »

Thanks for interseting info,dogle .

would opera mini work on a pc ?

or is there something similar that saves on data use.
and can be run from pc.

i use a 3g t-mobile dongle ,i've got used to the data allowance dissappearing in 30mins after topping up £15.

so it would be nice to have it last a bit longer.

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#8 Post by nic007 »

donkeymilk1 wrote:Thanks for interseting info,dogle .

would opera mini work on a pc ?

or is there something similar that saves on data use.
and can be run from pc.

i use a 3g t-mobile dongle ,i've got used to the data allowance dissappearing in 30mins after topping up £15.

so it would be nice to have it last a bit longer.
Yes. You require Java Runtime Environment, an emulator (I use microemulator) and Opera Mini browser. Advantages - Great for general browsing. You save a lot on data as the data is compressed by Opera Mini's proxy servers and it's very fast. Mobile versions of web pages (if available) are loaded by default which saves data. Negatives - You can't watch videos. There is a limit to the size of a web page you can load (you will find that when the web page is very big, the text is generally loaded but not all the images).

Another alternative is to use an HTML only browser like Dillo. Java will not be needed and you will save on data usage in comparison to using one of the large browsers. Should also be fast. You won't be able to watch videos

dogle
Posts: 409
Joined: Thu 11 Oct 2007, 12:41

#9 Post by dogle »

donkeymilk1 raised a very important point - the Great Bugbear of 3G etc. services is that they can cost you a packet if you are not data-savvy.

So, here is an addon to nic007's good suggestions:

- if you find setting up for Opera Mini a bit daunting - or in any case! -
or is there something similar that saves on data use.
and can be run from pc.

Yes - you, the user!

If only you understand what is likely to be gobbling up your data allowance, there are several things you can do to limit the problem even without resorting to very basic browsers like Dillo (or Links, or Lynx! ;-) ).

F'rinstance, like donkeymilk1 I use a (jailbroken) 3G dongle, but seem to manage very comfortably on a PAYG data allowance amounting to around 1 GB/month, using Seamonkey .... however ....

Adblock is enabled.
NoScript is enabled (save only when I deign to unlatch it to look at a really bad website).
pup-advert-blocker is installed.
Images are selectively blocked, e.g. one news source which I often visit has an editorial policy of adding daft irrelevant pictures to every news article ... much to my disgust ... blocking images cuts the data load from that source by a ~ 5-factor!
I don't download video! (Not ever, life's too short).

Video downloads are, above all, the real killer; despite the crafty compression stuff which has crept in over the last decade or so they remain hugely data-intensive, and therefore costly via cellular connections. (Of course a possible workaround for must-have video downloads is to possess your soul in patience until a "free" WiFi service can be accessed .... maybe .. ?).

User avatar
Techtardette
Posts: 32
Joined: Sun 26 Oct 2014, 01:13
Location: Chicago

#10 Post by Techtardette »

Dongle, this is some great information that I find particularly useful. Thank you.
[color=violet]echo t{ech,ardette}[/color]

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#11 Post by Karl Godt »

To get all supported AT commands from your modem :

Code: Select all

modem-stats -c AT+CLAC $YOUR_DEVICE
What to do with that bunch of commands : I am not sure .

Tried to use modem-stats to read SMS but failed .


http://m2msupport.net/m2msupport/atclac ... -commands/
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P

dogle
Posts: 409
Joined: Thu 11 Oct 2007, 12:41

#12 Post by dogle »

Techtardette, that is much appreciated - I'm really so glad to know that folks are finding this stuff helpful.

Karl Godt - Wow, thanks - that is exactly the kind of additional 'gen this thread has been needing - brilliant!
(and there's plenty there to keep me out of mischief for quite some time!).

Post Reply