Pro-testing Against Bad Software Quality

27Dec/130

A Little Help with Jolla

Table of Contents:

  1. Introduction
  2. Enable Developer Mode
  3. Extend battery life by disabling the buggy NFC detection
  4. Share your Jolla Internet connection
  5. Fix the broken "From:" field in outgoing emails
  6. Add your own shortcuts to FingerTerm
  7. Force FingerTerm to source .bashrc and .bash_profile when launched
  8. References

Introduction

Note: I will be updating this post whenever I come across new useful tips, so do check back from time to time.
Last updated: Feb 4th, 17:12 (updated the paragraph about NFC detection since the issue has now been fixed).

Unlike earlier posts, this post is not about testing - at least not directly. This post is about the new smartphone Jolla, made by a band of Finnish ex-Nokia employees who felt MeeGo, a mobile operating system dumped by Nokia, is worth saving.

Obviously, I can't help doing testing while using a new device and I've already discovered a bunch of issues with the device but I will not cover them in detail in this post. Instead, what I am going to concentrate on are the various tips and tricks that you can do to help improve your Jolla device (and, also, as reminders for myself should I ever need to perform all these tweaks and fixes again).

This post assumes a basic level of Linux expertise as all of these things will be done on command line, using the phone's terminal (or a remote SSH connection), after you enable Developer mode.


Enable Developer Mode

- Go to: Settings -> System Settings -> Developer mode (under "Security")
- Enable Developer mode and accept Developer Terms
- Enable Remote connection (only necessary if you plan to SSH into the phone which I, personally, find useful to do since it's much faster to type on a physical keyboard)
- Set a password (this will be your devel-su password later on)

After this step, when you browse the phone's applications, you will find a new app called "Terminal" on the list. You will need this to make the changes listed below - unless you decide to SSH into the phone through USB instead.

Extend battery life by disabling the buggy NFC detection

UPDATE Feb 4th: The 1.0.3.8 update "Naamankajärvi", released on Jan 31st, addresses this issue and it is no longer necessary to perform the steps listed below. I will leave the advice as it is, though, just in case it should become relevant again - for whatever reason.

There have been complaints about Jolla's poor battery life and the problem seems to boil down to a buggy piece of code that causes the device to "ping" the NFC chip on The Other Half (the back cover) non-stop[1]. While you could get rid of this issue by either removing the back cover entirely, removing the NFC chip from the inside of the back cover or, apparently, also by covering it with tin foil there is a better solution: disable the service responsible for the NFC detection. Here's how to do that:

Launch terminal (or SSH into your Jolla), "devel-su" to become root and type in the following:

systemctl mask tohd.service
systemctl stop tohd.service

This small tweak stops the buggy service and prevents it from restarting when you reboot your device. As a result, this should extend your Jolla's battery life (while idle) from less than 24 hours to several days.

Note: Doing this will also prevent your phone from switching to the ambiences etc. provided by The Other Half but the changes are easy to undo once the issue has been fixed (or you want the phone to react to The Other Half changes again): just replace "mask" with "unmask" and "stop" with "start".

Share your Jolla Internet connection

When Jolla was launched there was no application for tethering i.e. sharing the phone's Internet connection. At the time of writing a (WLAN/BT) tethering app is available through Jolla Store, and USB tethering support will be added in a future update[2].
Here's how you can share your Jolla's Internet connection through USB[3] while waiting for the system update that makes this a built-in feature of the device:

Launch terminal (or SSH into your Jolla), "devel-su" to become root and type in the following:

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o rmnet0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
iptables -A FORWARD -i rmnet0 -o rndis0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i rndis0 -o rmnet0 -j ACCEPT
iptables -A FORWARD -i wlan0 -o rndis0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i rndis0 -o wlan0 -j ACCEPT

Note: Whenever Jolla is rebooted, for whatever reason, these rules will be cleared so I would recommend storing all of the above in a shell script that you can execute (as root) whenever you want to re-add the rules. I'm sure this could be done automatically whenever the device starts up but I haven't done that yet (to be honest, I don't know where the script should be stored, exactly. Anyone?)

Note: rmnet0 is the GSM interface, wlan0 is the WLAN interface, and rndis0 is the USB interface. I added the WLAN part since it was not mentioned in the referenced post and I felt it would be stupid not to share both connections; especially since Jolla tends to hop between the WLAN and GSM connections quite a bit if both are available.

After that, when you want to connect to the Internet through Jolla, you will need to give the connecting device (laptop, desktop, whatever) a private IP in the 192.168.xxx.xxx range (I use 192.168.2.14), set 192.168.2.15 as the default gateway (that is the default IP of Jolla's USB interface) with netmask 255.255.255.0 and any DNS server you like (I use the Google DNS 8.8.8.8).

Fix the broken "From:" field in outgoing emails

There is an issue with outgoing emails in Jolla at the time of writing where, in some cases, the "From:" field appears only as an account name, without the domain part e.g. "From: typo" in my case. Apparently, the reason behind this is that Jolla takes the "From" field value from the login name used when you authenticate yourself to your mail server. In many cases e.g. Gmail this is not a problem since your login will be your Gmail address. However, if your login name is not a valid email address and, specifically, the one you want to be shown in your outgoing emails, you have a problem. Fortunately, there is a fix[4] for this issue:

Launch terminal (or SSH into your Jolla) and type in the following (do not "devel-su" in this case - you don't want to modify the root's account):

pkcon install libaccounts-glib-tools
ag-tool list-accounts
ag-tool update-service N email string:emailaddress=account@domain.tld
ag-tool update-service N email string:fullName='Firstname Lastname'

Where "N" is the ID number of the account you wish to modify i.e. "Email" in this case, "account@domain.tld" is the email address you wish to show in your outgoing emails and, "Firstname Lastname" is your name, obviously.

Add your own shortcuts to FingerTerm

Jolla uses FingerTerm as its terminal application and one of the nice things about it is that it allows you to create your own command shortcuts that you can then execute with just two taps (one to open up the menu and one to run the command). Personally, I added a shortcut to quickly SSH to a server I use for my IRC screen. Here's how to create your own shortcuts:

Launch terminal (or SSH into your Jolla) and type in the following (again, without doing "devel-su"):

cd .config/FingerTerm
vi menu.xml (or, if you prefer, you can use nano as the text editor by doing "pkcon install nano")

After this, you can run your shortcuts from the FingerTerm menu by tapping the three horizontal lines on the top-right corner of your screen.

Force FingerTerm to source .bashrc and .bash_profile when launched

By default, launching Terminal on the phone doesn't source the .bashrc and .bash_profile files which, among other things, causes your own aliases to not be loaded when the Terminal starts. While it may not be a very elegant solution and should probably be used as a temporary workaround only, there is a way to fix this, as explained in the related thread[5] on the excellent together.jolla.com site:

Launch terminal (or SSH into your Jolla), "devel-su" to become root and type in the following:

cd /usr/share/applications
vi fingerterm.desktop (or, if you prefer, you can use nano as the text editor by doing "pkcon install nano")

Then replace the line:

Exec=fingerterm

With:

Exec=sh -c "cd ~; unset POSIXLY_CORRECT; exec fingerterm"

And that's it; after this, your shell will always source the two files when the Terminal is launched.


References

1: http://reviewjolla.blogspot.fi/2013/12/jolla-battery-life-power-consumption.html
2: https://together.jolla.com/question/3798/usb-tethering/
3: http://talk.maemo.org/showpost.php?p=1391586&postcount=804
4: http://murobbs.plaza.fi/1712267254-post4.html (only in Finnish)
5: https://together.jolla.com/question/5561/make-fingertermbash-startup-execute-standard-profilebashrc-scripts/

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.