RIL implementation

4,145 views
Skip to first unread message

Nimit Manglick

unread,
Jan 7, 2009, 4:44:31 AM1/7/09
to android...@googlegroups.com, android-...@googlegroups.com
Hi All,

I am trying to implement RIL and having OMAP 3530 EVM with GSM modem connected at /dev/ttyS0.

I tried some suggestions but my dialer application is giving me the following error :-

"Not Registered on Network" in message box where after pressing "OK" dialer application

 goes off. There was not much info on logcat as well.

Any pointer or suggestion would be appreciated.

Thanks & Regards
Nimit

David Turner

unread,
Jan 7, 2009, 5:21:48 AM1/7/09
to android...@googlegroups.com, android-...@googlegroups.com
adb logcat -b radio

will print the radio log, which includes the AT commands/responses that go through the RIL

hope this helps

Nimit Manglick

unread,
Jan 7, 2009, 5:32:45 AM1/7/09
to android...@googlegroups.com
Hi David,

Its showing me the following errors :-

Can't open /system/etc/voicemail-conf.xml
D/RILJ    (  681): [0000]> GET_CURRENT_CALLS
D/GSM     (  681): Poll ServiceState done:  oldSS=[1 home null null null ] newSS=[1 home null null null ] oldGprs=1 newGprs=n
D/RILJ    (  681): [0000]< GET_CURRENT_CALLS error: com.android.internal.telephony.gsm.CommandException: RADIO_NOT_AVAILABLE
D/GSM     (  681): [DataConnectionTracker] Radio is off and clean up all connection
D/GSM     (  681): [DataConnectionTracker] Clean up connection due to radioTurnedOff
D/GSM     (  681): [DataConnection] Stop poll NetStat
D/GSM     (  681): [DataConnection] Stop poll NetStat
D/GSM     (  681): [DataConnectionTracker] ***trySetupData due to roamingOff
D/GSM     (  681): [DataConnectionTracker] trySetupData: Not ready for data:  dataState=IDLE gprsState=1 sim=false UMTS=false
D/GSM     (  681): [GsmSimCard] Broadcasting intent SIM_STATE_CHANGED_ACTION NOT_READY reason null
I/RILJ    (  681): Couldn't find 'rild' socket; retrying after timeout
D/RILJ    (  681): WAKE_LOCK_TIMEOUT  mReqPending=0 mRequestList=0
I/RILJ    (  681): Couldn't find 'rild' socket; retrying after timeout


I Think its not able to create the rild socket.

So in libril/ril.cpp I have enabled that piece of code where it stars to listen to this socket.

Please give me soem pointers from where should i start.

Thanks & Regards

David Turner

unread,
Jan 7, 2009, 6:09:57 AM1/7/09
to android...@googlegroups.com
you need to start the rild daemon in your init config/script
have a look at the content of /system/etc/init*.(rc|sh) for examples

Nimit Manglick

unread,
Jan 7, 2009, 6:43:23 AM1/7/09
to android...@googlegroups.com


I am running it from init.rc script as :-

/system/bin/rild -l /system/lib/libreference-ril.so -- -d /dev/ttyS0

My modem is connected to ttyS0 only.

David Turner

unread,
Jan 7, 2009, 8:27:05 AM1/7/09
to android...@googlegroups.com
that looks correct. can you show the whole radio log, there should be some RILD messages telling you if there was a failure opening the device file (which could be caused by permission problems). You can also try to hack the mainLoop() function in hardware/ril/reference-ril/reference-ril.c that does the opening, to give more diagnostics if needed.

Mikkel Christensen

unread,
Jan 7, 2009, 9:38:22 AM1/7/09
to android-porting
You can try to change permisson on /dev/ttyS0 to 777 in init.rc
Do you know what baud rate you modem runs? Per default the RIL is
hardcoded with 115200 baud, so you need to change that if the modem
supports another rate.

You can also take a look at the omapzoom.org tree... it has some
modifications to the ref ril that you might like.

Best regards,
Mikkel

On Jan 7, 7:27 am, "David Turner" <di...@android.com> wrote:
> that looks correct. can you show the whole radio log, there should be some
> RILD messages telling you if there was a failure opening the device file
> (which could be caused by permission problems). You can also try to hack the
> mainLoop() function in hardware/ril/reference-ril/reference-ril.c that does
> the opening, to give more diagnostics if needed.
>
> On Wed, Jan 7, 2009 at 12:43 PM, Nimit Manglick <nimitandr...@gmail.com>wrote:
>
>
>
>
>
> > I am running it from init.rc script as :-
>
> > /system/bin/rild -l /system/lib/libreference-ril.so -- -d /dev/ttyS0
>
> > My modem is connected to ttyS0 only.
>
> > On Wed, Jan 7, 2009 at 4:39 PM, David Turner <di...@android.com> wrote:
>
> >> you need to start the rild daemon in your init config/script
> >> have a look at the content of /system/etc/init*.(rc|sh) for examples
>
> >> On Wed, Jan 7, 2009 at 11:32 AM, Nimit Manglick <nimitandr...@gmail.com>wrote:
>
> >>> Hi David,
>
> >>> Its showing me the following errors :-
>
> >>> *Can't open /system/etc/voicemail-conf.xml*
> >>> D/RILJ    (  681): [0000]> GET_CURRENT_CALLS
> >>> D/GSM     (  681): Poll ServiceState done:  oldSS=[1 home null null null
> >>> ] newSS=[1 home null null null ] oldGprs=1 newGprs=n
> >>> D/RILJ    (  681): [0000]< GET_CURRENT_CALLS error:
> >>> com.android.internal.telephony.gsm.CommandException: RADIO_NOT_AVAILABLE
> >>> D/GSM     (  681): [DataConnectionTracker] Radio is off and clean up all
> >>> connection
> >>> D/GSM     (  681): [DataConnectionTracker] Clean up connection due to
> >>> radioTurnedOff
> >>> D/GSM     (  681): [DataConnection] Stop poll NetStat
> >>> D/GSM     (  681): [DataConnection] Stop poll NetStat
> >>> D/GSM     (  681): [DataConnectionTracker] ***trySetupData due to
> >>> roamingOff
> >>> D/GSM     (  681): [DataConnectionTracker] trySetupData: Not ready for
> >>> data:  dataState=IDLE gprsState=1 sim=false UMTS=false
> >>> D/GSM     (  681): [GsmSimCard] Broadcasting intent
> >>> SIM_STATE_CHANGED_ACTION NOT_READY reason null
> >>> *I/RILJ    (  681): Couldn't find 'rild' socket; retrying after timeout*
> >>> D/RILJ    (  681): WAKE_LOCK_TIMEOUT  mReqPending=0 mRequestList=0
> >>> I/RILJ    (  681): Couldn't find 'rild' socket; retrying after timeout
>
> >>> I Think its not able to create the rild socket.
>
> >>> So in libril/ril.cpp I have enabled that piece of code where it stars to
> >>> listen to this socket.
>
> >>> Please give me soem pointers from where should i start.
>
> >>> Thanks & Regards
>
> >>> On Wed, Jan 7, 2009 at 3:14 PM, Nimit Manglick <nimitandr...@gmail.com>wrote:
>
> >>>> Hi All,
>
> >>>> I am trying to implement RIL and having OMAP 3530 EVM with GSM modem
> >>>> connected at /dev/ttyS0.
>
> >>>> I tried some suggestions but my dialer application is giving me the
> >>>> following error :-
>
> >>>> "Not Registered on Network" in message box where after pressing "OK"
> >>>> dialer application
>
> >>>>  goes off. There was not much info on logcat as well.
>
> >>>> Any pointer or suggestion would be appreciated.
>
> >>>> Thanks & Regards
> >>>> Nimit- Hide quoted text -
>
> - Show quoted text -

Nimit Manglick

unread,
Jan 7, 2009, 9:47:46 AM1/7/09
to android...@googlegroups.com
Hi David / Mikkel, 

/system/bin/rild -l /system/lib/libreference-ril.so -- -d /dev/ttyS0

is not executing from init.rc

So i manually tried to start it, it has thrown error as :-

# /system/bin/rild -l /system/lib/libreference-ril.so -- -d /dev/ttyS0
opening AT interface. retrying...: Permission denied


Then i tried changing its permission to 777 the it has thrown error  as :-


# /system/bin/rild -l /system/lib/libreference-ril.so -- -d /dev/ttyS0
opening AT interface. retrying...: No such file or directory


And the complete radio log is :-
# logcat -b radio
I/RIL     (  666): Nimit log 1 in reference ril Ril_init function
I/RIL     (  666): Opening tty device /dev/ttyS0
D/RIL     (  666): Nimit Log 2 serial port name in reference ril Ril_init function is /dev/ttyS0
I/RIL     (  666): Nimit Log 2 serial port name in reference ril Ril_init function is /dev/ttyS0
E/RILC    (  666): Nimit log 1 inside libril inside Ril_register function
E/RILC    (  666): Nimit log 2 inside libril inside Ril_register function before opening teh socket
E/RILC    (  666): Failed to get socket 'rild-debug' errno:0
W/GSM     (  688): Can't open /system/etc/voicemail-conf.xml
D/RILJ    (  688): [0000]> GET_CURRENT_CALLS
D/GSM     (  688): Poll ServiceState done:  oldSS=[1 home null null null ] newSS=[1 home null null null ] oldGprs=1 newGprs=n
D/RILJ    (  688): [0000]< GET_CURRENT_CALLS error: com.android.internal.telephony.gsm.CommandException: RADIO_NOT_AVAILABLE
D/GSM     (  688): [DataConnectionTracker] Radio is off and clean up all connection
D/GSM     (  688): [DataConnectionTracker] Clean up connection due to radioTurnedOff
D/GSM     (  688): [DataConnection] Stop poll NetStat
D/GSM     (  688): [DataConnection] Stop poll NetStat
D/GSM     (  688): [DataConnectionTracker] ***trySetupData due to roamingOff
D/GSM     (  688): [DataConnectionTracker] trySetupData: Not ready for data:  dataState=IDLE gprsState=1 sim=false UMTS=false
D/GSM     (  688): [GsmSimCard] Broadcasting intent SIM_STATE_CHANGED_ACTION NOT_READY reason null
I/RILJ    (  688): Couldn't find 'rild' socket; retrying after timeout
D/RILJ    (  688): WAKE_LOCK_TIMEOUT  mReqPending=0 mRequestList=0
I/RILJ    (  688): Couldn't find 'rild' socket; retrying after timeout
I/RILJ    (  688): Couldn't find 'rild' socket; retrying after timeout
I/RILJ    (  688): Couldn't find 'rild' socket; retrying after timeout
I/RILJ    (  688): Couldn't find 'rild' socket; retrying after timeout
I/RILJ    (  688): Couldn't find 'rild' socket; retrying after timeout
I/RILJ    (  688): Couldn't find 'rild' socket; retrying after timeout
E/RILJ    (  688): Couldn't find 'rild' socket after 8 times, continuing to retry silently




Mikkel,

Can you please tell me how to browse the code you are mentioning on omapzoom.org tree ?

Where to set the baud rate in RIl ??

I am not able to find that.

Thanks
Nimit

Nimit Manglick

unread,
Jan 7, 2009, 11:10:01 AM1/7/09
to android...@googlegroups.com
In ril.cpp i have enabled that piece of code which is trying to create a rild socket.

ret = socket_local_server (SOCKET_NAME_RIL,
            ANDROID_SOCKET_NAMESPACE_ABSTRACT, SOCK_STREAM);


So after that i have commented #else also because i think after opening teh socket it needs to call  android_get_control_socket(SOCKET_NAME_RIL);

and it can listen to the client request on it by listen(s_fdListen, 4);

But its giving error at
android_get_control_socket(SOCKET_NAME_RIL);

saying Failed to get socket 'rild'

Nimit Manglick

unread,
Jan 9, 2009, 12:02:43 AM1/9/09
to android...@googlegroups.com

Now i am getting the following error :-


Couldn't find 'rild' socket; retrying after timeout


So I think the rild daemon is not able to open the socket for its clients like dialer.

Hence when i click on the dialer app it crashes throwing me the error

"Not registered on Network"

So please give me some pointers so that i can proceed further.

Mikkel,

Please tell me how to browse the reference ril source code from omapzoom.org

Thanks & Regards
Nimit

David Turner

unread,
Jan 9, 2009, 2:01:55 AM1/9/09
to android...@googlegroups.com
it's more likely that this messages comes from a client that tries to connect to the rild socket.
I suspect a permission problem, what is the content of "adb shell ls -l /dev/socket/*" ?

Nimit Manglick

unread,
Jan 9, 2009, 4:00:59 AM1/9/09
to android...@googlegroups.com
Yes the message comes from the dialer client only from

frameworks/base/telephony/
java/com/android/internal/telephony/gsm/RIL.java file.

To my surprise the rild socket also gets created because the contents of /dev/sockets are :-


# ls -l
srw------- system   system            2000-01-01 00:00 installd
srw-rw---- bluetooth bluetooth          2000-01-01 00:00 dbus
srw-rw-rw- root     root              2000-01-01 00:00 zygote
srw-rw---- root     radio             2000-01-01 00:00 rild
srw-rw---- radio    system            2000-01-01 00:00 rild-debug
srw-rw---- root     mount             2000-01-01 00:00 mountd
srw-rw-rw- root     root              2000-01-01 00:00 property_service


and ls -l /dev/ttyS0 are :-

crw------- root     root       4,  64 2000-01-01 00:00 ttyS0

I am trying to change teh permissions from the init.rc script for ttyS0 as

chmod 777 /dev/ttyS0  but its not reflecting

Also my init.rc contains the folowing for rild daemon :-

 chmod 777 /dev/ttyS0
service ril-daemon /system/bin/rild -l /system/lib/libreference-ril.so -- -d /dev/ttyS0
    socket rild stream 660 root radio
    socket rild-debug stream 660 radio system
    user root
    group radio cache inet misc


Any pointers will be much helpful. As i am in total soup now.

Thanks & Regards
Nimit


On Fri, Jan 9, 2009 at 12:44 PM, Nimit Manglick <nimita...@gmail.com> wrote:
Yes the message comes from the dialer client only from

frameworks/base/telephony/java/com/android/internal/telephony/gsm/RIL.java file.

To my surprise the rild socket also gets created because the contents of /dev/sockets are :-


# ls -l
srw------- system   system            2000-01-01 00:00 installd
srw-rw---- bluetooth bluetooth          2000-01-01 00:00 dbus
srw-rw-rw- root     root              2000-01-01 00:00 zygote
srw-rw---- root     radio             2000-01-01 00:00 rild
srw-rw---- radio    system            2000-01-01 00:00 rild-debug
srw-rw---- root     mount             2000-01-01 00:00 mountd
srw-rw-rw- root     root              2000-01-01 00:00 property_service


and ls -l /dev/ttyS0 are :-

crw------- root     root       4,  64 2000-01-01 00:00 ttyS0

I am trying to change teh permissions from the init.rc script for ttyS0 as

chmod 777 /dev/ttyS0  but its not reflecting

Also my init.rc contains the folowing for rild daemon :-

 chmod 777 /dev/ttyS0
service ril-daemon /system/bin/rild -l /system/lib/libreference-ril.so -- -d /dev/ttyS0
    socket rild stream 660 root radio
    socket rild-debug stream 660 radio system
    user root
    group radio cache inet misc


Any pointers will be much helpful. As i am in total soup now.

Thanks & Regards
Nimit



On Fri, Jan 9, 2009 at 11:23 AM, Nimit Manglick <nimita...@gmail.com> wrote:
Hi,



I am getting the following error :-



Couldn't find 'rild' socket; retrying after timeout

So I think the rild daemon is not able to open the socket for its clients like dialer.

Hence when i click on the dialer app it crashes throwing me the error

"Not registered on Network"

So please give me some pointers so that i can proceed further.


Thanks & Regards
Nimit


Nimit Manglick

unread,
Mar 12, 2009, 12:52:09 AM3/12/09
to Mallesh, android...@googlegroups.com
Hi..

Try changing :-

#if 0 --> #if 1 at line no 1701 in ril.cpp

And

commenting corresponding #else at line no 1713 in ril.cpp.

Regards
Nimit

On Tue, Mar 10, 2009 at 3:07 PM, Mallesh <annya...@gmail.com> wrote:
Hi Nimit,

Even I changed the permission of /dev/ttyS0 as 777.
i am getting following log messages from logcat -b radio,

E/RILC    (  554): RIL_register: RIL_RadioFunctions * null or invalid
version (expected 2)
W/GSM     (  609): Can't open /system/etc/voicemail-conf.xml
D/RILJ    (  609): [0000]> GET_CURRENT_CALLS
D/RILJ    (  609): [0000]< GET_CURRENT_CALLS error:
com.android.internal.telephony.gsm.CommandException:
RADIO_NOT_AVAILABLE
D/GSM     (  609): Poll ServiceState done:  oldSS=[1 home null null
null ] newSS=[1 home null null null ] oldGprs=1 newGprs=1
oldType=unknown newType=unknown
D/GSM     (  609): [DataConnectionTracker] Radio is off and clean up
all connection
D/GSM     (  609): [DataConnectionTracker] Clean up connection due to
radioTurnedOff
D/GSM     (  609): [DataConnection] Stop poll NetStat
D/GSM     (  609): [DataConnection] Stop poll NetStat
D/GSM     (  609): [DataConnectionTracker] ***trySetupData due to
roamingOff
D/GSM     (  609): [DataConnectionTracker] trySetupData: Not ready for
data:  dataState=IDLE gprsState=1 sim=false UMTS=false phoneState=IDLE
dataEnabled=true roaming=false dataOnRoamingEnable=false
D/GSM     (  609): [GsmSimCard] Broadcasting intent
SIM_STATE_CHANGED_ACTION NOT_READY reason null
I/RILJ    (  609): Couldn't find 'rild' socket; retrying after timeout
D/RILJ    (  609): WAKE_LOCK_TIMEOUT  mReqPending=0 mRequestList=0
I/RILJ    (  609): Couldn't find 'rild' socket; retrying after timeout
I/RILJ    (  609): Couldn't find 'rild' socket; retrying after timeout
I/RILJ    (  609): Couldn't find 'rild' socket; retrying after timeout
I/RILJ    (  609): Couldn't find 'rild' socket; retrying after timeout
I/RILJ    (  609): Couldn't find 'rild' socket; retrying after timeout
I/RILJ    (  609): Couldn't find 'rild' socket; retrying after timeout
E/RILJ    (  609): Couldn't find 'rild' socket after 8 times,
continuing to retry silently

Any suggest will helpful to resolve this problem since you are faced
same problem...
Thanks and regards
Mallesh


On Jan 9, 2:00 pm, "Nimit Manglick" <nimitandr...@gmail.com> wrote:
> Yes the message comes from the dialer client only from
>
> frameworks/base/telephony/java/com/android/internal/telephony/gsm/RIL.java
> file.
>
> To my surprise the rild socket also gets created because the contents of
> /dev/sockets are :-
>
> # ls -l
> srw------- system   system            2000-01-01 00:00 installd
> srw-rw---- bluetooth bluetooth          2000-01-01 00:00 dbus
> srw-rw-rw- root     root              2000-01-01 00:00 zygote
> *srw-rw---- root     radio             2000-01-01 00:00 rild*

> srw-rw---- radio    system            2000-01-01 00:00 rild-debug
> srw-rw---- root     mount             2000-01-01 00:00 mountd
> srw-rw-rw- root     root              2000-01-01 00:00 property_service
>
> and ls -l /dev/ttyS0 are :-
>
> crw------- root     root       4,  64 2000-01-01 00:00 ttyS0
>
> I am trying to change teh permissions from the init.rc script for ttyS0 as
>
> chmod 777 /dev/ttyS0  but its not reflecting
>
> Also my init.rc contains the folowing for rild daemon :-
>
>  chmod 777 /dev/ttyS0
> service ril-daemon /system/bin/rild -l /system/lib/libreference-ril.so -- -d
> /dev/ttyS0
>     socket rild stream 660 root radio
>     socket rild-debug stream 660 radio system
>     user root
>     group radio cache inet misc
>
> Any pointers will be much helpful. As i am in total soup now.
>
> Thanks & Regards
> Nimit
>
> On Fri, Jan 9, 2009 at 12:44 PM, Nimit Manglick <nimitandr...@gmail.com>wrote:
>
> > Yes the message comes from the dialer client only from
>
> > frameworks/base/telephony/java/com/android/internal/telephony/gsm/RIL.java
> > file.
>
> > To my surprise the rild socket also gets created because the contents of
> > /dev/sockets are :-
>
> > # ls -l
> > srw------- system   system            2000-01-01 00:00 installd
> > srw-rw---- bluetooth bluetooth          2000-01-01 00:00 dbus
> > srw-rw-rw- root     root              2000-01-01 00:00 zygote
> > *srw-rw---- root     radio             2000-01-01 00:00 rild*

> > srw-rw---- radio    system            2000-01-01 00:00 rild-debug
> > srw-rw---- root     mount             2000-01-01 00:00 mountd
> > srw-rw-rw- root     root              2000-01-01 00:00 property_service
>
> > and ls -l /dev/ttyS0 are :-
>
> > crw------- root     root       4,  64 2000-01-01 00:00 ttyS0
>
> > I am trying to change teh permissions from the init.rc script for ttyS0 as
>
> > chmod 777 /dev/ttyS0  but its not reflecting
>
> > Also my init.rc contains the folowing for rild daemon :-
>
> >  chmod 777 /dev/ttyS0
> > service ril-daemon /system/bin/rild -l /system/lib/libreference-ril.so --
> > -d /dev/ttyS0
> >     socket rild stream 660 root radio
> >     socket rild-debug stream 660 radio system
> >     user root
> >     group radio cache inet misc
>
> > Any pointers will be much helpful. As i am in total soup now.
>
> > Thanks & Regards
> > Nimit
>

RajaniKanth

unread,
Apr 28, 2009, 5:16:55 AM4/28/09
to android-porting
Hi ,
I was trying out to create an Android Application which will
use

PhoneFactory.makeDefaultPhones(mContext);
mGSMPhone = (GSMPhone) PhoneFactory.getDefaultPhone();

to get the GSMPhone instance, But when i try this i get "Couldn't find
'rild' socket; retrying after timeout" error.

I had disabled the default PhoneApp from making rild socket connection
using


adb shell stop
adb shell setprop ro.radio.noril yes
adb shell start

Could you please help me out.

Daniel Baeyens

unread,
May 6, 2009, 5:00:29 AM5/6/09
to Nimit Manglick, android...@googlegroups.com
Hi Nimit (and all the list),

How did you solve this problem?

I think now I'm facing a similar problem. I'm trying to test a 3G USB
dongle with Android. For this:

- I've needed to discard Android emulator because it doesn't allow to
attach USB devices with -qemu -usb -usbdevice parameters (anyone knows
if this has changed?)
- Using a x86 image for eeepc, I have not been able to use qemu,
because the framebuffer didn't start correctly (and I would have the
same problem as the next point)
- Using a x86 image for eeepc, I have tried to use it on Sun
Virtualbox. With this one, the image started correctly, Android showed
up and I have been able to check that my serial devices are on /dev/
and the kernel seems to be working ok, but...

Now, rild is correctly configured on init.rc and the system properties
should be correctly set. The sockets appear on the /dev/socket/ dir,
but Android always launches the Modem Emulator (instead of using the
USB dongle), fakes the modem and says that I'm on roaming and data
connected. If I restart the whole android (killing system-services or
killing zygote), it launches the Modem emulator. If I kill just rild,
I see some activity on the USB icon of VirtualBox, but Android does
not switch from the emulator to rild... and if I restart android
again, rild is again not used...

I can't understand what's happening as I think I have no more things
to test... Is it familiar this problem to you?

Thank you very much, kind regards,

On 9 ene, 11:00, "Nimit Manglick" <nimitandr...@gmail.com> wrote:
> Yes the message comes from the dialer client only from
>
> frameworks/base/telephony/java/com/android/internal/telephony/gsm/RIL.java
> file.
>
> To my surprise the rild socket also gets created because the contents of
> /dev/sockets are :-
>
> # ls -l
> srw------- system   system            2000-01-01 00:00 installd
> srw-rw---- bluetooth bluetooth          2000-01-01 00:00 dbus
> srw-rw-rw- root     root              2000-01-01 00:00 zygote

> *srw-rw---- root     radio             2000-01-01 00:00 rild*


> srw-rw---- radio    system            2000-01-01 00:00 rild-debug
> srw-rw---- root     mount             2000-01-01 00:00 mountd
> srw-rw-rw- root     root              2000-01-01 00:00 property_service
>
> and ls -l /dev/ttyS0 are :-
>
> crw------- root     root       4,  64 2000-01-01 00:00 ttyS0
>
> I am trying to change teh permissions from the init.rc script for ttyS0 as
>
> chmod 777 /dev/ttyS0  but its not reflecting
>
> Also my init.rc contains the folowing for rild daemon :-
>
>  chmod 777 /dev/ttyS0
> service ril-daemon /system/bin/rild -l /system/lib/libreference-ril.so -- -d
> /dev/ttyS0
>     socket rild stream 660 root radio
>     socket rild-debug stream 660 radio system
>     user root
>     group radio cache inet misc
>
> Any pointers will be much helpful. As i am in total soup now.
>
> Thanks & Regards
> Nimit
>

> On Fri, Jan 9, 2009 at 12:44 PM, Nimit Manglick <nimitandr...@gmail.com>wrote:
>
> > Yes the message comes from the dialer client only from
>
> > frameworks/base/telephony/java/com/android/internal/telephony/gsm/RIL.java
> > file.
>
> > To my surprise the rild socket also gets created because the contents of
> > /dev/sockets are :-
>
> > # ls -l
> > srw------- system   system            2000-01-01 00:00 installd
> > srw-rw---- bluetooth bluetooth          2000-01-01 00:00 dbus
> > srw-rw-rw- root     root              2000-01-01 00:00 zygote

> > *srw-rw---- root     radio             2000-01-01 00:00 rild*


> > srw-rw---- radio    system            2000-01-01 00:00 rild-debug
> > srw-rw---- root     mount             2000-01-01 00:00 mountd
> > srw-rw-rw- root     root              2000-01-01 00:00 property_service
>
> > and ls -l /dev/ttyS0 are :-
>
> > crw------- root     root       4,  64 2000-01-01 00:00 ttyS0
>
> > I am trying to change teh permissions from the init.rc script for ttyS0 as
>
> > chmod 777 /dev/ttyS0  but its not reflecting
>
> > Also my init.rc contains the folowing for rild daemon :-
>
> >  chmod 777 /dev/ttyS0
> > service ril-daemon /system/bin/rild -l /system/lib/libreference-ril.so --
> > -d /dev/ttyS0
> >     socket rild stream 660 root radio
> >     socket rild-debug stream 660 radio system
> >     user root
> >     group radio cache inet misc
>
> > Any pointers will be much helpful. As i am in total soup now.
>
> > Thanks & Regards
> > Nimit
>

David Turner

unread,
May 7, 2009, 6:02:26 AM5/7/09
to android...@googlegroups.com, Nimit Manglick
On Wed, May 6, 2009 at 11:00 AM, Daniel Baeyens <daniel....@gmail.com> wrote:

Hi Nimit (and all the list),

How did you solve this problem?

I think now I'm facing a similar problem. I'm trying to test a 3G USB
dongle with Android. For this:

- I've needed to discard Android emulator because it doesn't allow to
attach USB devices with -qemu -usb -usbdevice parameters (anyone knows
if this has changed?)

no, this didn't change, but did you try the -radio <device> option to connect the modem emulation
directly to your dongle ? Assuming <device> points to a device file corresponding to an AT command
channel (this won't help for the real data communication though which will still happen with BSD sockets)
 

Daniel Baeyens

unread,
May 7, 2009, 6:23:03 AM5/7/09
to android...@googlegroups.com, Nimit Manglick
Hi,

Thanks for the info

-radio already worked perfect :D . Previously I have been using this
parameter for testing some AT commands, but for data connections, my
USB dongle can work in two ways. You can send the correct AT commands
to call and stablish a data connection ("classic" mode) or you can
send one AT command which launches an internal PPP and shows on the
system a network interface. For this task I need to have the whole
device supported on the virtual machine (with kernel drivers compiled
and so all).

I have been able to set up my connection manually, sending AT commands
with a small C program, then setting up by hand the network interface,
DNS and the default route through that device. But my problem has been
with rild/the rest of the system, because it seems to launch the modem
emulator instead of using the attached device.

Any hint? :)

Kind regards,
--
Daniel Baeyens
Warp Networks S.L. - http://www.warp.es

David Turner

unread,
May 7, 2009, 7:37:28 AM5/7/09
to android...@googlegroups.com, Nimit Manglick
On Thu, May 7, 2009 at 12:23 PM, Daniel Baeyens <dbae...@warp.es> wrote:

Hi,

Thanks for the info

-radio already worked perfect :D . Previously I have been using this
parameter for testing some AT commands, but for data connections, my
USB dongle can work in two ways. You can send the correct AT commands
to call and stablish a data connection ("classic" mode) or you can
send one AT command which launches an internal PPP and shows on the
system a network interface. For this task I need to have the whole
device supported on the virtual machine (with kernel drivers compiled
and so all).

I have been able to set up my connection manually, sending AT commands
with a small C program, then setting up by hand the network interface,
DNS and the default route through that device. But my problem has been
with rild/the rest of the system, because it seems to launch the modem
emulator instead of using the attached device.

Any hint? :)

Yes, have a look at hardware/ril/rild/rild.c and look for a comment that says "special override when in the emulator"
this is followed by code in a #if 1 ... #endif block that is used to override the ril settings when the daemon detects
that it is running in the emulator. Just replace the 3#if 1" by "#if 0" to disable this in your build of the system image.
 
Also, you may need to modify the content of system/core/rootdir/etc/init.golfish.rc (and init.goldfish.sh) if you want
to use a PPP device for the data connection.

Hope this helps

Daniel Baeyens

unread,
May 7, 2009, 8:59:28 AM5/7/09
to android...@googlegroups.com
Hi,

On Thu, May 7, 2009 at 1:37 PM, David Turner <di...@android.com> wrote:
> On Thu, May 7, 2009 at 12:23 PM, Daniel Baeyens <dbae...@warp.es> wrote:
>>
>> Hi,
>>
>> Thanks for the info
>>
>> -radio already worked perfect :D . Previously I have been using this
>> parameter for testing some AT commands, but for data connections, my
>> USB dongle can work in two ways. You can send the correct AT commands
>> to call and stablish a data connection ("classic" mode) or you can
>> send one AT command which launches an internal PPP and shows on the
>> system a network interface. For this task I need to have the whole
>> device supported on the virtual machine (with kernel drivers compiled
>> and so all).
>>
>> I have been able to set up my connection manually, sending AT commands
>> with a small C program, then setting up by hand the network interface,
>> DNS and the default route through that device. But my problem has been
>> with rild/the rest of the system, because it seems to launch the modem
>> emulator instead of using the attached device.
>>
>> Any hint? :)
>
> Yes, have a look at hardware/ril/rild/rild.c and look for a comment that
> says "special override when in the emulator"
> this is followed by code in a #if 1 ... #endif block that is used to
> override the ril settings when the daemon detects
> that it is running in the emulator. Just replace the 3#if 1" by "#if 0" to
> disable this in your build of the system image.

Ok, checking the code, I've seen that this part I had it already with
"#if 0". I have done a couple of tests, and I've seen that rild is
correctly getting the /dev/tty device. If I send AT commands with my
tool, and then I "kill <rild_pid>", I see distinct strings on "logcat
-b radio", so rild is working... Thanks for the tip :)

But my real problem is still there... When the UI starts, I'm seeing
fake info (it says that I'm in roaming and data connected with Edge).
This is simply not possible (using a SIM card from my own country,
which doesn't support EDGE anywhere :P).

Maybe my problem is with the "/dev/socket/rild" and
"/dev/socket/rild-debug"?. Doing a "ls -l /dev/socket/", rild is a
socket, with 660 permissions for root:radio, and rild-debug is a
socket with 660 permissions for radio:system (as it is specified on
init.rc)

What part of android tries to use them, and what does it do when
something doesn't work?

> Also, you may need to modify the content of
> system/core/rootdir/etc/init.golfish.rc (and init.goldfish.sh) if you want
> to use a PPP device for the data connection.

Nice :) But I would like to connect with the USB dongle configuring up
the network device. In case this would be impossible, then I'll try
with ppp. Thanks for pointing this other bit

> Hope this helps
Not really, but I'm pretty close ;)

Thanks and kind regards,

Daniel Baeyens

unread,
May 7, 2009, 12:23:35 PM5/7/09
to android...@googlegroups.com
Hi again,
So close that now is fixed. My problem (for future references) was:

on frameworks/base/telephony/java/com/android/internal/telephony/PhoneFactory.java,
you can find:

if ((SystemProperties.get("ro.radio.noril","")).equals("")) {
useNewRIL(context);
} else {
GSMPhone phone;
phone = new GSMPhone(context, new SimulatedCommands(), sPhoneNotifier);
registerPhone (phone);
}

as I was using the eeepc_701 branch, they had set "ro.radio.noril" to
"yes" to enable the emulator, so I changed it to "no" (to enable ril),
and this made this block to enable the emulator.

Doesn't exist any type-check on the system properties? It would be
great to avoid problems like this (or having values like "yes",
"true", "1" to set the same thing).

Thank you very much for your help,
Reply all
Reply to author
Forward
0 new messages