Dobrica Pavlinušić's random unstructured stuff
PinePhone: Revision 6


https://www.pine64.org/pinephone/

https://wiki.pine64.org/index.php/PinePhone

https://wiki.pine64.org/wiki/PinePhone_v1.1_-_Braveheart

Full specifications

  • 4 x ARM Cortex A53 cores @ 1.152 GHz
  • ARM Mali 400 MP2 GPU
  • 2GB / 3GB LPDDR3 RAM
  • 5.95″ LCD 1440×720, 18:9 aspect ratio (hardened glass)
  • Bootable Micro SD
  • 16GB / 32GB eMMC
  • HD digital video out
  • USB Type C (Power, Data and Video Out)
  • Quectel EG25-G with worldwide bands
  • Built-in 802.11 b/g/n WiFi with Bluetooth: 4.0
  • GNSS: GPS, GPS-A, GLONASS
  • Vibration motor
  • RGB status LED
  • Selfie and Main camera (2/5Mpx respectively)
  • Main Camera: Single OV5640, 5MP, 1/4″, LED Flash
  • Selfie Camera: Single GC2035, 2MP, f/2.8, 1/5″
  • Sensors: accelerator, gyro, proximity, compass, ambient light
  • 3 External Switches: volume up, volume down, and power
  • Hardware switches: LTE/GNSS, WiFi, Microphone, Speaker, Cameras
  • Six pogo pins allowing for custom hardware extensions such as a thermal camera, wireless charging, NFC, a extended battery case, or keyboard case
  • Samsung J7 form-factor 3000mAh battery
  • Case is matte black finished plastic
  • Headphone jack

postmarketos

https://wiki.postmarketos.org/wiki/PINE64_PinePhone_(pine64-pinephone)#Installation

wget https://images.postmarketos.org/bpo/v21.12/pine64-pinephone/sxmo-de-sway/20220202-0445/20220202-0445-postmarketOS-v21.12-sxmo-de-sway-1.7.0-pine64-pinephone.img.xz

dpavlin@nuc:/tmp$ xz --decompress --stdout 20220202-0445-postmarketOS-v21.12-sxmo-de-sway-1.7.0-pine64-pinephone.img.xz | \
 sudo dd of=/dev/sdc bs=4M status=progress iflag=fullblock oflag=direct conv=fsync

modem upgrade

https://github.com/the-modem-distro/pinephone_modem_sdk/

https://github.com/the-modem-distro/pinephone_modem_sdk/blob/kirkstone/docs/AT_INTERFACE.md

pine64-pinephone:~$ sh -x ./modem-serial.sh
+ sudo picocom --echo --omap ignlf /dev/ttyUSB2

ati

Quectel
EG25
Revision: EG25GGBR07A07M2G

OK

# battery
AT+CBC

+CBC: 0,93,4114

# versions
AT+CGMI

Quectel

AT+CGMM

EG25

AT+CGMR

EG25GGBR07A07M2G

# Get ADSP firmware version
AT+QGMR

EG25GGBR07A07M2G_01.002.01.002

https://github.com/the-modem-distro/pinephone_modem_sdk/blob/kirkstone/docs/FLASHING.md#adsp-versions

upgrade modem firmware

pine64-pinephone:/home/user/modem-firmware# sh -x flashall
+ echo 'Sending AT+QFASTBOOT...'
Sending AT+QFASTBOOT...
+ sudo sh -c 'echo -ne "AT+QFASTBOOT\r" > /dev/ttyUSB2'
+ fastboot oem stay
< waiting for any device >
[Mon Jun 12 10:52:53 2023] usb 2-1: USB disconnect, device number 8
[Mon Jun 12 10:52:53 2023] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[Mon Jun 12 10:52:53 2023] option 2-1:1.0: device disconnected
[Mon Jun 12 10:52:53 2023] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[Mon Jun 12 10:52:53 2023] option 2-1:1.1: device disconnected
[Mon Jun 12 10:52:53 2023] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
[Mon Jun 12 10:52:53 2023] option 2-1:1.2: device disconnected
[Mon Jun 12 10:52:53 2023] option1 ttyUSB3: GSM modem (1-port) converter now disconnected from ttyUSB3
[Mon Jun 12 10:52:53 2023] option 2-1:1.3: device disconnected
[Mon Jun 12 10:52:53 2023] qmi_wwan 2-1:1.4 wwan0: unregister 'qmi_wwan' usb-1c1b000.usb-1, WWAN/QMI device
Jun 12 10:52:54 pine64-pinephone authpriv.notice sudo:     root : TTY=pts/0 ; PWD=/home/user/modem-firmware ; USER=root ; COMMAND=/bin/sh -c echo -ne "AT+QFASTBOOT\r" > /dev/ttyUSB2
Jun 12 10:52:54 pine64-pinephone daemon.info [1966]: <info>  [base-manager] port ttyUSB0 released by device '/sys/devices/platform/soc/1c1b000.usb/usb2/2-1'
Jun 12 10:52:54 pine64-pinephone daemon.info [1966]: <info>  [base-manager] port ttyUSB1 released by device '/sys/devices/platform/soc/1c1b000.usb/usb2/2-1'
Jun 12 10:52:54 pine64-pinephone daemon.info [1966]: <info>  [base-manager] port ttyUSB2 released by device '/sys/devices/platform/soc/1c1b000.usb/usb2/2-1'
Jun 12 10:52:54 pine64-pinephone daemon.info [1966]: <info>  [base-manager] port ttyUSB3 released by device '/sys/devices/platform/soc/1c1b000.usb/usb2/2-1'
Jun 12 10:52:54 pine64-pinephone daemon.info [1966]: <info>  [base-manager] port wwan0 released by device '/sys/devices/platform/soc/1c1b000.usb/usb2/2-1'
Jun 12 10:52:54 pine64-pinephone daemon.warn [1966]: <warn>  Cannot read from istream: connection broken
Jun 12 10:52:54 pine64-pinephone daemon.info [1966]: <info>  [modem6] port 'cdc-wdm0' no longer controllable, reprobing
Jun 12 10:52:54 pine64-pinephone daemon.info NetworkManager[2272]: <info>  [1686559974.1549] device (cdc-wdm0): state change: disconnected -> unmanaged (reason 'removed', sys-iface-state: 'removed')
Jun 12 10:52:54 pine64-pinephone daemon.info [1966]: <info>  [base-manager] port cdc-wdm0 released by device '/sys/devices/platform/soc/1c1b000.usb/usb2/2-1'
[Mon Jun 12 10:52:54 2023] usb 2-1: new high-speed USB device number 9 using ehci-platform
FAILED (remote: 'unknown command')
fastboot: error: Command failed
+ fastboot flash aboot appsboot.mbn
Sending 'aboot' (279 KB)                           OKAY [  0.012s]
Writing 'aboot'                                    OKAY [  0.145s]
Finished. Total time: 0.168s
+ fastboot reboot
Rebooting                                          OKAY [  0.017s]
[Mon Jun 12 10:52:55 2023] usb 2-1: USB disconnect, device number 9
Finished. Total time: 0.067s
+ sleep 1
+ fastboot oem stay
< waiting for any device >
[Mon Jun 12 10:52:56 2023] usb 2-1: new high-speed USB device number 10 using ehci-platform
OKAY [  0.002s]
Finished. Total time: 0.002s
+ sleep 1
+ fastboot flash:raw boot boot-mdm9607.img
< waiting for any device >
Sending 'boot' (4600 KB)                           OKAY [  0.166s]
Writing 'boot'                                     OKAY [  1.753s]
Finished. Total time: 1.937s
+ fastboot flash:raw recovery boot-mdm9607.img
Sending 'recovery' (4600 KB)                       OKAY [  0.162s]
Writing 'recovery'                                 OKAY [  1.752s]
Finished. Total time: 1.932s
+ fastboot flash system rootfs-mdm9607.ubi
Sending 'system' (27648 KB)                        OKAY [  0.958s]
Writing 'system'                                   OKAY [ 11.163s]
Finished. Total time: 12.133s
+ fastboot flash recoveryfs recoveryfs.ubi
Sending 'recoveryfs' (13056 KB)                    OKAY [  0.454s]
Writing 'recoveryfs'                               OKAY [  4.686s]
Finished. Total time: 5.153s
+ fastboot reboot
Rebooting                                          OKAY [  0.004s]
[Mon Jun 12 10:53:20 2023] usb 2-1: USB disconnect, device number 10
Finished. Total time: 0.055s
+ echo 'Done!'
Done!
pine64-pinephone:/home/user/modem-firmware# [Mon Jun 12 10:53:21 2023] usb 2-1: new high-speed USB device number 11 using ehci-platform
[Mon Jun 12 10:53:26 2023] usb 2-1: USB disconnect, device number 11
[Mon Jun 12 10:53:42 2023] usb 2-1: new high-speed USB device number 12 using ehci-platform
[Mon Jun 12 10:53:42 2023] option 2-1:1.0: GSM modem (1-port) converter detected
[Mon Jun 12 10:53:42 2023] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
[Mon Jun 12 10:53:42 2023] option 2-1:1.1: GSM modem (1-port) converter detected
[Mon Jun 12 10:53:42 2023] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1
[Mon Jun 12 10:53:42 2023] option 2-1:1.2: GSM modem (1-port) converter detected
[Mon Jun 12 10:53:42 2023] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB2
[Mon Jun 12 10:53:42 2023] option 2-1:1.3: GSM modem (1-port) converter detected
[Mon Jun 12 10:53:42 2023] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB3
[Mon Jun 12 10:53:42 2023] qmi_wwan 2-1:1.4: cdc-wdm0: USB WDM device
[Mon Jun 12 10:53:42 2023] qmi_wwan 2-1:1.4 wwan0: register 'qmi_wwan' at usb-1c1b000.usb-1, WWAN/QMI device, 32:5f:5b:44:e8:c1
Jun 12 10:53:43 pine64-pinephone user.notice postmarketOS:modem-setup: Modem already configured
Jun 12 10:53:54 pine64-pinephone daemon.info [1966]: <info>  [device /sys/devices/platform/soc/1c1b000.usb/usb2/2-1] creating modem with plugin 'quectel' and '6' ports
Jun 12 10:53:54 pine64-pinephone daemon.warn [1966]: <warn>  [plugin/quectel] could not grab port ttyUSB3: Cannot add port 'tty/ttyUSB3', unhandled port type
Jun 12 10:53:54 pine64-pinephone daemon.info [1966]: <info>  [base-manager] modem for device '/sys/devices/platform/soc/1c1b000.usb/usb2/2-1' successfully created
Jun 12 10:53:55 pine64-pinephone daemon.warn [1966]: <warn>  [modem7] couldn't query SIM slots: QMI protocol error (94): 'NotSupported'
Jun 12 10:53:56 pine64-pinephone daemon.warn [1966]: <warn>  [modem7/sim5] couldn't load list of emergency numbers: uninitialized emergency numbers list
Jun 12 10:53:56 pine64-pinephone daemon.warn [1966]: <warn>  [modem7] couldn't load list of own numbers: Couldn't get MSISDN: QMI protocol error (16): 'NotProvisioned'
Jun 12 10:53:56 pine64-pinephone daemon.info [1966]: <info>  [modem7] state changed (unknown -> disabled)
Jun 12 10:53:56 pine64-pinephone daemon.info NetworkManager[2272]: <info>  [1686560036.9081] manager: (cdc-wdm0): new Broadband device (/org/freedesktop/NetworkManager/Devices/10)
Jun 12 10:53:56 pine64-pinephone daemon.info NetworkManager[2272]: <info>  [1686560036.9131] device (cdc-wdm0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Jun 12 10:53:56 pine64-pinephone daemon.info NetworkManager[2272]: <info>  [1686560036.9154] device (cdc-wdm0): modem state 'enabling'
Jun 12 10:53:56 pine64-pinephone daemon.info NetworkManager[2272]: <info>  [1686560036.9182] device (cdc-wdm0): state change: unavailable -> disconnected (reason 'none', sys-iface-state: 'managed')
Jun 12 10:53:56 pine64-pinephone daemon.info [1966]: <info>  [modem7] state changed (disabled -> enabling)
Jun 12 10:53:57 pine64-pinephone daemon.info [1966]: <info>  [modem7] power state updated: on
Jun 12 10:53:57 pine64-pinephone daemon.info [1966]: <info>  [modem7] state changed (enabling -> enabled)
Jun 12 10:53:57 pine64-pinephone daemon.info [1966]: <info>  [modem7] 3GPP registration state changed (unknown -> registering)
Jun 12 10:53:57 pine64-pinephone daemon.info [1966]: <info>  [modem7] 3GPP registration state changed (registering -> roaming)
Jun 12 10:53:57 pine64-pinephone daemon.info [1966]: <info>  [modem7] state changed (enabled -> registered)
Jun 12 10:54:06 pine64-pinephone daemon.warn [1966]: <warn>  [modem7] couldn't load network timezone from the current network

pine64-pinephone:/home/user/modem-firmware#
pine64-pinephone:/home/user/modem-firmware# fwupdmgr get-devices
Jun 12 10:54:17 pine64-pinephone authpriv.notice polkitd[2031]: Registered Authentication Agent for unix-process:28593:6556826 (system bus name :1.92 [/usr/bin/pkttyagent --notify-fd 6 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale C.UTF-8)
WARNING: UEFI capsule updates not available or enabled in firmware setup
  See https://github.com/fwupd/fwupd/wiki/PluginFlag:capsules-unsupported for more information.
WARNING: This package has not been validated, it may not work properly.
pine64 Pine64 PinePhone Braveheart (1.1)
│
├─Unknown Device:
│     Device ID:          0e0c93c8b4bb222157feedbde8f863e23bd1a8f7
│     Current version:    0x1400000000000000
│     Vendor:             EMMC:0x0000e1
│     GUID:               ba81658c-572e-5097-a08f-f9f023bb4224 ← EMMC\MAN_00E1&OEM_0116
│     Device Flags:       • Internal device
│                         • Updatable
│
└─QUECTEL Mobile Broadband Module:
      Device ID:          976c4a39e87f61e6940ea6a8d39c583cfa99615f
      Summary:            Quectel EG25-G modem
      Current version:    EG25GGBR07A07M2G_01.002.01.002
      Vendor:             Qualcomm (USB:0x2C7C, USB:0x18D1)
      GUIDs:              db379a33-254f-5140-b37e-d36ae7e5c039
                          d18f31f1-a3fa-55a2-b4ed-decfbc1e004d ← USB\VID_2C7C&PID_0125&REV_0318&NAME_EG25GGB
                          1a2996cb-f86e-5583-a464-e1b96e1c6ae9 ← USB\VID_2C7C&PID_0125&REV_0318
                          587bf468-6859-5522-93a7-6cce552a0aa3 ← USB\VID_2C7C&PID_0125
                          22ae45db-f68e-5c55-9c02-4557dca238ec ← USB\VID_2C7C
      Device Flags:       • Updatable
                          • System requires external power source
                          • Supported on remote server
                          • Device supports switching to a different branch of firmware
                          • Unsigned Payload