Jump to content

Motorola Moto G4 Play (motorola-harpia)

From postmarketOS Wiki
Motorola Moto G4 Play
Moto G4 Play running Weston
Moto G4 Play running Weston
Manufacturer Motorola
Name Moto G4 Play
Codename harpia
Released 2016
Hardware
Chipset Qualcomm MSM8916 Snapdragon 410
CPU Quad-core 1.21GHz Cortex A53
GPU Adreno 306
Display HD (720x1280)
Storage 8GB or 16GB
Memory 1GB or 2GB
Software
Original software Android 6.0.1
postmarketOS
Category testing
Pre-built images no
Mainline no
Features
Flashing
No data
USB Networking
No data
Internal storage
No data
SD card
No data
Battery
No data
Screen
No data
Touchscreen
No data
Multimedia
3D Acceleration
No data
Audio
No data
Camera
No data
Camera Flash
No data
Connectivity
WiFi
No data
Bluetooth
No data
GPS
No data
NFC
No data
Modem
Calls
No data
SMS
No data
Mobile data
No data
Miscellaneous
FDE
No data
USB OTG
No data
HDMI/DP
No data
Sensors
Accelerometer
No data
Magnetometer
No data
Ambient Light
No data
Proximity
No data
Hall Effect
No data
Haptics
No data
Barometer
No data


Contributors

  • the-returning-void

Maintainer(s)

What works

  • USB Networking
  • Graphical display
  • Xorg
  • Modem (partially?)
  • SMS

What does not work

  • Wifi (wlan0 device comes up with firmware and custom kernel)


How to enter flash mode

Hold down POWER + Vol Down while booting to enter Flash Mode.

Installation

Wifi

Configure your kernel and enable the prima wifi staging driver

pmbootstrap menuconfig linux-motorola-harpia

pmbootstrap build linux-motorola-harpia

On the device

apk add wcnss-wlan

/etc/init.d/wcnss-wlan start

Firmware {Wifi/Modem} (TODO: package it)

On the device extract firmware cd /lib/firmware

mkdir postmarketos

cd postmarketos

mount /dev/disk/by-partlabel/system /mnt

cp -ap /mnt/etc/firmware/* /lib/firmware/postmarketos

umount /mnt

mount /dev/disk/by-partlabel/fsg /mnt

cp -ap /mnt/* /lib/firmware/postmarketos

umount /mnt

mount /dev/disk/by-partlabel/modem /mnt

cp -ap /mnt/image/* /lib/firmware/postmarketos

umount /mnt

mount /dev/disk/by-partlabel/persist /mnt

mkdir -p wlan/prima

cp -ap /mnt/WCNSS_wlan_dictionary.dat wlan/prima/

umount /mnt

Make a link in case the firmware path doesn't include /lib/firmware/postmarketos

cd /lib/firmware

ln -s /lib/firmware/postmarketos/* /lib/firmware/


Modem

Make the necesary links for qcom_rmtfs

cd /boot

ln -s /dev/disk/by-partlabel/modemst1 modem_fs1

ln -s /dev/disk/by-partlabel/modemst2 modem_fs2

ln -s /dev/disk/by-partlabel/fsg modem_fsg


Install necessary software

apk add modem-qcom-msm-downstream-common qcom_rmtfs libsmdpkt_wrapper libqipcrtr4msmipc ofono

Start the wcnss-wlan service to initialize the wifi card (helps the modem?) /etc/init.d/wcnss-wlan start

Start a tmux for multiple windows tmux

Start qcom_rmtfs on a terminal

export LD_PRELOAD=/usr/lib/preload/libqipcrtr4msmipc.so

qcom_rmtfs -v

Start ofonod on another terminal

export LD_PRELOAD=/usr/lib/preload/libsmdpkt_wrapper.so

ofonod -d -n

Send an SMS!

export PHONE_NUMBER="<number to send sms to ex: 1234567890>"

sudo dbus-send --print-reply --system --dest=org.ofono /gobi_0 org.ofono.Modem.SetProperty string:"Powered" variant:boolean:"true"

sudo dbus-send --print-reply --system --dest=org.ofono /gobi_0 org.ofono.Modem.GetProperties

sudo dbus-send --print-reply --system --dest=org.ofono /gobi_0 org.ofono.Modem.SetProperty string:"Online" variant:boolean:"true"

sudo dbus-send --system --print-reply --dest=org.ofono /gobi_0 org.ofono.MessageManager.SendMessage string:"$PHONE_NUMBER" string:"Hello world! -postmarketOS"

Receive SMS like this (might be spammy if you have other DBus apps): sudo dbus-monitor

See also

  • Device requires msm-refresher to get a display past the boot splash, even though cat /sys/class/graphics/fb0/modes > /sys/class/graphics/fb0/mode doesn't fix the display
  • Steps outlined for Screen is blank outside of Weston is still required to get a display after the boot splash
  • Xorg starts with a blank display, to make the screen show ssh into the device and run sudo osk-sdl -t to fix display