Skip to content

DebuggingMobile

peter-sa edited this page Mar 30, 2019 · 29 revisions

Debugging mobile/cellular connectivity

This is still under development, though send/receive of SMS, Mobile Data and calls can now be tested.

Note

Recent testing indicates that ofono needs a kick each time the device is rebooted, a simple:

sudo systemctl restart ofono

Followed by waiting 20 seconds seems to do the trick. You only need to do this if cellular is missing from the list in Connman UI.

For the orientation detection to work you have to give it a kick after each device reboot. Kill the sensorservice - it'll auto restart, tell pulse audio to restart to so that it notices the sensor service:

sudo pkill -f sensorservice
pulseaudio -k

on Device

You can install the UI's which also pulls in the dependencies:

apt-get install dialer-app messaging-app

Add radio user & group:

sudo groupadd -g 1001 radio
sudo useradd -u 1001 -g 1001 -s /usr/sbin/nologin radio

If you needed to add the groups, then a system reboot may be needed, or at least restarting more than just ofono.

Update system.img (contains the android components that run in the lxc container)

sudo apt install gemian-system

You definitely need to restart if the system.img has been changed.

Then setup ofono (uncertain if this is needed):

ofono-setup

Now the updated cmst (Connman UI) has a 'Mobile' tab, after restarting ofono you can 'Power' the Cellular part.

This should then enable the dialer to get your local network. You have a reasonable chance of making use of dialer & messaging apps to the degree that they are working. We need to make some changes to make them more keyboard friendly.

Suggested cmst settings

Interface:

  • Use Start Options
  • Retain State

Program Control:

  • Enable Autostart

Start Options:

  • Start Minimized

Mobile-Data

After doing the above to get ofono active, you can then use cmst to view cellular status.

At least for SIM's on the UK giffgaff network you can stop here as ofono+connman+cmst auto configure and allow UI based connections. Please update with info on other networks.

If you find that things don't work by automatic, then you then need to install ofono-scripts and do some custom tweaks depending on how much auto-configured for your network:

cd /usr/share/ofono/scripts

# List current contexts and check for an internet one
./list-contexts
# Set up an internet APN if it is missing, with giffgaff (UK) the APN was automatically created
./create-internet-context APN username password

# Get the number for the new context
./list-contexts

# If your internet context was /ril_0/context2 
./activate-context 2

# setup networking
connmanctl services

# connect to cellular connection
connmanctl connect ...

Best of luck.

Network provisioning

Ofono supports automatically performing some provisioning tasks (configuring APNs, etc.) using an XML file that identifies network settings for different providers. To take advantage of this, save serviceproviders.xml to /usr/share/mobile-broadband-provider-info/serviceproviders.xml before trying to set up mobile data.

Calls

You can use 'dialer-app' to make calls, and incoming calls launch a lxqt message box. When logged into the device you need to tap the OK button to answer the call, the dropdown on the notification is known to be broken. When the device is closed/lock screen active you can answer calls with the silver button (and also hangup).

The call is configured to start on earpiece mode but if you close and reopen the device it will automatically go to speaker phone mode, and back to earpiece when you close it again. Plugging in a headset should also work as expected.

In earpiece mode the device orientation if detectable (requires updated system.img) will be used to set the microphone in use. The LEDs will indicate red for the microphone and green for the loudspeaker.

on Desktop

If you want to work on the UI's for these things it can help to install ofono-phonesim on the desktop.

Check that phonesim is configured in ofono: /etc/ofono/phonesim.conf

[phonesim]
Address=127.0.0.1
Port=12345

Check that you have telepathy configured: .local/share/telepathy/mission-control/accounts.cfg

# Telepathy accounts

[ofono/ofono/account0]
manager=ofono
protocol=ofono
DisplayName=SIM 1
AutomaticPresence=0;;;
param-modem-objpath=/phonesim
Enabled=true
ConnectAutomatically=true
HasBeenOnline=true
NormalizedName=

Run phonesim in one tab:

ofono-phonesim -p 12345 -gui /usr/share/phonesim/default.xml

Stop system ofono:

sudo systemctl stop ofono

Note: for desktop use this works with the upstream ofono not the gemian branch which is for hardware use.

Run ofono in debug mode:

sudo OFONO_AT_DEBUG=1 ofonod -n -d

Enable and online:

ofono/test/enable-modem
ofono/test/online-modem