Skip to content

Commit

Permalink
[WIP] Add support for Airoha AG3335 GPS (#4394)
Browse files Browse the repository at this point in the history
* Add GPS detection code for Airoha AG3335

Airoha AG3335 is used in Seeed T-1000E Tracker

* Add support for Airoha AG3335

Airoha AG3335 is used in Seeed T-1000E Tracker. This adds
detection code, and code to configure its use.

---------

Co-authored-by: Ben Meadors <[email protected]>
  • Loading branch information
fifieldt and thebentern authored Aug 9, 2024
1 parent 02ae24b commit b498c0b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
24 changes: 24 additions & 0 deletions src/gps/GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,22 @@ bool GPS::setup()
delay(250);
_serial_gps->write("$CFGMSG,6,1,0\r\n");
delay(250);
} else if (gnssModel == GNSS_MODEL_AG3335) {

_serial_gps->write("$PAIR066,1,0,1,0,0,1*3B"); // Enable GPS+GALILEO+NAVIC

// Configure NMEA (sentences will output once per fix)
_serial_gps->write("$PAIR062,0,0*3F"); // GGA ON
_serial_gps->write("$PAIR062,1,0*3F"); // GLL OFF
_serial_gps->write("$PAIR062,2,1*3D"); // GSA ON
_serial_gps->write("$PAIR062,3,0*3D"); // GSV OFF
_serial_gps->write("$PAIR062,4,0*3B"); // RMC ON
_serial_gps->write("$PAIR062,5,0*3B"); // VTG OFF
_serial_gps->write("$PAIR062,6,1*39"); // ZDA ON

delay(250);
_serial_gps->write("$PAIR513*3D"); // save configuration

} else if (gnssModel == GNSS_MODEL_UBLOX) {
// Configure GNSS system to GPS+SBAS+GLONASS (Module may restart after this command)
// We need set it because by default it is GPS only, and we want to use GLONASS too
Expand Down Expand Up @@ -1218,6 +1234,14 @@ GnssModel_t GPS::probe(int serialSpeed)
return GNSS_MODEL_ATGM336H;
}

/* Airoha (Mediatek) AG3335A/M/S, A3352Q, Quectel L89 2.0, SimCom SIM65M */
clearBuffer();
_serial_gps->write("PAIR020*38\r\n");
if (getACK("$PAIR020,AG3335", 500) == GNSS_RESPONSE_OK) {
LOG_INFO("Aioha AG3335 detected, using AG3335 Module\n");
return GNSS_MODEL_AG3335;
}

// Get version information
clearBuffer();
_serial_gps->write("$PCAS06,0*1B\r\n");
Expand Down
5 changes: 3 additions & 2 deletions src/gps/GPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ typedef enum {
GNSS_MODEL_UBLOX,
GNSS_MODEL_UC6580,
GNSS_MODEL_UNKNOWN,
GNSS_MODEL_MTK_L76B
GNSS_MODEL_MTK_L76B,
GNSS_MODEL_AG3335
} GnssModel_t;

typedef enum {
Expand Down Expand Up @@ -302,4 +303,4 @@ class GPS : private concurrency::OSThread
};

extern GPS *gps;
#endif // Exclude GPS
#endif // Exclude GPS

0 comments on commit b498c0b

Please sign in to comment.