On the pinephone, how to communicate with the modem (with AT commands)

Hi,
I would like to experiment a bit with the modem (send AT commands etc.). I tried with minicom (as described here : PinePhone - PINE64), but I can’t input anything (the screen stay black with only the help message, and nothing happens whatever key I press, except CTRL+A ones…). I also tried raw cat/echo to /dev/ttyUSB2, but nothing is outputed…

inxi
System:
  Kernel: 5.11.9-1-MANJARO-ARM aarch64 bits: 64 compiler: gcc v: 10.2.0 
  parameters: loglevel=4 console=tty0 console=ttyS0,115200 
  earlycon=uart,mmio32,0x01c28000 consoleblank=0 boot=PARTUUID=bd9e0736-01 
  root=PARTUUID=bd9e0736-02 rw rootwait quiet 
  bootsplash.bootfile=bootsplash-themes/manjaro/bootsplash 
  Console: tty 0 DM: SDDM Distro: Manjaro ARM 
Machine:
  Type: ARM Device System: Pine64 PinePhone (1.2) details: N/A 
  serial: <filter> 
Battery:
  ID-1: axp20x-battery charge: 85% condition: N/A volts: 4.2/3.0 model: N/A 
  type: N/A serial: N/A status: Charging 
Memory:
  RAM: total: 2.92 GiB used: 700.9 MiB (23.4%) 
  RAM Report: missing: Required program dmidecode not available 
CPU:
  Info: Quad Core model: N/A variant: cortex-a53 bits: 64 type: MCP 
  arch: ARMv8 family: 8 model-id: N/A stepping: 4 microcode: N/A bogomips: 0 
  Speed: 648 MHz min/max: 648/1152 MHz Core speeds (MHz): 1: 648 2: 648 3: 648 
  4: 648 
  Features: aes asimd cpuid crc32 evtstrm fp pmull sha1 sha2 
  Vulnerabilities: Type: itlb_multihit status: Not affected 
  Type: l1tf status: Not affected 
  Type: mds status: Not affected 
  Type: meltdown status: Not affected 
  Type: spec_store_bypass status: Not affected 
  Type: spectre_v1 mitigation: __user pointer sanitization 
  Type: spectre_v2 status: Not affected 
  Type: srbds status: Not affected 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: sun50i-a64-mali driver: lima v: kernel bus ID: N/A 
  chip ID: allwinner:1c40000 
  Device-2: sun50i-a64-dw-hdmi driver: sun8i_dw_hdmi v: N/A bus ID: N/A 
  chip ID: allwinner:1ee0000 
  Device-3: sun50i-a64-display-engine driver: sun4i_drm v: N/A bus ID: N/A 
  chip ID: allwinner:display-engine 
  Display: server: X.org 1.20.10 compositor: kwin_wayland driver: modesetting 
  alternate: fbdev tty: 315x75 
  Message: Unable to show advanced data. Required tool glxinfo missing. 
Audio:
  Device-1: sun50i-a64-dw-hdmi driver: sun8i_dw_hdmi bus ID: N/A 
  chip ID: allwinner:1ee0000 
  Device-2: simple-audio-card driver: N/A bus ID: N/A 
  chip ID: simple-audio-card:hdmi-sound 
  Device-3: simple-audio-card driver: asoc_simple_card bus ID: N/A 
  chip ID: simple-audio-card:sound 
  Sound Server: ALSA v: k5.11.9-1-MANJARO-ARM 
Network:
  Device-1: regulator-fixed driver: reg_fixed_voltage v: N/A port: N/A 
  bus ID: N/A chip ID: regulator-fixed:vbat-wifi 
  Device-2: mmc-pwrseq-simple driver: pwrseq_simple v: N/A port: N/A 
  bus ID: N/A chip ID: mmc-pwrseq-simple:wifi-pwrseq 
  Device-3: sun50i-a64-emac driver: N/A port: N/A bus ID: N/A 
  chip ID: allwinner:soc 
  IF: wlan0 state: up mac: <filter> 
  IP v4: <filter> type: dynamic noprefixroute scope: global 
  broadcast: <filter> 
  IP v6: <filter> type: noprefixroute scope: link 
  IF-ID-1: wwan0 state: unknown mac: N/A 
  IP v4: <filter> type: noprefixroute scope: global broadcast: <filter> 
  IP v6: <filter> type: noprefixroute scope: global 
  WAN IP: <filter> 
Drives:
  Local Storage: total: 44.03 GiB used: 8.20 GiB (18.6%) 
  SMART Message: Required tool smartctl not installed. Check --recommends 
  ID-1: /dev/mmcblk0 model: N/A size: 14.91 GiB block size: physical: 512 B 
  logical: 512 B serial: <filter> scheme: MBR 
  ID-2: /dev/mmcblk2 model: DA4032 size: 29.12 GiB block size: physical: 512 B 
  logical: 512 B serial: <filter> rev: 0x8 
  Message: No Optical or Floppy data was found. 
RAID:
  Message: No RAID data was found. 
Partition:
  ID-1: / raw size: 14.67 GiB size: 14.38 GiB (98.01%) used: 8.16 GiB (56.7%) 
  fs: ext4 block size: 4096 B dev: /dev/mmcblk0p2 label: ROOT_MNJRO 
  uuid: 04cb10dd-5377-4b79-bd5f-f98459fb9d81 
  ID-2: /boot raw size: 213.6 MiB size: 213.4 MiB (99.89%) 
  used: 38.1 MiB (17.9%) fs: vfat block size: 512 B dev: /dev/mmcblk0p1 
  label: BOOT_MNJRO uuid: BFDA-4587 
Swap:
  Kernel: swappiness: 60 (default) cache pressure: 100 (default) 
  ID-1: swap-1 type: zram size: 4.39 GiB used: 2.2 MiB (0.1%) priority: 100 
  dev: /dev/zram0 
Unmounted:
  Message: No unmounted partitions found. 
USB:
  Hub: 1-0:1 info: Full speed (or root) Hub ports: 1 rev: 2.0 speed: 480 Mb/s 
  chip ID: 1d6b:0002 
  Hub: 2-0:1 info: Full speed (or root) Hub ports: 1 rev: 2.0 speed: 480 Mb/s 
  chip ID: 1d6b:0002 
  Device-1: 2-1:9 info: Quectel Wireless Solutions EC25 LTE modem 
  type: <vendor specific> driver: option,option1,qmi_wwan interfaces: 5 
  rev: 2.0 speed: 480 Mb/s chip ID: 2c7c:0125 
  Hub: 3-0:1 info: Full speed (or root) Hub ports: 1 rev: 1.1 speed: 12 Mb/s 
  chip ID: 1d6b:0001 
  Hub: 4-0:1 info: Full speed (or root) Hub ports: 1 rev: 1.1 speed: 12 Mb/s 
  chip ID: 1d6b:0001 
  Hub: 5-0:1 info: Full speed (or root) Hub ports: 1 rev: 2.0 speed: 480 Mb/s 
  chip ID: 1d6b:0002 
Sensors:
  System Temperatures: cpu: 30.8 C mobo: N/A 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 176 Uptime: 13h 35m Init: systemd v: 247 Compilers: gcc: 10.2.0 
  Packages: pacman: 787 lib: 181 flatpak: 0 Shell: Zsh (sudo) v: 5.8 
  running in: tty 0 (SSH) inxi: 3.1.08
lsusb
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 009: ID 2c7c:0125 Quectel Wireless Solutions Co., Ltd. EC25 LTE modem
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Thus, I have several question :

  1. How applications communicate with the modem ? does it all pass through /dev/ttyUSB2, or is it just a debug / configuration interface, and there are sysfs binding ? 1.a) in particular, how does communicate the kernel (the wwan0 interface)

  2. Is there some sevices to disable to access it with minicom ?

  3. (optionnal since I may easily find the answer) What does minicom do that echo/cat don’t ?

Use /dev/EG25.AT instead of /dev/ttyUSB2. :slight_smile:

Thanks for the tip, even if /dev/EG25.AT is just a symlink to /dev/ttyUSB2, I guess it makes easier to ensure compatibility across devices…

I got it to work with atinout (I still don’t understand why minicom doesn’t work…).

However, I noticed the /dev/EG.NMEA and /dev/EG.MODEM, I suppose it is this way data and other stuff communicate with the modem ?

Where can I find resources on the status of the developpment on the modem ? (what software does what about the modem in the current manjaro release ?)