3

I am trying to send AT commands on Galaxy S (I9000). The problem is that I am not sure which device is the modem. Searching into file /system/build.prop, i get that the device used by rild is /dev/ttyS0 (rild.libargs=-d /dev/ttyS0). But there is no ttyS0 file into /dev directory, and as a result I get an error when trying to send commands to it.

Executing the command cat /proc/tty/drivers I get the following results:

/dev/tty /dev/tty 5 0 system:/dev/tty

/dev/console /dev/console 5 1 system:console

/dev/ptmx /dev/ptmx 5 2 system

/dev/vc/0 /dev/vc/0 4 0 system:vtmaster

rfcomm /dev/rfcomm 216 0-255 serial

g_serial /dev/ttyGS 250 0 serial

ttySAC /dev/s3c2410_serial 204 64-67 serial

pty_slave /dev/pts 136 0-1048575 pty:slave

pty_master /dev/ptm 128 0-1048575 pty:master

unknown /dev/tty 4 1-63 console

From these I guess that the modem is /dev/ttyGS0. So i go on and execute via adb or terminal IDE application:

stop ril-daemon

cat /dev/ttyGS0 &

echo -e 'AT+CGSN\r' > /dev/ttyGS0.

But I get no response. I have also installed busybox and execute

echo "AT+CGSN\r" | busybox microcom -t 500 /dev/ttyGS0

but i get no response either.

Searching in this http://forum.xda-developers.com/showthread.php?t=1471241 which is the thread that everyone suggests to read, didn't really help.

Does anyone know how to communicate with the modem and get response?

P.S.: Using hyperterminal I can send AT commands, but I want to send them from a local terminal.

Thank you.

Pigueiras
  • 18,778
  • 10
  • 64
  • 87
  • Try ATI first, which should return device information. Do you need to unlock the SIM with AT+CPIN next? – user1725145 Apr 24 '13 at 08:59
  • The modem ignores all the commands. What I want for example is to send the command AT+CIMI and get the response. – user2311306 Apr 25 '13 at 12:13
  • If you don't get an answer to ATI, then you may not be talking to the modem. Are you sure that when you send AT commands manually, that you are talking to /dev/ttyGS0 ? – user1725145 Apr 25 '13 at 12:21
  • Yes, I am sure that I'm talking to ttyGS0 but I am not sure If I should talk to ttyGS0. However, I tried the other devices too. The strange think is that when connecting with hyperterminal I am able to send AT commands, but I cant from a local shell. How does hyperterminal communicate with the modem? – user2311306 Apr 25 '13 at 12:47
  • Is \r enough, or do you need \\r for a return? have you seen http://stackoverflow.com/questions/9286331/adb-shell-script-to-send-at-commands-to-a-modem-cannot-return-control-to-a-shell – user1725145 Apr 25 '13 at 13:57
  • I don't think there are any surprises with HT, you have to set the baud rate (in Windows) that's all. – user1725145 Apr 25 '13 at 13:57

0 Answers0