Linux – How to read SMS stored on a SIM card

backuplinuxmobilesms

I have an old phone with a telephone card (SIM card) inside. The telephone has an infrared interface on the side.

I want to read out my contacts and stored SMS messages from the phone, either via infrared, or by connecting the SIM to the computer by means of some kind of card reader.

I once managed to read the data via infrared, but I cannot recreate the needed setup because I have no computer with irda interface anymore. So I've bought a card reader, which unfortunately only works on Windows. The application that comes with it is absolute trash and does not allow saving of data (WTF?!?! Who designed THIS?). Whatever, this reader has a credit-card sized plastic card where you can plug in the SIM card, so I plug the SIM into any kind of card reader. So my question:

  • How can I get the stored data from the SIM using this Adapter? I have access to a computer that contains an integrated card reader, but I would have to check how to do it beforehand.
  • If I get hold of an infrared interface somehow, which program is the best choice to read out stored SMS messages and pohonebooks? How is this done? (cmd-lines/link to howto preferred).

I hope someone can help, since the phone starts to die, and I want to save all my SMS which don't all fit on the SIM (I would have to copy them from phone memory to the SIM, delete them and copy the next batch, since the SIM can only store 10 messages …).

Best Answer

Almost each phone can act as a modem - either via serial port (with special cable), infrared or bluetooth. And it can understand standard modem AT commands + extended GSM AT commands. So you need to have infrared port on your PC (it will show up as serial port), connect it to the phone, start terminal application (minicom for example) and communicate with the phone via AT commands. When you learn which commands you need, just write your application.

Here is a (almost) complete GSM AT commands reference guide: https://web.archive.org/web/20081114211802/http://www.communica.se/multitech/gprs_at.pdf . There you can find commands for general phone identification, for making calls, viewing/modifying phone book entries, SMS messages, network quality information and many more. Some manufacturers have even their own commands (old Ericsson phone had, for example, extended battery and temperature information - I have made a program for SMS management and phone info long time ago - http://www.marki-online.net/MpM/ ). Also be aware that at least some phone use different encoding for phone book and maybe also for SMS (GSM alphabet, where char @ is character with ASCII code 0).