Key pages on: FSO |
|
---|
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.
Since milestone 2 the system dbus has been extended with methods that enables connectivity using GPRS. The functionality is available under org.freesmartphone.ogsmd
at /org/freesmartphone/GSM/Device
.
The implementation should not interfere with other phone functionality, such as placing calls. In other words: you can use GPRS while talking on the phone without hanging up. Note though that depending on hardware and networking, simultaneous data transmission and voice call alerting (let alone performing calls) might not be possible.
Since FSO is a middleware it offers no GUI, however 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 roughly like this:
[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')))
[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')))
[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')))
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):
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.ogsmd" 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.ogsmd" OBJECTPATH="/org/freesmartphone/GSM/Device" METHODNAME="org.freesmartphone.GSM.PDP.DeactivateContext" mdbus -s $BUSNAME $OBJECTPATH $METHODNAME
The on script, using the ActivateContext method, will:
with settings received from the ISP.
For a list of known APN:s, see the main GPRS page.
SHR is based on FSO, so I think its GPRS settings should be found here. Shr has its native setting manager which has Connectivity sub-panel which in turn has settings for GPRS. Its very intutive and your GPRS/FR should be up and running in no time.
To enable gprs on-demand you need to do some manual changes in framework code. Alter, /usr/lib/python2.6/site-packages/framework/subsystems/ogsmd/modems/abstract/modem.py as:
--- orig.modem.py Sat Jul 18 02:13:29 2009 +++ modem.py Sat Jul 18 02:13:06 2009 @@ -76,6 +76,8 @@ 'proxyarp', 'replacedefaultroute', 'usepeerdns', + 'demand', + 'idle', '20', ] self._data["pppd-does-setup-and-teardown"] = True # default is using connect and disconnect scripts
Alter, /usr/lib/python2.6/site-packages/framework/subsystems/ogsmd/modems/abstract/pdp.py as:
--- orig.pdp.py Sat Jul 18 04:20:13 2009 +++ pdp.py Sat Jul 18 04:19:03 2009 @@ -219,7 +219,8 @@ """ PPP_DAEMON_SETUP["/etc/ppp/ip-down.d/92removedns"] = """#!/bin/sh -e -echo nameserver 127.0.0.1 > /etc/resolv.conf +echo nameserver 208.67.222.222 > /etc/resolv.conf +echo nameserver 208.67.220.220 >> /etc/resolv.conf """ PPP_DAEMON_SETUP[PPP_PAP_SECRETS_FILENAME] = '* * "%s" *\n' %
modem.py needs to be updated to setup idle timeout and auto reconnect. While pdp.py needs to be updated so ppp idle timeout resets /etc/resolv.conf to OpenDNS servers
Now, just fire up settings panel (need to be done once per boot) and in connectivity click connect for Gprs...for me it doesn't show connected anymore...but then I don't really care about that as long as the connection works :)
Note: We are updating the framework file which can be updated by any of the frameword update and one need to repeat the update (well..until a nifty setting comes into setting panel somewhere :)