Problem with unsolicited WGPSNMEA response


I can not correctly receive unsolicited responses from AT+WGPSNMEA command.

I subscribe to $GPGGA unsolicited response. When it fires, first 16 to 27 bytes (variable) are passed to OAT application, all others are forwarded to UART, allthough explicitly programmed not to do so.

void adl_main ( adl_InitType_e InitType )
  TRACE (( 1, "Embedded Application : Main" ));
	adl_atCmdCreate("AT+WGPSNMEA=1,0", FALSE, GpsCmdNMEAHandler, "*", NULL);
	adl_atUnSoSubscribe("$GPGGA", GpsNMEAHandler);

bool GpsCmdNMEAHandler(adl_atResponse_t * Param) {

	TRACE ((1, "<CMDNMEA>: %d", Param->RspID));

bool GpsNMEAHandler(adl_atUnsolicited_t * Param) {
	ascii ss[100];

	sprintf(ss, "<NMEA>: %d,%d,>%s<", Param->RspID, Param->StrLength, Param->StrData);
	TRACE ((1, ss));

The response in debugger:

6086.656	Trace	CUS4	1	Embedded Application : Main
6087.297	Trace	CUS4	1	<CMDNMEA>: 1
6087.417	Trace	CUS4	1	<NMEA>: 0,19,>$GPGGA,,,,,,0,0,99<
6088.500	Trace	CUS4	1	<NMEA>: 0,26,>$GPGGA,212936.27,,,,,0,0,<
6089.500	Trace	CUS4	1	<NMEA>: 0,26,>$GPGGA,212937.27,,,,,0,0,<

The leftover on terminal emulator:


I use:
OAT 3.02
OS 6.51

In target mode the behaviour is the same.

Any hints? Can someone reproduce the problem?


We’ve got similar problem. While subscribing for "$GPRMC, " messages, only 17 bytes of these arrive to the specified handler.


Hello Everybody,
I think that you are not getting the WPS frames in the handler because, the complete NMEA frame do not come in one go.
In other words, first the Open-AT first receives
$GPGGA,0,0,99 and then receives the remaining frame.
Now as in your application, you have subscribe for $GPGGA, you will not receive the remaining portion of the NMEA frame (as it does not start with $GPGGA but is a part of the previous frame). So, the unsolicited handler misses this part.

This can be the reason for the reported behavior. To get rid of this problem, please subscribe to GPS services and then get the GPS NMEA frames in the GPS handler function.

Best Regards,
Open AT Fan.


Hello OpenAT_Fan,

I am (also) interested in $GPRMC unsolicited responses. But I dont want to get them via internal mode with AT+WGPSNMEA on the other COM, because I need this COM for other purposes.

You wrote

How can I access the raw GPS NMEA frames in the GPS handler function? I only find GPSData as parameter which is a pointer to adl_gpsData_t data structure - and here I can only find already interpreted data.

Thanks in advance



Subscribe to gps service:

adl_gpsSubscribe(GpsHandler, PollingTime);

In GpsHandler recreate NMEA frame from GpsData parameter.

What a waste of CPU cycles!