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
(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
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)
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
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).