EM7305 + Android 7.1 x86 = Unable to get online - please can someone help?

Hi folks,

I recently bought a Getac V110 laptop and this came pre-installed with a Sierra Wireless EM7305 4G modem. I am currently dual-booting this between Windows 10 and Android 7.1 (due to needing applications in both OS).

In Windows 10 the EM7305 works perfectly (and provides stable connectivity and fast throughput, 100 mbit download speed, 25 mbit upload speed) with a Virgin Mobile SIM card here in the UK.

In Android however I am struggling to get it to work. Through lots of trial and error I have managed to get the modem at least visible to the Android 7.1 OS using the source code and instructions within Android 7.1 RIL Software Version 7.1.6.0. I tried the 10.x release however this was even worse.

I’m building Android 7.1 OS (I am forced to use this version) with a custom-made device.mk file that enables dhcpcd-6.8.2 and installs Sierra’s pre-built files into /system/{bin,etc,lib,lib64}. I have also installed the relevant Kernel modules. These all build fine with no errors after all the relevant SWISTART → SWISTOP were merged in place. I have /dev/ttyUSB0 and /dev/ttyUSB1 present in the OS after correctly merging these in.

I am also hard-coding the following prop values:

persist.sys.ril.type=QMI
rild.libpath=/system/lib64/libsierra-ril.so
persist.sierra.sim_ready_delay=15

The first major problem I had that isn’t documented anywhere is the modem does NOT respond (there is an IO error from the OS) to AT commands sent to /dev/ttyUSB1 and /dev/qcqmi0 is missing until this command is run in the boot phase of the OS (where “${USBID}” is automatically determined by a shell script I wrote):

echo 1 > /sys/bus/usb/devices/"${USBID}"/bConfigurationValue

This also results in /dev/qcqmi0 also appearing (it did not before). I then added the following to happen after a 1000 ms delay:

echo -ne 'at!entercnd="A710"\r\n' > /dev/ttyUSB1

This then opens the modem up to other AT commands. I hope the above information helps someone.

My problems are now that the Android 7.1 RIL is silently crashing with exit code 1, even though it is being launched in the init phase with the following command:

/system/bin/rild -l /system/lib64/libsierra-ril.so -- -a -i wwan0

I can see that wwan0 does not exist and dhcpcd is not running either. I’m unsure of the ordering here (whether dhcpcd creates wwan0 etc). Suffice to say, the Android OS does not detect the modem properly (insisting I insert a SIM card, even though one is present and everything works in Windows).

After poking in some AT commands I can see the modem is up / online, connected to my cellular provider and with the correct APN set. Grabbing logs from this system is difficult but I have uploaded some photos below to show certain progress…

It’s worth noting that selinux is set to permissive and not enforcing. I don’t believe the selinux errors are causing rild to bomb out because if I call it directly I get the same problem.

Hi @bagjason,
Can you share the below responses?
ls -l /dev/ttyUSB*
ls -l /dev/qcqmi*
dmesg
Thanks

Hi Vianney, thank you for responding.

Here is the information you requested;

x86_64:/ # ls -l /dev/ttyUSB*
crw-rw---- 1 radio radio 188,   0 2021-03-08 08:46 /dev/ttyUSB0
crw-rw---- 1 radio radio 188,   1 2021-03-08 08:46 /dev/ttyUSB1

x86_64:/ # ls -l /dev/qcqmi0
crw-rw---- 1 radio radio 243,   0 2021-03-08 08:46 /dev/qcqmi0

Oddly, the forums now won’t permit to attach files saying “New users cannot attach files”, yet it let me attach photos yesterday…

I have put the dmesg output here; getac.dmesg.txt - Pastebin.com

Please note SELinux is set to be permissive.

Hi @bagjason ,
From the log

[ 17.859078] init: Service ril-daemon-qmi does not have a SELinux domain defined.
[ 17.859086] init: Starting service ‘ril-daemon-qmi’…
[ 17.874299] init: Service ‘ril-daemon-qmi’ (pid 1630) exited with status 1
[ 17.874304] init: Service ‘ril-daemon-qmi’ (pid 1630) killing any children in process group
[ 18.774439] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 18.948793] audit: audit_lost=30 audit_rate_limit=20 audit_backlog_limit=64

It looks like the the ril-daemon-qmi is stuck at SElinux. Have you tried on disabled SElinux or enforce mode? What is the result?

Thanks

Hi @Vianney

SELinux is currently set to Permissive mode, it’s not set to enforcing. The SELinux warnings are only warnings.

If I try and call this directly…

/system/bin/rild -l /system/lib64/libsierra-ril.so -- -a -i wwan0

It just exits silently with exit code 1, there’s no error message nor Kernel messages relating to it.

(I am currently setting up a UART link to this box so I can debug faster, I will be monitoring this forum all day though)

Hi @bagjason ,
I found the information in Android RIL Integration Guide for Sierra Wireless

By default, Security Enhanced Linux (SELinux) is enforced in Android 5.0. Make sure that this feature
is disabled in the kernel .config file. Otherwise, settings to the Android operation system have to be
customized.
The path of the following files are taken from the reference platform build.
 device/linaro/hikey/sepolicy/device.te
 device/linaro/hikey/sepolicy/file.te
 device/linaro/hikey/sepolicy/file_contexts
 device/linaro/hikey/sepolicy/gpsd.te
 device/linaro/hikey/sepolicy/netd.te
 device/linaro/hikey/sepolicy/property_contexts
 device/linaro/hikey/sepolicy/radio.te
 device/linaro/hikey/sepolicy/rild.te
 device/linaro/hikey/sepolicy/dhcp.te
 device/linaro/hikey/sepolicy/sierra_dhcpcd.te
Let refer to the document if it can help

https://source.sierrawireless.com/resources/airprime/software/android-ril-integration-guide/

Hi @Vianney ,

I don’t disagree with you however this system is running in permissive mode…

x86_64:/ # getenforce
Permissive

Android’s own documentation here says that to disable SELinux you have to set androidboot.selinux=permissive on the Kernel boot flags (which I can confirm is present on my system)…

Setting this to disabled does nothing extra. I am about 99% sure that these are warnings and not enforcement.

I can try merging in those SELinux configs if you feel this is the best course of action, however each build of Android takes a few hours.

Just adding a note here, I tried completely disabling SELinux and this still doesn’t work.

Additionally when trying to call any of the Sierra supplied binaries they refuse to execute as they’re built for ARM not x86.

Is it possible that rild is refusing to work because libsierra-ril.so and the other Sierra supplied binary files are compiled for ARM (and not x86) and aren’t compatible with the native bridge?

AndroidRIL7.1.6/AndroidFS/system/lib64/libsierra-ril.so:  ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[md5/uuid]=319626e749041c7e3f460157404d060e, stripped

That might cause your problem without error message on the log. It is mentioned on Android Nougat 7.1.6.0 RIL release note. Please refer it for more detail

image

https://source.sierrawireless.com/resources/airprime/software/release_notes/android-7,-d-,1-ril-release-note-7,-d-,1,-d-,6,-d-,0/#sthash.g4SaZbDK.dpbs
Please share any concerns you have. Help us tick “Solution” if it is useful. It is beneficial to someone having same problem
Thanks

Thanks @Vianney

So there is a problem with the documentation. It is misleading:

The Android RIL integration guides (for Android 7.1 that I use and the latest version which supports up to Android 10.x) both have this…

https://source.sierrawireless.com/resources/airprime/software/android-7,-d-,1-ril-integration-guide/

image

https://source.sierrawireless.com/resources/airprime/software/android-ril-integration-guide/

image

However when you download the release notes for any version, all mention of x86 is missing. This is especially the case for this file…

https://source.sierrawireless.com/resources/airprime/software/release_notes/android-6,-d-,0-ril-release-note-6,-d-,0,-d-,17,-d-,0/

The title of the page specifically names x86, but when the actual file is downloaded, there is no mention of x86 and it’s purely ARM.

I downloaded all 3 versions above and compared all the shipped libsierra-ril.so versions…

AndroidRIL10.0.7/AndroidFS/vendor/lib64/libsierra-ril.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[md5/uuid]=0efec5f90aaf0dcd843278bd0d34a0dd, stripped
AndroidRIL7.1.6/AndroidFS/system/lib64/libsierra-ril.so:  ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[md5/uuid]=319626e749041c7e3f460157404d060e, stripped
AndroidRIL6.0.17/AndroidFS/system/lib/libsierra-ril.so:   ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, BuildID[md5/uuid]=1185c447551f01e8512a43e8c02aa1f3, stripped

So where do we find the x86 RILs? :slight_smile:

Bump! Anyone able to help please?

Hi @bagjason ,
Sorry for the late response
On Sierra side, EM/MC73xx has been End of Life for many years so it is not supported anymore. Android 7 is also no longer supported by Google. We would recommend using a recent module being compatible with the latest Android versions. We noticed that AirPrime - Android RIL Integration Guide - Rev2.0 is being used for whole EM/MC series,… It might make some confusions to customers. So, we are considering removing Android x86 obsolete versions and keep relevant configurations in the document

Thanks

Hi @Vianney , sorry for the delay, only just spotted this. Thank you for getting back to me.

I respect both the fact that the modem is EoL and so is Android 7, however I am stuck with these versions due to an application requiring Android 7.

What confuses me is the fact there’s no RIL for x86 anywhere, in any version, despite the instructions saying x86 was supported. I checked all of them, even your downloads up to Android 10, the RIL is only compiled for ARM64.

Please can you either provide a RIL for x86 or at least provide the source code for the RIL so that we can build it ourselves instead of relying on pre-compiled binaries?