Skip to main content

Membaca SMS dari Modem dengan AT Command

Sedikit sharing sekalian untuk catatan biar saya tidak lupa. Saat ini saya akan menulis bagaimana caranya untuk membaca isi SMS (Short Message Service) yang diterima pada perangkat Modem. Ya, kali ini hanya saya bahas untuk pembacaan SMS saja, untuk pengiriman mungkin di posting berikutnya.

Saya menggunakan Putty (download here) untuk mengakses komunikasi serial dengan modem. Anda juga bisa menggunakan HyperTerminal pada Windows, atau tool lain untuk mengakses komunikasi serial. Langkah pertama adalah mencari dulu modem kita dikenali pada COM berapa. Buka Device Manager pada Windows anda, saya asumsikan anda menggunakan Windows 7, Windows versi lainya menyesuaikan. Carilah modem anda dan klik kanan kemudian pilih properties, dan lihat pada tab Modem seperti dibawah ini
Device Manager
Pada gambar diatas dapat dilihat bahwa modem saya dideteksi pada COM5. Langkah berikutnya adalah membuka Putty dan pilih koneksi jenis Serial, dan masukkan COM5 pada Serial line, untuk bagian Speed yang digunakan, saya lebih suka menggunakan default 9600. 

Putty
INGAT! Sebelum anda melakukan koneksi menggunakan Putty, pastikan bahwa modem tidak sedang digunakan (online), putuskan koneksi dengan internet jika Putty gagal membuka koneksi.

Langkah selanjutnya ketika sebuah window dari Putty sudah terbuka, berarti koneksi berhasil dibuat. Selanjutnya coba anda ketikkan perintah
AT
Jika modem menjawabnya dengan OK, maka, perangkat sudah siap menerima perintah AT. Perintah yang anda ketikkan tidak akan muncul pada jendela koneksi Putty, maka dari itu usahakan anda mengetik dengan benar.

Langkah pertama untuk membaca pesan SMS dari modem adalah dengan mengubah mode yang digunakan. Terdapat dua mode PDU dan SMS Text mode, anda bisa mengecek apakah modem anda mendukung dua mode tersebut dengan mengetikan
AT+CMGF=?
Jika outputnya +CMGF: (0-1), maka kedua mode tersebut didukung oleh modem anda.
Untuk melihat mode apa yang sedang anda gunakan, ketikkan perintah
AT+CMGF?
Pada defaultnya akan muncul +CMGF: 0, dimana mode masih pada PDU mode. Anda harus menggantinya ke SMS Text mode agar anda bisa membaca isi SMS. Untuk mengganti mode tersebut, lakukan perintah
AT+CMGF=1
Setelah mendapatkan hasil OK, sekarang kita lihat, dimana pesan anda disimpan. Lakukan perintah
AT+CPMS? 
+CPMS: "SM",2,50,"SM",2,50,"SM",2,50
+CPMS tersebut adalah hasil output dari modem saya, dimana SM merupakan jenis storage tempat menyimpan pesanya, yaitu terdapat di SIM Card, dengan isi 2 pesan dan maksimal 50 pesan. Kode - kode lain diantaranya adalah
  1. ME : Pesan disimpan di memory internal perangkat. Biasanya ukuranya lebih besar daripada disimpan di memory SIM
  2. SM : Pesan disimpan di memory SIM Card
  3. MT : Pesan disimpan dalam kombinasi memory internal dan memory SIM Card
  4. BM : Jenis penyimpanan ini untuk menyimpan pesan broadcast message dari operator
  5. SR : Jenis penyimpanan ini untuk menyimpan status report dari operator
Anda bisa melihat jenis storage yang didukung perangkat anda dengan mengetikan perintah
AT+CPMS=?
+CPMS: ("ME","MT","SM","SR"),("ME","MT","SM","SR"),("ME","MT","SM","SR")
Perangkat saya hanya mendukung 4 dari 5 jenis storage.

Langkah selanjutnya adalah melihat isi pesan anda yang ada pada modem dengan cara
AT+CMGL="ALL"
+CMGL: 0,"REC READ","+628156868xxx",,"14/08/30,22:58:39+28"
ATest
+CMGL: 1,"REC UNREAD","+628156868xxx",,"14/08/30,23:02:22+28"
Ttpjwjtjtj
Jika anda langsung berhasil, maka anda beruntung. Anda dapat mengganti "ALL" dengan "REC READ" atau "REC UNREAD" untuk melihat pesan yang sudah dibaca maupun pesan yang belum dibaca.

Jika anda mengalami ERROR, ada banyak faktor :

  1. Pastikan anda sudah mengeset ke SMS Text mode dengan AT+CMGF=1 (lihat diatas), coba lihat AT+CMGF? apakah sudah terisi dengan 1
  2. Outputnya cuma OK? tidak ada list pesanya ? pastikan anda membuka storage yang benar. Cek dengan AT+CPMS? Jika pesan anda ternyata tidak ada di SIM Card, ubah storage ke memory internal anda ndenga AT+CPMS="ME"
  3. Berhasil melihat list pesan, tapi kok dalam bentuk hexadesimal ? Seperti ini +CMGL: 10,0,,280791269846100189640181F30000418040815152820F050003620202E620F1DB5D9FBB00. Anda lupa mengubah PDU mode ke Text Mode, lihat pada point 1.

Selamat mencoba, tulisan diatas hanya berdasarkan pengalaman saya, mohon banyak koreksinya jika ada kesalahan :)

Comments

  1. makasih gan udah bisa tapi kok masih hexa ya? padahal udah diubah ke AT+CMGF=1 dan pas dicek juga udah cmgf=1 mohon solusinya gan... makasih

    ReplyDelete

Post a Comment

Popular posts from this blog

HackRF Mayhem Failed to Update - M0 Guru Meditation Hard

I was on Mayhem Portapack v2.0.1 and want to upgrade to the latest stable release v2.1.0. The update went okay using the web upgrade https://hackrf.app/. But then I saw the latest nightly update and want to try it, since it has many new tools that are not yet included in the stable release. But then the update failed :( Disclaimer: I didn't take any photos of the errors, since I was focused on googling the solution. So the error was " Bad Firmware or Failed W/R error" during the upgrade process, and it was stuck. So I had to restart the device, and it was booting to the Mayhem menu, but on the bottom left, which should show the current firmware version, it was showing a  "FLASH ERR"  message. I think I should go back to the stable release, but I can't. Every time I want to flash the stable release version, the portapack will shows an error M0 Guru Meditation - Hard Fault.  There's an issue that was closed on the Mayhem GIT repo that has the same issue a...

Macintosh Classic II Brightness Issue

The Problem My Macintosh Classic II suffers from an issue where the display CRT goes dim after a few minutes on a cold boot. Every time it happens, I need to crank up the cut-off and brightness  pot behind the machine to show the image. The Analyze At first, I thought it must be the brightness issue, so I searched for the Macintosh Classic analog board schematic to check the brightness line. I found the schematic from Bomarc, and the schematic is suitable with my board, since there are two analog board versions.  I started to suspect the resistors and potentiometer on the brightness line. This Macintosh version has software-controlled brightness, so the analog board will get a 22.25 kHz square wave PBM signal from the logic board to control the brightness. I checked and replaced some resistors and cleaned the potentiometer, but nothing seems to work. The signal is there, and no sign of degradation that makes the screen dim after a few minutes.  Brightness Line So I suspec...

Fiberhome HG6145D2 Superadmin Login

Maybe some of you are using In**ehome ISP as your home internet and found out that using the provided login has minimal options to configure the router: user  user1234 I know it’s not the admin login, and that must be a full-control user account that can be used to control this router fully. So I searched and found some posts on the net and most of them are telling me to use: admin %0|F?H@f!berhO3e I tested it and it doesn’t work! But there’s more to it, you need to reset the router first by pressing the reset button on the side of the router. Then after resetting, you can log in using the admin superaccount! But keep in mind, never use the user log in again, because it will lock the super admin login until you reset the router again. Cheers 🍺