GPS Subscribe / Unsubscribe and AT+WDWL problem : HANG


#1

Hi all,
after investigating a while I find that if an application subscribes to Gps and then Unsubscribe, once the application terminates, you cannot use the AT+WDWL command anymore. I HAVE TO RELOAD THE WAVECOM firmware again (via DwlWin) in order to issue the AT+WDWL command.

To recreate the problem, run this small program

#include "adl_global.h"

u32 wm_apmCustomStack [ 256 ];
const u16 wm_apmCustomStackSize = sizeof ( wm_apmCustomStack );
u8	GpsHandle = -1;				// Invlaid handle.
char *GpsEveDescr[] = { "ADL_GPS_EVENT_RESETING_HARDWARE",
						"ADL_GPS_EVENT_EXT_MODE",
						"ADL_GPS_EVENT_IDLE",
						"ADL_GPS_EVENT_POLLING_DATA" };

//
// Local functions
//
bool GpsServiceRoutine ( adl_gpsEvent_e Event, adl_gpsData_t * GPSData );
void UnsubscribeGpsServiceRoutine ( u8 TimerID );

void adl_main ( adl_InitType_e InitType )
{
	TRACE(( 1, ">>> GPS Subscribe/Unsubscribe application <<<" ));
    
    // Subscribe to GPS service
    GpsHandle = adl_gpsSubscribe ( GpsServiceRoutine, 5 );
    TRACE(( 1, "adl_gpsSubscribe( ) Rc = %d", (int)GpsHandle ));

	adl_tmrSubscribe( FALSE,			// NOT A CYCLIC TIMER
					  10 * 60,			// 60 SECONDS
					  ADL_TMR_TYPE_100MS,
					  UnsubscribeGpsServiceRoutine );

}

bool GpsServiceRoutine ( adl_gpsEvent_e Event, adl_gpsData_t * GPSData )
{
	TRACE(( 1, GpsEveDescr[ Event ] ));

	return TRUE;
}

void UnsubscribeGpsServiceRoutine ( u8 TimerID )
{
	s8 Rc;

	TRACE(( 1, "UnsubscribeGpsServiceRoutine(u8 TimerID=%d)", (int)TimerID ));
	Rc = adl_gpsUnsubscribe( GpsHandle );
	TRACE(( 1, "adl_gpsUnsubscribe( %d ) Rc=%d", (int)GpsHandle, (int)Rc ));
}

Once the program terminates ( “UnsubscribeGpsServiceRoutine(u8 TimerID=%d” ) run the AT+WOPEN=0 command in order to stop the application.

When I start Hyperterminal and I try to run the AT+WDWL command, nothing happen. I have to reload the Wavecom firmware to exit from this situation.

Is this something already known by all except me???
Is this a real bug ???
Do I miss something in my code ???

Thanks in advance
Carlo

P.S. Wavecom module 2501B and Muse 3.10 - Firmware level 6.55

at+cgmr
655_09gg.Q2501B 2015268 111705 17:01
ok

#2

Hi cbeghelli,

Even I have encountered this problem. When an Open AT application which subscribes to GPS is executed , module will switch from GPS external mode to internal mode. Because of this the problem mentinoed by you occurs.
To solve the problem module should be switched back to GPS external mode. This can be done by executing the"AT+WGPSCONF=0, 0” command.

Hope this solves your problem.

Regards,
OpenAT_Fan


#3

Hi OpenAT_Fan,

thank you very much for your help.

Looking your suggestion (issue AT+WGPSCONF=0,0), I modified my sample program and I discover that ADDING any AT command, solve the problem :open_mouth: :open_mouth: :open_mouth: . . .

It sounds very strange to me, but … it works :unamused: :unamused: :unamused:

Running the below code, you won’t face the AT+WDWL bug.

#include "adl_global.h"

u32 wm_apmCustomStack [ 256 ];
const u16 wm_apmCustomStackSize = sizeof ( wm_apmCustomStack );
u8	GpsHandle = -1;				// Invlaid handle.
char *GpsEveDescr[] = { "ADL_GPS_EVENT_RESETING_HARDWARE",
						"ADL_GPS_EVENT_EXT_MODE",
						"ADL_GPS_EVENT_IDLE",
						"ADL_GPS_EVENT_POLLING_DATA" };

//
// Local functions
//
bool GpsServiceRoutine ( adl_gpsEvent_e Event, adl_gpsData_t * GPSData );
void UnsubscribeGpsServiceRoutine ( u8 TimerID );
bool MyHandler(adl_atResponse_t *paras);

void adl_main ( adl_InitType_e InitType )
{
	TRACE(( 1, ">>> GPS Subscribe/Unsubscribe application <<<" ));
    
    // Subscribe to GPS service
    GpsHandle = adl_gpsSubscribe ( GpsServiceRoutine, 5 );
    TRACE(( 1, "adl_gpsSubscribe( ) Rc = %d", (int)GpsHandle ));

	adl_tmrSubscribe( FALSE,				// NOT A CYCLIC TIMER
					  10 * 60,				// 60 SECONDS
					  ADL_TMR_TYPE_100MS,
					  UnsubscribeGpsServiceRoutine );
}

bool GpsServiceRoutine ( adl_gpsEvent_e Event, adl_gpsData_t * GPSData )
{
	TRACE(( 1, GpsEveDescr[ Event ] ));

	return TRUE;
}

void UnsubscribeGpsServiceRoutine ( u8 TimerID )
{
	s8 Rc;

	TRACE(( 1, "UnsubscribeGpsServiceRoutine(u8 TimerID=%d)", (int)TimerID ));
	Rc = adl_gpsUnsubscribe( GpsHandle );
	TRACE(( 1, "adl_gpsUnsubscribe( %d ) Rc=%d", (int)GpsHandle, (int)Rc ));

//	Rc = adl_atCmdCreate("at+wgpconf=0,0", FALSE, MyHandler, "*", NULL);
//	TRACE(( 1, "adl_atCmdCreate( 'at+wgpconf=0,0' Rc=%d", (int)Rc ));

// **********
// THIS CMD HAS NOTHING RELATED TO GPS BUT IT SOLVES THE AT+WDWL PROBLEM !!!
// **********
	Rc = adl_atCmdCreate("at+cgmr", FALSE, MyHandler, "*", NULL);
	TRACE(( 1, "adl_atCmdCreate( 'at+cgmr' Rc=%d", (int)Rc ));

}

bool MyHandler(adl_atResponse_t *paras)
{
	TRACE(( 1, "MyHandler( len=%d )", paras->StrLength ));
	TRACE(( 1, paras->StrData ));
   return( FALSE );
}

Please note that AT+CGMR command return the software version: nothing related to GPS stuff.

It sounds like there’s something pending and the adl_atCmdCreate() purge the scenario.

ThanX a lot 4 your help OpenAT_Fan


#4

Please help me. Where can I download DWLWIN?


#5

Hi Chapa,
Please contact your Wavecom contact personnel. You can ask them to provide you the DwlWin tool.

Regards,
Open AT Fan.


#6

I’ve encountered the same problem. Just to make it clear: do I need to reload Wavecom firmware (and after that avoid such problems using cbeghelli example) or I can make “at+wdwl” usable once again simply sending “at+wgpsconf=0,0”?