PPP Widget 2

 

Screenshot
 

This is a fundamental rewrite of PPP Widget. Just like the original version it allows the use of 3G modems and phones attached to a tablet's USB port (with OTG adapter) - if they support the plain serial PPP protocol.
The disclaimer from V.1 still applies though: many device/tablet combinations are working fine, but there is no guarantee that your's will. Don't blame me - after all, you did not spend any money ...

Features: For a list of version changes, see the announcement topic in the forum.

 

Requirements and limitations:


Since driver modules are no longer needed, there is no fundamental problem with more recent devices anymore. However, some manufacturers have added "blacklists" for USB accessory devices that will not be accessible via the Android USB layer.
Baaad example: Sony Xperia Tablet Z - which has almost all 3G modems locked out !!


If you have such a device, you can still use "PPP Widget" as long as the serial USB drivers are available.

 

Frequently Asked Questions

Usage:

Q: I have installed PPP Widget, but I don't know how to start it. There is no icon on the workspace and I can't find it in the app list.
A:
To use a widget, you have to place it on the workspace.
The way to access widgets may differ from one manufacturer to the other. On Google devices, there is usually a second tab in the app list screen which is named "Widgets".

Q: I would like to see PPP Widget on all my workspaces.
A:
No problem - as with every widget, you can place as many as you want. They will all act the same, no matter which one you use to setup and start your connection.

Q: How do I edit the connection configuration? Can I handle more than one SIM/provider?
A:
The first step is to connect your modem or modem-enabled phone. The unique SIM ID will be determined and you will be instructed to complete the profile associated with the active SIM card.
You can use as many different SIMs as you like, in different modems or in the same one; if you insert the respective device, the SIM card is recognized and the stored configuration is used.

Q: I am not sure what to enter as username and password for my connection.
A:
In most cases, there is no actual authorization done because the PPP connection is really set up with the modem itself, which then 'translates' the data stream to and from the cell phone connection; generally, the SIM card is used for actual identification
It is usually safe to enter a random user and password; this is better than leaving these fields blank which may cause problems with certain modems.
There are few exceptions to that rule where username and password are relevant and should be entered correctly, particularly with some CDMA providers.

Q: What should I enter as 'dial string'?
A:
Basically, there are only two different possibilities:
If you are using a GSM/UMTS/HSDPA cell phone system, just leave the default alone.
If you are using a CDMA/WCDMA-based cell phone system, change the dial string to '#777'.

Q: If I plug my modem in, there is a pop-up window asking me if I want PPP Widget to handle this device.
A:
Android includes a USB device management. Every new device is checked if an application offers to handle it. The management can remember the decision at your choice if you check the box in the dialog, so you won't be asked again for that device.
If your modem needs to be switched to a different device mode (most modems do), you will see the pop-up a second time - the new device mode appears to Android just like a different device.
Check the box there as well and you will not be bothered again.

Q: If the connection is made, there is a pop-up window asking me if I want to accept a VPN connection created by PPP Widget 2.
A:
This is intended and you will have to confirm the request; it's the new method to create the network interface for the mobile data connection.
The only way to add a custom network interface 'legally' to the Android system is to provide a pseudo tunnel interface. PPP Widget 2 does not really do VPN.

Q: On what versions of Android will it work?
A:
The minimum version is Android 4.0. Extensive testing was done up to 4.4.4.
Since version 1.2.0 it works on Android 5.0 as well. It's untested on version 5.1 and probably not fully operational there. Beware if you intend upgrade the official firmware !! See the troubleshooting questions about upgrading below.

Q: Why is custom ROM XYZ not supported?
A:
The target systems of both PPP Widgets are unaltered tablets with stock ROM - just the root access is required.
Custom ROMs have no restrictions with regard to enabling 3G modem support, so PPP Widget's tricks are not needed there. Ask the creators of the ROMs to include serial drivers and 'official' PPP access.
I do not test on custom ROMS! Stock ROMs provide enough problems as it is ...

Special Features:

Q: I'm a developer and would like to control PPP Widget 2 from annother app or script.
A:
From version 1.0.12, there is a simple remote control feature added that works by sending a broadcast intent with one of the actions "de.draisberghof.pppwidget2.ACTION_CONNECT" and "de.draisberghof.pppwidget2.ACTION_DISCONNECT". This obviously only works if a modem is connected and ready to use.
To use that feature from the command line or from a script, you can run the "am" utility:
$ am broadcast -a "de.draisberghof.pppwidget2.ACTION_CONNECT"

Q: I would like to use advanced features, like selecting a fixed band or limiting the provider selection (roaming).
A:
Unfortunately, I am not able to include these advanced features myself. Some modems are using vendor-specific commands for these settings and there is no way I can cater to every device. PPP Widget 2 will stay as generic as possible to support the widest possible range of devices.
However, you can add custom AT commands to the dialling process to tweak the effective settings:
Go to the "lib" directory in the folder "data/de.draisberghof.pppwidget2/files" on the SD card. Add a file named "modem_init.txt" and insert your special AT commands, each on one line.
See the ETSI standard for GSM AT commands for possible tweaks, including provider and band limitations. Again, your device may not provide the full set of commands, or it may include additional ones.

Troubleshooting:

Q: PPP Widget 2 gives me this message when I place it on the workspace: "No root access"
A:
The widget checks if it can start commands with root rights upon start-up. Either your device is not properly rooted or the app that manages the access per application - like 'Superuser' or 'SuperSU' - did not grant the widget the necessary access right. In the latter case, review the settings in the respective application.

Q: My modem is not found at all, despite having root access and using a powered USB hub.
A:
There are several possible causes:

Q: After plugging my modem, PPP Widget goes to "Prepare device", then hangs or goes into some sort of a cycle.
A:
It's very likely that your USB host port is not able to provide sufficient power or that aggressive power saving kicked in. Please see 'Power Problems' below.

Q: After plugging my modem, PPP Widget goes to "Prepare device", then says "No driver found"
A:
On "PPP Widget 2", it is likely that this means your modem does not provide serial ports (like some newer 4g/LTE devices). In that case, it will regrettably not work with PPP Widget.
There is a small chance that your serial USB port is just configured in a strange way which is not recognized by "PPP Widget 2". Post your USB log in the support forum.
Huawei modems (even the recent ones) are generally working well because they provide a fallback mode with standard PPP ports which is used in PPP Widget 1/2.

Q: I have a Samsung Galaxy S3, and when successfully connecting my phone reboots!
A:
Samsung has changed something in the Android system code for this device. This results in a crash when PPP Widget notifies the system about the network connection.
The only solution for this is to disable the system notification in the configuration. This will result in limitations for several applications, mostly the ones by Google which are relying on a network notification instead of just going ahead and using the network.
Unless Samsung publishes the changes in the source code (they are not required to), there is no other solution possible.

Q: I updated my Android firmware, and PPP Widget 2 stopped working!
A:
You may have forgotten to get root access again; this must be done once for every new firmware.
Also be aware that PPP Widget 2 is using one or two undocumented API functions which can change with each version release. To be on the safe side, postpone the upgrade until PPP Widget 2 is keeping up again.

Q: The widget says "Connected" but I have no network access at all!
A:
It's very likely that the route and nameserver parameters could not be set correctly after connecting.
This may be a problem of the installed superuser app that is responsible for executing the respective commands with root rights. There is reason to suspect that superuser apps other than "SuperSU" are not working properly. PPP Widget 2 is only tested with "SuperSU".

Q: I can connect but some apps keep telling me that there is no network connection!
A:
New Android versions or changes by individual manufacturers may break PPP Widget's special way of making the network connection 'officially' known to the whole system. It relies on features that are not documented and can easily be changed or even removed by the Android maintainers.
You can only work around that by using alternative apps that don't rely on the 'official' network status and instead just go ahead and use any available kernel-level network route. Examples are "K9" for mail and alternative browsers like "Opera" or "Dolphin" if you want to start downloads from the web.

Q: I can't get PPP Widget to work, but my problem is not listed here
A:
There is no guarantee, but try reporting your problem at the support forum.
In most cases it will be useful to post a log that may show the problem. Enable the "Logging" feature in the "PPP Widget 2" configuration; you will get an USB log which shows how the device preparation was handled, and a PPP log which contains all commands going to the modem and the actual network negotiation.

Power Problems:

Q: After plugging my modem, PPP Widget 2 still shows "No modem found" or gets stuck at "Prepare device"
Q: PPP Widget 2 and my modem seem to behave erratically
Q: I get a message dialogue from PPP Widget 2 saying that my modem is gone again
A:
This demands an extended explanation.

On smaller tablets (typically up to 7" devices) there is often not enough power available for attached USB devices.

Wireless modems are among the devices with the highest power demand (500 mA straight, the USB 2.0 standard's maximum). Usually, only some larger tablets can provide that much power on their host ports. With Samsung, even the 10" devices are reportedly power-limited; this goes for Nexus 10 also.
Smaller ones often have their limit at 100 mA which rules out using a large array of USB devices. On some tablets or phones you may be successful if the power level is close to 100% - but not for the rest of the time.
My Nexus 7 works fine with many 3G sticks attached directly - but even with this tablet I had at least one of my test modems go into a reset cycle once it started the actual transmission.
The problem went away when I used a powered hub.

In short: if your modem works when connected directly, you are just lucky!

A powered hub is usually the solution for power problems. There are also those sleek OTG adapters with power "injection", however they may not work with each and every tablet as they do not comply with USB specifications. They are mostly O.K. though and quite inexpensive, besides being very compact - plus you can attach your tablet's power adapter if they expect the power supply on a micro USB socket.

Acknowledgements:

A great help for accessing USB modems without using kernel driver modules was the fine project "USB Serial for Android", written and maintained by Mike Wakerly and copyrighted 2011-2012 by Google Inc. (presumably because M.W. was previously employed by Google). Thank you!

The library is licensed under LGPL Version 2.1, so I provide my heavily modified version of the code here as a ready-made Eclipse project.
I have removed the device prober and several of the specific drivers; PPP Widget 2 provides the device object according to its own device filter and uses just the CDC-ACM driver and a generic serial one which caters to the common vendor-specific modem ports found on many USB modems.

UsbSerialLibrary.tar.bz2