Archive for October, 2014 beta 1 testing release

Thursday, October 9th, 2014

After a lot of work on the 3G support in the Fonera firmware, it’s finally time to share some of this work with you in the form of this beta release. As the name suggests, this release should be considered a testing release – it’ll probably not eat your data, but don’t be surprised if your internet connection breaks at some point. Having said that, we welcome you to try this release and provide feedback about any issues you encounter. You can always downgrade back to the latest stable firmware if there is a problem that is a showstopper for you.

3G improvements
As mentioned, improved 3G support is the biggest change in this release. By itself, this release does not magically add support for more 3G devices (though it’s likely that some devices that didn’t work before now do due to usb-modeswitch updates and kernel fixes), but it mostly cleans up the 3G support and makes it easier to debug issues with 3G devices.

For some more details about how the new 3G interface works and how to go about getting your device working, a separate blogpost is available. Please carefully read that post if you run into 3G problems.

Note that 3G devices no longer automatically connect when plugged in. By default, you’ll have to connect by clicking a button in the webinterface, though you can still configure the old behaviour of automatically connecting on device insertion by going to 3G -> Configure and then select “On device insertion: connect automatically”.

3G dongles and hubs
One change to point out specifically is that 3G devices in combination with USB hubs should not cause any problems anymore. Previously, using an USB hub would break connectivity for some 3G dongles. It turned out there were two unrelated bugs in the kernel USB driver that both caused problems with hubs under different circumstances. After extensive debugging, these issues have been found and fixed.

If you still find an issue with a hub (i.e., your dongle works without a hub, but doesn’t when connected through a hub) please report it.

Debug application
Another new addition in this release is the debug application. It’s not very powerful yet, but allows collecting some debugging information through the webinterface, as well as increasing the log buffer size. This should help us to collect debug information from users that are not comfortable with using the SSH interface.

To install this application, just head over to the “Applications” page on your dashboard – it should be listed there.

So, how do I upgrade?

Download the web upgrade tarball below, navigate to your Fonera’s dashboard through “Settings” and then “System” and upload the tarball there (under “Firmware update”). Note that you should not unpack the file you download (and make sure your browser doesn’t automatically unzip the file either, it should remain a .tgz file).

Note: On 2.0g, the firmware update might fail due to insufficient memory. If you upload the firmware through the webinterface, but that page keeps loading indefinitely (and you do not get the updating countdown), you’re probably seeing this issue as well. As a workaround, you can disable windows file sharing (“Settings” -> “Fileserver” -> “Windows Network Shares”) and/or the public Fonspot (“Settings” -> “FONSpot”) to free up some memory. This should allow the 2.0g to successfully unpack the firmware and start flashing it.

This firmware is available for the following hardware. Be sure to pick the version for your hardware. If you pick the wrong one, the firmware update will silently bail out and no upgrade will happen (no error will appear either).

Since this is a beta release, only developer’s versions are available. For the .img version (which can be installed through SSH), you can look in the directory on the download server.

If the upgrade somehow fails and you need to recover, the FAQ section has recovery instructions.

Have fun!

Debugging 3G dongle support

Thursday, October 9th, 2014

In our latest firmware release for the 2.0n and 2.0g, beta1, we introduced completely rewritten support for 3G devices. This new code should work with more devices out of the box, but the main feature is improved debugging support. This means there are some knobs and switches that allow you to tweak how the Fonera talks to your 3G device.

If you want to make your 3G device work with the Fonera, be sure to read this post carefully. It contains a lot of info, so it’s easy to miss a detail or skip over some important instructions. Especially if you file a bug report, read carefully to prevent duplicate reports and a lot of extra work…

This post will detail these knobs and switches and documents when to use which. It’s not guaranteed that you can actually make any 3G device work using these instructions, but they should help you make it work if possible and if not, collect enough information for us to have a look at it. But first, I’ll provide a bit of background on how a 3G device typically works.

3G devices background
When you connect a 3G device, it will tell the Fonera what kind of device it is so the Fonera can load the appropriate drivers for it. However, most 3G devices will initially lie and say they are a a read-only storage device (like a USB cd-rom player). This storage devices then contains the Windows drivers for the 3G device, so Windows users can easily install those.

After installing the driver on Windows, it will send a special command to the 3G device, telling it to switch into modem mode. In response to this command, the modem will (virtually) disconnect and then represent itself to the Fonera as a brand new device that supports a number of modem ports. On Linux (and on the Fonera), this part is handled by the USB modeswitch software automatically.

Each of the modem ports exposed by the 3G device have some specific function. Commonly there is one control port, over which commands can be sent to set up the device and get status information and one data port, over which the actual data transfer happens. Sometimes there are additional ports, used for diagnostics or different modes of operation). Unfortunately, there is no universal automatic way to find out which port is which. Some manufacturers offer some way to detect this, but these ways usually don’t work with all devices.

Even though there some standards for (3G) modem devices, not all devices and manufacturers implement them in exactly the same way and some devices have specific quirks in the order they need to receive commands, etc. For doing the modeswitch, every device needs some magic command for which there are no standards at all. On Windows, these quirks are handled by giving each device its own driver (or some manufacturers uses a single driver that knows about all the quirks for its own devices). On the Linux desktop, there is software available (modem-manager) that knows about a lot of these quirks and can talk to most 3G devices. However, this software (and mostly its dependencies) is way too complex and big to run on the Fonera, it wasn’t written with embedded devices in mind. Instead, we’ve written a new piece of software, called udiald (and made the source available under the GPL license), which aims to support as much devices as possible using only a small bit of code.

Debug application
To assist in debugging (3G) issues, we’ve created a small debug application that makes it easier to collect debuging info through the webinterface (instead of having to run commands through SSH). Right now, it allows collecting log output and USB device info.

You can install this debug application through the “Applications” page on your dashboard. For now, it’s only available for this beta release. After a bit more testing, we will probably make it available for the 2.3.7.x stable release as well.

Configure provider info
Before you click the “connect” button for your device, you’ll have to tell the Fonera about your 3G provider. You can do this by clicking the “Configure” icon below the list of devices.

For the connection to be made, your device needs to know the “access point name” (apn) to connect to. Using the wrong or no apn usually breaks the connection, or can cause the wrong payment plan to be activated, so be sure not to skip this step. Additionally, some providers require login credentials for the connection, though these are often not a personal login, but some generic one.

The other options on this page can usually be left at the default values.

Attaching your device
When you attach a 3G device, the Fonera will autodetect it and it will be listed on the “3G/UMTS” page on your Fonera Dashboard. This page lists all devices that look like a 3G device (i.e. that have modem ports), not just those which the Fonera explicitely knows about.

However, it is still possible that your device is not listed on this page, most likely because the USB modeswitch software didn’t know about it or the mode switch failed for some reason. If this happens, please file a bug report so we can have a look at what is wrong.

If your device is shown in this list, the column “Device configuration” will show which configuration the Fonera has decided to use with your device (based on the USB identifiers of the device). Looking at this configuration profile, there a few cases:

  1. It shows the brand and model number of your 3G device. This means that someone has actually tested your device model before and the Fonera has a configuration profile specifically for your device. It’s highly likely that it will work right away, so best to just try it (but don’t forget to look at the “preparing to connect” section below). If it doesn’t work, skip to the next section.
  2. It shows the right brand, but the wrong model number. This means that the device’s manufacturer has used the same USB identification numbers for two different device models. This isn’t supposed to happen, but unfortunately it does. However, it’s likely that the same profile will actually work for both devices, so just try it. If it doesn’t work, skip to the next section.
  3. It shows “Huawei 12d1:1001″ or some other number. This is a special case that occurs only for Huawei devices. Your device has not actually been tested with the Fonera, but we managed to get at least some of the settings (control and data port) out of a Linux driver created by Huawei. In this case, it’s likely that your device will work right away, so just try it (but don’t forget to look at the “preparing to connect” section below). If it doesn’t work, skip to the next section. If it works, please file a bug report to let us know.
  4. It shows “Generic ZTE”, or something else starting with “Generic”. This means that the Fonera doesn’t really know anything about your device, except the manufacturer. It selected a profile that contains some generic settings, but it’s likely that those won’t work. You could try connecting, but you’re probably better of going to the next section to look for the right settings. Whatever the outcome be sure to file a bug report with your findings.

Finding out the modem port numbers
So, if your device doesn’t work yet, you’ll have to find the proper settings for the device. As mentioned above, each modem has a number of ports (numbered starting with 0), of which one is the “data” port and one is the “control” port. To find out which is which, we’ll have to do a bit of trial and error.

To make changes to the configuration profile for your modem, click the “Modify” link in the “Device configuration” column. The page shown will allow you to change various modem settings. The “Based on” dropdown allows you to copy settings from another profile (which could help if your unsupported device is similar to another device that is supported), but you can also just specify the settings manually.

To fnd out the correct port numbers:

  1. Find out what ports respond to AT commands. 3G modems use “AT commands” (like oldschool dialup modems) to communicate through the data and control port. Since the other ports don’t usually respond to AT commands, we can quickly rule them out as candidates for the data and control ports.

    To do this, set the control port to 0, click “Save” and then click the “Probe” button for your device. This will try to probe the device on its configured control port and show you the output. If you get a lot of output, including a “Identified as …” line near the top, this port is a candidate (even if the output also shows some errors further on, since not all devices respond to all probe commands). If it shows only a few lines like “Poll timed out” and “Unable to identify modem”, then it is not a candidate port.

    Repeat this process for every supported port (e.g., every port number in the dropdown). Don’t stop when you found two candidates, since sometimes there are more than two candidates (and the first two might not be the ones you need…).

  2. Now you know which ports are candidates, you need to figure out which is which. In general, any of the candidate ports will probably work as the control port, sometimes not all of them will work as the data port. You’ll have to just try different combinations to find out which one works. Often, the data port is the lowest numbered candidate, so you’ll likely want to start with that. Also, it does not make sense to use the same port as data and control port. The interface does not forbid it currently, but it will probably not work…

The dial command
When the modem is all set and ready to make a connection, the dial command is used. Unlike the old school modems, the 3G modem doesn’t actually dial a number (I think), but it’s more a magic command to let the modem know to set up a connection.

The default dialcommand should work for most modems (in fact, it worked for all the modems we tested with), but some modems (or providers?) might require different dialing commands. In particular, EVDO or LTE modems are rumoured to need one of the other commands in the dropdown, though we haven’t had any of these to test with.

The mode commands
The last five commands are used to set a preference or force the use of the UMTS or GPRS networks. The values you set here are the commands to use for this modem, to change the actual mode used, click the “Configure” icon below the list of 3G devices.

If you test other modes than “auto” and these commands don’t work, please file a bug report about this. There’s no ready-made instructions of other commands to try, but perhaps we can figure something out for your specific device.

Filing a bug report
If your 3G device doesn’t work out of the box or at all, or the instructions above tell you to file a bug report, you’ll need to take some steps to make a proper bug report on the Fonosfera trac. Here’s how this works:

  1. Do a search on the trac to see if someone else has already filed a report about your device. It’s best to search for the model number of your device (without the brand name) here.

    If you find a report about your device, you can leave a comment to let us know you also have this device. If you fill in your e-mail address, you’ll get notified of any followup comments on the bug report as well.

  2. Collect information for your bug report. We’ll need:
    • The make and model of your device
    • A description of what is working and what is not and what you have already done to debug
    • The log output shortly after plugging in the device and doing a connection attempt (can be retrieved using the debug application, see above).
    • The detailed list of USB devices (can be retrieved using the debug application, see above)
  3. File a new report. Be sure to include your e-mail address in the “reporter” field so you get notified about comments. To include the info collected above, use the {{{...}}}” trac syntax to keep the info readable (hint: Use the preview button to see if you got it right).

    Hotfix to make Flickr work again

    Wednesday, October 1st, 2014

    A while ago, Flickr changed their API to require HTTPS connections to be made. This causes the Flickr uploader in the Fonera firmware to break.

    As of today, there is a hotfix available for firmware that fixes this problem and makes the Flickr uploader work again. Installing it is simple: Just head over to the “Applications” page on the Fonera dashboard and install the hotfix that’s listed there. It should work right away.

    Note that this fix is only available for the latest released stable firmware version, If you’re running an older version, you’ll have to upgrade first. Furthermore, if you ever do a factory reset, you’ll have to reinstall the hotfix (which is also the only way to uninstall the hotfix).