GPRS FSO

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (Fixed connect script to work with empty username and/or password too.)
Line 13: Line 13:
  
 
The methods available:
 
The methods available:
  [METHOD]    org.freesmartphone.GSM.PDP.ActivateContext( s:apn, s:user, s:password )
+
[METHOD]    org.freesmartphone.GSM.PDP.ActivateContext( s:apn, s:user, s:password )
  [METHOD]    org.freesmartphone.GSM.PDP.DeactivateContext()
+
[METHOD]    org.freesmartphone.GSM.PDP.DeactivateContext()
  [METHOD]    org.freesmartphone.GSM.PDP.GetCurrentGprsClass()
+
[METHOD]    org.freesmartphone.GSM.PDP.GetCurrentGprsClass()
  [METHOD]    org.freesmartphone.GSM.PDP.ListAvailableGprsClasses()
+
[METHOD]    org.freesmartphone.GSM.PDP.ListAvailableGprsClasses()
  [METHOD]    org.freesmartphone.GSM.PDP.SetCurrentGprsClass( s:class_ )
+
[METHOD]    org.freesmartphone.GSM.PDP.SetCurrentGprsClass( s:class_ )
  [SIGNAL]    org.freesmartphone.GSM.PDP.ContextStatus( i:index, s:status, a{sv}:properties )
+
[SIGNAL]    org.freesmartphone.GSM.PDP.ContextStatus( i:index, s:status, a{sv}:properties )
  
 
Use ''mdbus -s -l'' to monitor the emitted signals.  Signals will look like this:
 
Use ''mdbus -s -l'' to monitor the emitted signals.  Signals will look like this:
  
 
:ActivateContext( s:apn, s:user, s:password )
 
:ActivateContext( s:apn, s:user, s:password )
  [SIGNAL]    org.freesmartphone.GSM.PDP.ContextStatus    from :1.3 /org/freesmartphone/GSM/Device
+
[SIGNAL]    org.freesmartphone.GSM.PDP.ContextStatus    from :1.3 /org/freesmartphone/GSM/Device
  (dbus.Int32(1), dbus.String(u'outgoing'), dbus.Dictionary({}, signature=dbus.Signature('sv')))</code>
+
(dbus.Int32(1), dbus.String(u'outgoing'), dbus.Dictionary({}, signature=dbus.Signature('sv')))</code>
 
:Once the connection is established (takes 3-4 seconds for me) a new signal is emited
 
:Once the connection is established (takes 3-4 seconds for me) a new signal is emited
  [SIGNAL]    org.freesmartphone.GSM.PDP.ContextStatus    from :1.3 /org/freesmartphone/GSM/Device
+
[SIGNAL]    org.freesmartphone.GSM.PDP.ContextStatus    from :1.3 /org/freesmartphone/GSM/Device
  (dbus.Int32(1), dbus.String(u'active'), dbus.Dictionary({}, signature=dbus.Signature('sv')))
+
(dbus.Int32(1), dbus.String(u'active'), dbus.Dictionary({}, signature=dbus.Signature('sv')))
 
:DeactivateContext
 
:DeactivateContext
  [SIGNAL]    org.freesmartphone.GSM.PDP.ContextStatus    from :1.3 /org/freesmartphone/GSM/Device
+
[SIGNAL]    org.freesmartphone.GSM.PDP.ContextStatus    from :1.3 /org/freesmartphone/GSM/Device
  (dbus.Int32(1), dbus.String(u'release'), dbus.Dictionary({}, signature=dbus.Signature('sv')))
+
(dbus.Int32(1), dbus.String(u'release'), dbus.Dictionary({}, signature=dbus.Signature('sv')))
  
== Until there's a GUI ==
+
== Using scripts ==
  
 
While we wait for the preferences part of FSO to be completed (and a GUI), we can use two shell scripts. You need to know three things to successfully connect via GPRS (your carrier should provide this information to you):
 
While we wait for the preferences part of FSO to be completed (and a GUI), we can use two shell scripts. You need to know three things to successfully connect via GPRS (your carrier should provide this information to you):
Line 42: Line 42:
 
To connect, put the following in a file and make it executable (<code>chmod +x gprs-on.sh</code>):
 
To connect, put the following in a file and make it executable (<code>chmod +x gprs-on.sh</code>):
  
#!/bin/sh
+
#!/bin/sh
APN="internet.parlino.se"
+
APN="internet.parlino.se"
USERNAME="x"
+
USERNAME="x"
PASSWORD="x"
+
PASSWORD="x"
BUSNAME="org.freesmartphone.frameworkd"
+
BUSNAME="org.freesmartphone.frameworkd"
OBJECTPATH="/org/freesmartphone/GSM/Device"
+
OBJECTPATH="/org/freesmartphone/GSM/Device"
METHODNAME="org.freesmartphone.GSM.PDP.ActivateContext"
+
METHODNAME="org.freesmartphone.GSM.PDP.ActivateContext"
mdbus -s $BUSNAME $OBJECTPATH $METHODNAME $APN "$USERNAME" "$PASSWORD"
+
mdbus -s $BUSNAME $OBJECTPATH $METHODNAME $APN "$USERNAME" "$PASSWORD"
  
 
To disconnect, use the following method instead (<code>chmod +x gprs-off.sh</code>):
 
To disconnect, use the following method instead (<code>chmod +x gprs-off.sh</code>):
  
#!/bin/sh
+
#!/bin/sh
BUSNAME="org.freesmartphone.frameworkd"
+
BUSNAME="org.freesmartphone.frameworkd"
OBJECTPATH="/org/freesmartphone/GSM/Device"
+
OBJECTPATH="/org/freesmartphone/GSM/Device"
METHODNAME="org.freesmartphone.GSM.PDP.DeactivateContext"
+
METHODNAME="org.freesmartphone.GSM.PDP.DeactivateContext"
mdbus -s $BUSNAME $OBJECTPATH $METHODNAME
+
mdbus -s $BUSNAME $OBJECTPATH $METHODNAME
  
 
The ''on'' script, using the ActivateContext method, will:
 
The ''on'' script, using the ActivateContext method, will:
Line 66: Line 66:
  
 
For a list of known APN:s, see the [[GPRS#Some_APN_names_for_reference|main GPRS page]].
 
For a list of known APN:s, see the [[GPRS#Some_APN_names_for_reference|main GPRS page]].
 
+
== Using a GUI ==
 +
[Framework-settings]
 
== See also ==
 
== See also ==
 
* [[GPRS]]
 
* [[GPRS]]

Revision as of 20:28, 12 November 2008

Key pages on:
FSO

(Other distributions)


This page documents the GSM networking solutions (commonly known as GPRS) using the FreeSmartphone.Org framework (FSO).

There are other ways to enable wireless communications on the smartphone, including Bluetooth and WLAN.

Contents

Current state

Since milestone 2 the system dbus has been extended with methods that enables connectivity using GPRS. The functionality is available under org.freesmartphone.frameworkd at /org/freesmartphone/GSM/Device.

The implementation should not interfer with other phone functionality, such as placing calls. In other words: you can use GPRS while talking on the phone without hanging up.

Currently, there's no GUI available but it's fairly easy to use the methods available using any dbus tool.

The methods available: [METHOD] org.freesmartphone.GSM.PDP.ActivateContext( s:apn, s:user, s:password ) [METHOD] org.freesmartphone.GSM.PDP.DeactivateContext() [METHOD] org.freesmartphone.GSM.PDP.GetCurrentGprsClass() [METHOD] org.freesmartphone.GSM.PDP.ListAvailableGprsClasses() [METHOD] org.freesmartphone.GSM.PDP.SetCurrentGprsClass( s:class_ ) [SIGNAL] org.freesmartphone.GSM.PDP.ContextStatus( i:index, s:status, a{sv}:properties )

Use mdbus -s -l to monitor the emitted signals. Signals will look like this:

ActivateContext( s:apn, s:user, s:password )

[SIGNAL] org.freesmartphone.GSM.PDP.ContextStatus from :1.3 /org/freesmartphone/GSM/Device (dbus.Int32(1), dbus.String(u'outgoing'), dbus.Dictionary({}, signature=dbus.Signature('sv')))</code>

Once the connection is established (takes 3-4 seconds for me) a new signal is emited

[SIGNAL] org.freesmartphone.GSM.PDP.ContextStatus from :1.3 /org/freesmartphone/GSM/Device (dbus.Int32(1), dbus.String(u'active'), dbus.Dictionary({}, signature=dbus.Signature('sv')))

DeactivateContext

[SIGNAL] org.freesmartphone.GSM.PDP.ContextStatus from :1.3 /org/freesmartphone/GSM/Device (dbus.Int32(1), dbus.String(u'release'), dbus.Dictionary({}, signature=dbus.Signature('sv')))

Using scripts

While we wait for the preferences part of FSO to be completed (and a GUI), we can use two shell scripts. You need to know three things to successfully connect via GPRS (your carrier should provide this information to you):

  • the APN to use,
  • the username, and
  • the password.

If your APN has no username or password, you must still provide a string to satisfy the framework's input requirements. Entering bogus data, such as the "x" above, will suffice.

To connect, put the following in a file and make it executable (chmod +x gprs-on.sh):

  1. !/bin/sh

APN="internet.parlino.se" USERNAME="x" PASSWORD="x" BUSNAME="org.freesmartphone.frameworkd" OBJECTPATH="/org/freesmartphone/GSM/Device" METHODNAME="org.freesmartphone.GSM.PDP.ActivateContext" mdbus -s $BUSNAME $OBJECTPATH $METHODNAME $APN "$USERNAME" "$PASSWORD"

To disconnect, use the following method instead (chmod +x gprs-off.sh):

  1. !/bin/sh

BUSNAME="org.freesmartphone.frameworkd" OBJECTPATH="/org/freesmartphone/GSM/Device" METHODNAME="org.freesmartphone.GSM.PDP.DeactivateContext" mdbus -s $BUSNAME $OBJECTPATH $METHODNAME

The on script, using the ActivateContext method, will:

  • setup a ppp interface (normally ppp0) (and assign IP address)
  • setup (replace) the default route
  • setup DNS

with settings received from the ISP.

For a list of known APN:s, see the main GPRS page.

Using a GUI

[Framework-settings]

See also

Personal tools
Key pages on:
FSO

(Other distributions)


This page documents the GSM networking solutions (commonly known as GPRS) using the FreeSmartphone.Org framework (FSO).

There are other ways to enable wireless communications on the smartphone, including Bluetooth and WLAN.

Current state

Since milestone 2 the system dbus has been extended with methods that enables connectivity using GPRS. The functionality is available under org.freesmartphone.frameworkd at /org/freesmartphone/GSM/Device.

The implementation should not interfer with other phone functionality, such as placing calls. In other words: you can use GPRS while talking on the phone without hanging up.

Currently, there's no GUI available but it's fairly easy to use the methods available using any dbus tool.

The methods available:

 [METHOD]    org.freesmartphone.GSM.PDP.ActivateContext( s:apn, s:user, s:password )
 [METHOD]    org.freesmartphone.GSM.PDP.DeactivateContext()
 [METHOD]    org.freesmartphone.GSM.PDP.GetCurrentGprsClass()
 [METHOD]    org.freesmartphone.GSM.PDP.ListAvailableGprsClasses()
 [METHOD]    org.freesmartphone.GSM.PDP.SetCurrentGprsClass( s:class_ )
 [SIGNAL]    org.freesmartphone.GSM.PDP.ContextStatus( i:index, s:status, a{sv}:properties )

Use mdbus -s -l to monitor the emitted signals. Signals will look like this:

ActivateContext( s:apn, s:user, s:password )
 [SIGNAL]    org.freesmartphone.GSM.PDP.ContextStatus    from :1.3 /org/freesmartphone/GSM/Device
 (dbus.Int32(1), dbus.String(u'outgoing'), dbus.Dictionary({}, signature=dbus.Signature('sv')))</code>
Once the connection is established (takes 3-4 seconds for me) a new signal is emited
 [SIGNAL]    org.freesmartphone.GSM.PDP.ContextStatus    from :1.3 /org/freesmartphone/GSM/Device
 (dbus.Int32(1), dbus.String(u'active'), dbus.Dictionary({}, signature=dbus.Signature('sv')))
DeactivateContext
 [SIGNAL]    org.freesmartphone.GSM.PDP.ContextStatus    from :1.3 /org/freesmartphone/GSM/Device
 (dbus.Int32(1), dbus.String(u'release'), dbus.Dictionary({}, signature=dbus.Signature('sv')))

Until there's a GUI

While we wait for the preferences part of FSO to be completed (and a GUI), we can use two shell scripts. You need to know three things to successfully connect via GPRS (your carrier should provide this information to you):

  • the APN to use,
  • the username, and
  • the password.

If your APN has no username or password, you must still provide a string to satisfy the framework's input requirements. Entering bogus data, such as the "x" above, will suffice.

To connect, put the following in a file and make it executable (chmod +x gprs-on.sh):

#!/bin/sh
APN="internet.parlino.se"
USERNAME="x"
PASSWORD="x"
BUSNAME="org.freesmartphone.frameworkd"
OBJECTPATH="/org/freesmartphone/GSM/Device"
METHODNAME="org.freesmartphone.GSM.PDP.ActivateContext"
mdbus -s $BUSNAME $OBJECTPATH $METHODNAME $APN "$USERNAME" "$PASSWORD"

To disconnect, use the following method instead (chmod +x gprs-off.sh):

#!/bin/sh
BUSNAME="org.freesmartphone.frameworkd"
OBJECTPATH="/org/freesmartphone/GSM/Device"
METHODNAME="org.freesmartphone.GSM.PDP.DeactivateContext"
mdbus -s $BUSNAME $OBJECTPATH $METHODNAME

The on script, using the ActivateContext method, will:

  • setup a ppp interface (normally ppp0) (and assign IP address)
  • setup (replace) the default route
  • setup DNS

with settings received from the ISP.

For a list of known APN:s, see the main GPRS page.

See also