Documenting Problems That Were Difficult To Find The Answer To

Adding Huawei E160E To OpenWRT

I wanted to add a Huawei E160E USB 3G modem to OpenWRT but had some trouble getting it to work.

I used documentation from three places:

In this case I used a latest snapshot from the LEDE project. It turns out the router would simply lose networking, I’d be unable to SSH or access it via the web, after several minutes. Perhaps this was because I was forcing kmod’s with a slightly incompatible kernel. In the end I went back to Chaos Calmer 15.05.1 from OpenWRT which seemed to be more stable for me.

It turned out that I needed to add some more packages, specifically:

  • usbutils – to run “lsusb” to see when my USB devices had been detected
  • kmod-usb-uhci – ultimately I needed a kmod to see the USB controller in order to detect attached devices
  • kmod-usb2 – just in case the UHCI controller module above didn’t work

Note that when adding kmods then opkg might reject it with a LEDE build if package slightly out of sync with the kernel build, in which case use –force-depends (don’t do this, it might result in an unstable router):

opkg install --force-depends kmod-usb-uhci

Now, also ensure that the /etc/modules.d/usb-serial has the following line:

usbserial vendor=0x12d1 product=0x140c maxSize=4096

The vendor and product values are taken from the output of lsusb:

# lsusb
Bus 001 Device 002: ID 12d1:140c Huawei Technologies Co., Ltd. E180v

Once connected the signal strength can be obtained on the command line by running:

# comgt -d /dev/ttyUSB3
SIM ready
Waiting for Registration..(120 sec max)
Registered on Home network: "50502",2
Signal Quality: 13,99

The result can be looked up in the table at this link:

Value RSSI dBm Condition
2 -109 Marginal
3 -107 Marginal
4 -105 Marginal
5 -103 Marginal
6 -101 Marginal
7 -99 Marginal
8 -97 Marginal
9 -95 Marginal
15 -83 Good
16 -81 Good
17 -79 Good
18 -77 Good
19 -75 Good
20 -73 Excellent
21 -71 Excellent
22 -69 Excellent
23 -67 Excellent
24 -65 Excellent
25 -63 Excellent
26 -61 Excellent
27 -59 Excellent
28 -57 Excellent
29 -55 Excellent
30 -53 Excellent

How Do I Add A Medicare Service To MyGov With A Linking Code?

So you’ve logged into your MyGov website and you’re attempting to add a Medicare service using a linking code that Medicare has provided you.

You’re confronted with a webpage like this:

  Enter your linking code:

  Select one of the online services you want to link:

  Enter your agency reference number for this online service (no spaces):

Your linking code is straightforward. It is what you were provided with (e.g. G12345678).

The online service you want to link is “Medicare”.

The agency reference number, however, is tricky. It is your 10 digit Medicare card number and your individual reference number without a gap. But what does this mean?

Your Medicare card number is the 10 digits along the top of the card. The individual reference number is the single digit next to your name underneath.

Use the 10 digits from the top plus the single digit next to your name

Use the 10 digits from the top plus the single digit next to your name

So the filled out form will look something like (for this example card):

Entering linking information for MyGov and Medicare

Entering linking information for MyGov and Medicare

Good luck! And if you have a problem you’ll have to call Medicare (not MyGov) on 132011, it took my 19 minutes to get through to an operator.

Turning Off DHCP Server on Netgear Wireless Cable Gateway CGD24N

The Netgear Wireless Cable Gateway model CGD24N supplied by Bigpond in Australia can spend a second life as a simple Ethernet switch. However it assigns DHCP addresses out of the box which can really upset a home network if you’re not expecting it.

Your wireless router might be assigning addresses from one range but you keep finding guest devices assigned something from the range.

It’s not that straightforward to find the DHCP on/off switch. The steps to find it are thus:

1. Log in to gateway admin interface, select NAT from menu

Select NAT from menu on left-hand side

Select NAT from menu on left-hand side

2. Turn NAT on, click apply

Select NAT on checkbox, click apply

Select NAT on checkbox, click apply

3. Select LAN IP from left hand menu

Select LAN IP from left hand menu

Select LAN IP from left hand menu

4. Select DHCP no radio button, click apply

Select DHCP no radio button, click apply

Select DHCP no radio button, click apply

How To Change TLS Bind Port In Asterisk

Asterisk doesn’t make it necessarily easy to change the port that TLS is bound to.

In sip.conf I’d set a different port (6000):


But when I set sip set debug on I would see a message like the following on answer:

<--- Reliably Transmitting (no NAT) to --->
  P/2.0 200 OK
Via: SIP/2.0/TLS;branch=z9hG4bKPjBFu7pgHTfOHCaNamaqTKTq3wenp-G.oY;alias;received=;rport=42849
From: "myext" ;tag=mQqEvydONdU7yOGgCi2.OiDu8lSfXZuK
To: <>;tag=as378489ee
Call-ID: tAYfXG5BEF9w8lY.ghupqOtwNyV3J18G
CSeq: 12562 INVITE
Server: Asterisk PBX 13.1.0~dfsg-1.1ubuntu4
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:test@;transport=TLS>
Content-Type: application/sdp
Require: timer
Content-Length: 387

The problem was that the Contact: header was advertising the wrong TLS port to the extension which would then attempt to contact the wrong port in response to the answered call (so no audio would start getting received by the extension).

The solution was to add to sip.conf:


As mentioned in another article if the advertised IP address is wrong in this Contact: header then you may also want to specify:


Converting XPS to PDF using MuPDF on Ubuntu Linux

I had a recently generated “.xps” file sent to me and needed it in PDF form for convenient viewing. The following took place on Xubuntu Trusty Tahr 14.04 LTS.

The “xpstopdf” tool failed me with a poorly converted document (just a single rectangle, no text).

Then I installed “mupdf”:

~$ sudo apt-get install mupdf
~$ mupdf mydocument.xps

This it rendered to my satisfaction to the screen. Next I wanted a PDF file!

But when I tried using “mudraw“, the associated tool installed with the “mupdf-tools” Ubuntu package, I got the following error:

~$ sudo apt-get install mupdf-tools
~$ mudraw -o /tmp/mydocument.pdf /tmp/mydocument.xps
error: empty page tree, cannot insert page
error: cannot draw '/tmp/mydocument.xps'

In the end I decided to try compiling the latest version available from MuPDF‘s download page (I downloaded “mupdf-1.9a-source.tar.gz” published 2016-04-21).

~$ wget ''
~$ tar -xvzf mupdf-1.9a-source.tar.gz
~$ cd mupdf-1.9a-source
~$ sudo apt-get install mesa-common-dev libxcursor-dev libxshmfence-dev libxext-dev libxrandr-dev libxinerama-dev
~$ nice make -j 3
~$ ./build/release/mutool draw -o /tmp/mydocument.pdf /tmp/mydocument.xps

This time my PDF was rendered without any errors!

Adjusting a Sliding Door’s Wheels

So you have a mirrored sliding door and you want to put it on the tracks for the first time; but it doesn’t seem to quite fit. Ideally the wheels should go down and something needs to secure the door to the track above.

First step is to identify the top and bottom of the sliding door. The wheels are at the bottom. We’ll come to the top later.

The wheel looks like the following picture:

Sliding door wheel

Sliding door wheel

What we want to do is twist the screw (left or anti-clockwise to raise, right or clockwise to lower) until the wheel is at the height we want it.

The screw head pushes against the plate to give the wheel height

The screw head pushes against the plate to give the wheel height

So get a plus screwdriver, if that is the kind of screw fitted to your door wheel mechanism, and give it a twist until you get the height you want.

Twist the screwdriver anti-clockwise or left to raise the wheel, clockwise to lower

Twist the screwdriver anti-clockwise or left to raise the wheel, clockwise to lower

Note that if you want to make your door lean you can raise or lower just the one side of the door. The following diagram should make this clearer:

Raising the right wheel makes the door lean left

Raising the right wheel makes the door lean left

Now for the top of the door. You can identify the top of the door by a sliding mechanism designed to push up and fit into the track above the door.

Sliding mechanism at the top to fit into the track above

Sliding mechanism at the top to fit into the track above

Quite simply push this up until you hear a click and the mechanism has settled into place in the elevated position.

Push up the sliding mechanism until you hear it click

Push up the sliding mechanism until you hear it click

It should stick in the elevated position. You can lower it when it comes time to take the door out (for cleaning or replacement).

Sliding mechanism on top of door should stay in place in elevated position

Sliding mechanism on top of door should stay in place in elevated position

Installing OpenRA on Xubuntu 14.04

I had to run the following command after downloading the OpenRA deb file:

sudo apt-get install libsdl2-2.0-0 mono-runtime mono-runtime-sgen liblua5.1-0 mono-runtime-common mono-gac mono-4.0-gac libmono-corlib4.5-cil libmono-security4.0-cil cli-common libmono-system4.0-cil libmono-system-core4.0-cil libmono-system-drawing4.0-cil libmono-system-data4.0-cil libmono-system-numerics4.0-cil libmono-system-runtime-serialization4.0-cil libmono-system-xml-linq4.0-cil libmono-posix4.0-cil libmono-data-tds4.0-cil libmono-system-configuration4.0-cil libmono-system-enterpriseservices4.0-cil libmono-system-transactions4.0-cil libmono-system-xml4.0-cil libgdiplus libmono-system-security4.0-cil libmono-i18n4.0-all

Want to Slow Linux ZFS Flushing/Syncing to Disk Every 5 Seconds?

So you’ve got ZFS on Linux and you notice your hard drive LED light up every 5 seconds. How can you slow that down?

The zfs_txg_timeout parameter is described as:

~# modinfo zfs |grep zfs_txg_timeout
parm:           zfs_txg_timeout:Max seconds worth of delta per txg (int)

You can check the current value of this parameter:

~# cat /sys/module/zfs/parameters/zfs_txg_timeout

To verify this is the parameter you want to change, set this to 10 and count the number of seconds between the hard drive light coming on:

~# echo 10 >/sys/module/zfs/parameters/zfs_txg_timeout

Once you know this is the parameter causing the hard drive activity you can tell the ZFS module the default you want it to start with on next boot by editing /etc/modprobe.d/zfs.conf and adding a line similar to the following:

options zfs zfs_txg_timeout=30

Take care when changing this number as it may result in a higher probability of lost data in the event of a power outage.

Thunar and Ristretto on Xubuntu 14.04 Do Not Render Thumbnails

I was puzzled and searching all over the Internet for an explanation why the file explorer (Thunar) and the image viewer (Ristretto) were not displaying thumbnails for JPEG files. I know they had rendered them before. I tried all sorts of things, deleting local cache (~/.thumbnails/* and ~/.cache/thumbnails/*), ensuring various packages had been installed.

Finally I stumbled across this forum post which gave the necessary clue:

A package called tumbler is needed for thunar to automatically generate thumbnails.

I checked to see that I had tumbler:

~$ dpkg -l |grep tumbler
ii  libtumbler-1-0  0.1.30-1ubuntu1  amd64  library for tumbler, a D-Bus thumbnailing service
ii  tumbler         0.1.30-1ubuntu1  amd64  D-Bus thumbnailing service
ii  tumbler-common  0.1.30-1ubuntu1  all    D-Bus thumbnailing service (common files)

Then I checked to see if a tumbler process was running, and proceeded to kill it:

~$ ps fax |grep tumbler
21322 ?        SNl    0:01          \_ /usr/lib/x86_64-linux-gnu/tumbler-1/tumblerd
~$ kill 21322
~$ ps fax |grep tumbler


~$ killall tumblerd

Now when I opened a thunar file explorer the thumbnails were being rendered, and also rendered in ristretto, too.

Past Duration 0.999992 Too Large

While encoding a video in ffmpeg I encountered the message:

Past duration 0.999992 too large
Last message repeated 11 times

The problem magically disappeared when I changed audio codec and bitrate for the output stream.

My input stream reported itself as:

Stream #0:2: Audio: ac3, 48000 Hz, 5.1(side), 448 kb/s

But the settings I used to encode the stream to give me the error were:

-c:a:1 aac -b:a:1 160k -metadata:s:a:1 title="5.1 channel"

Note that the input stream was ac3 but I was converting it to aac on the output. Not necessarily a bad thing for stereo output, but for 5.1 maybe not the best target codec. The ffmpeg wiki high quality audio guide states the ac3 codec is for Dolby Digital.

When I changed to the following settings the error message disappeared:

-c:a:1 ac3 -b:a:1 320k -metadata:s:a:1 title="5.1 channel"