Skip to content

Instantly share code, notes, and snippets.

@doevelopper
Created February 10, 2026 08:08
Show Gist options
  • Select an option

  • Save doevelopper/fded3be95ebe9c3d3344b361bfe35394 to your computer and use it in GitHub Desktop.

Select an option

Save doevelopper/fded3be95ebe9c3d3344b361bfe35394 to your computer and use it in GitHub Desktop.

Short answer: Yes. With a SIM7600G‑H 4G HAT you can run a PPP data session for Internet access and, at the same time, read GNSS (GPS/BeiDou/GLONASS/Galileo) position—because the module exposes multiple USB serial interfaces: one used by PPP for the data call, one (or more) for AT commands, and one that can stream NMEA from the GNSS. [files.waveshare.com], [altronics.cl]


How it works on SIM7600G‑H

  • Multiple USB ports: When connected over USB, the SIM7600 typically enumerates several /dev/ttyUSBx interfaces—commonly:

    • a modem/data port that PPP uses (often /dev/ttyUSB3),
    • an AT command port (often /dev/ttyUSB2),
    • an NMEA/GNSS port for continuous GPS sentences (often /dev/ttyUSB1).
      Exact numbering can vary by firmware/driver, but this split is standard and documented in guides and vendor wikis. [forums.ras...errypi.com], [github.com], [waveshare.net]
  • GNSS control: You control the GNSS with AT commands—e.g. AT+CGPS=1,1 to start standalone GNSS, AT+CGPSINFO to poll the latest fix, and AT+CGPS=0 to stop. You can also configure periodic NMEA output on the GNSS port and feed it to gpsd. These commands and behaviors are defined in SIMCom’s AT manual and GNSS application note. [files.waveshare.com], [altronics.cl], [techship.com]

  • Independence from PPP: A PPP session occupies the modem/data TTY only; you remain free to use the AT TTY to manage GNSS or read the NMEA TTY concurrently. This is the intended design and is reflected in SIMCom docs and Waveshare materials. [files.waveshare.com], [waveshare.com]


Minimal Linux setup (PPP + GPS at the same time)

  1. Bring up PPP (example; adapt the peer/APN to your SIM):

    # Example: use the modem/data port
    sudo pppd /dev/ttyUSB3 115200 connect 'chat -v -f /etc/chatscripts/gprs' \
        noauth defaultroute usepeerdns persist

    If you run into issues with PPP device selection or port contention, confirm which /dev/ttyUSBx gets used for data on your setup (it’s often USB3). Waveshare’s wiki shows PPPD as one of the supported dial-up methods. [waveshare.com]

  2. Enable GNSS on the AT port (e.g., /dev/ttyUSB2) and read NMEA:

    # Start GNSS in standalone mode
    printf "AT+CGPS=1,1\r" | socat - /dev/ttyUSB2,crnl,raw,echo=0
    
    # Option A: Poll a one-shot fix from the AT port
    printf "AT+CGPSINFO\r" | socat - /dev/ttyUSB2,crnl,raw,echo=0
    
    # Option B: stream NMEA from the GNSS/NMEA port (often /dev/ttyUSB1)
    gpsd -n -N -D3 /dev/ttyUSB1
    cgps -s

    Command syntax and the +CGPSINFO output format are defined in SIMCom’s GNSS notes and AT manual; community examples map /dev/ttyUSB1 to NMEA and /dev/ttyUSB2 to AT on many HATs. [altronics.cl], [techship.com], [github.com]


Practical tips & caveats

  • Don’t share a port: If PPP is using /dev/ttyUSB3, do not send AT commands on that same port while the data call is active—use the separate AT port. [files.waveshare.com]
  • GNSS antenna & power: Use a suitable GNSS antenna, with clear sky view. If you use an active antenna, SIM7600 can provide ~3 V bias via AT+CVAUXS=1 / AT+CVAUXV=3050 as described in the GNSS app note. [altronics.cl]
  • Faster alternatives: For production you might prefer QMI/NDIS over PPP for throughput and stability, but PPP is fine for a proof‑of‑concept and is officially supported in Waveshare docs. [waveshare.com]
  • USB mapping may differ: If port numbers differ from the examples above, check dmesg, lsusb, and try sending AT to each /dev/ttyUSBx to identify AT vs. NMEA vs. data. Community guides outline this mapping approach on Raspberry Pi. [forums.ras...errypi.com], [ubiqueiot.com]

TL;DR

  • Yes, PPP data and GNSS queries can run simultaneously on SIM7600G‑H.
  • Use PPP on the modem port (e.g., /dev/ttyUSB3), send GNSS AT commands on the AT port (e.g., /dev/ttyUSB2), and/or read NMEA from the GNSS port (e.g., /dev/ttyUSB1).
  • Control GNSS with AT+CGPS=1,1 / AT+CGPSINFO, or stream via gpsd.
    Documentation and examples: SIMCom AT manual & GNSS app note; Waveshare wiki; Raspberry Pi community posts. [files.waveshare.com], [altronics.cl], [waveshare.com], [forums.ras...errypi.com]

If you want, I can draft a ready‑to‑run PPP + gpsd setup script for your target board (Raspberry Pi or other Linux SBC)—just tell me your APN and which distro you’re using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment