Help with gps


#1

Hello
I am just starting to work with wavecom open at and i run in some problems.
I have a genloc31e with q24pl software on it
ati8
LLC T V1.03.3 GenLoc31e - Q24PL B OAT313 - Jun 15 2007 14:04:02

and i need to get from my application the gps data. From the documentation i understood that only for q25 there are some api’s for gps.
When I subscribe to gps service I get ADL_GPS_RET_ERR_NO_Q25_PRODUCT.
Here on the forum i read that i should use maybe uart2 but i didn’t get a clear picture about this

Could some one help me out?


#2

Hi,

I think the GPS API from Wavecom works only with GPS receivers supplied by Wavecom. The Q2501 has one built-in, the Q24**** does not. If you connect an external GPS receiver from a third party, I am afraid you have to write support for that yourself… Or choose a different Wavecom module…

Best Regards,
Jan


#3

Choosing a different wavecom module is not an option, so i’ll probably need to write the support myself, any tips how to start with this?


#4

Very simplified description:

To begin with, decide on what GPS module you want to use. Easiest is one that spits out NMEA (I think all do) and can also be configured with NMEA strings (many also have odd binary protocols).

Hook it up to a free UART, and set up a V24 flow on that UART, handle incoming data, and config as you want.


#5

I think you would need to switch UART2 into data mode. Check the Multi UART section of the forum… There should be some interesting Threads for you…

Best Regards,
Jan


#6

from what you said until now and what is in the documentation and in the uart part of the forum is figured this much

if (adl_fcmIsAvailable(ADL_FCM_FLOW_V24_UART2)==TRUE) //check if uart2 is available
{
u8 fcmHandle;
fcmHandle=adl_fcmSubscribe(ADL_FCM_FLOW_V24_UART2,(adl_fcmCtrlHdlr_f)fcmControlHandler,(adl_fcmDataHdlr_f)fcmDatahandler);
adl_fcmSwitchV24State(fcmHandle,ADL_FCM_V24_STATE_DATA); //swicth to data state
}
i still don’t get it were the connection with the gps is made and how do i receive data from it
The documentation is pretty bad and the other topics in the uart forum didn’t made thinks more clear


#7

Physically, you connect the async serial port of the GPS receiver to the UART (ie, async serial port) of the Wavecom module.

The data is delivered to the Data Handler specified in your flow subscription; ie, fcmDatahandler in your example.

Note that you cannot simply call adl_fcmSwitchV24State immediately after adl_fcmSubscribe - you need to wait for the ADL_FCM_EVENT_FLOW_OPENNED event.

Similarly, after calling adl_fcmSwitchV24State, you will need to wait for the ADL_FCM_EVENT_V24_DATA_MODE

This all lends itself to implemtation as a State Machine


#8

ok si what code i wrote above is ok i just need to mody it a bit so it waits for those events awneil said and i should receive in the fcmDatahandler function the data from gps


#9

After this:

i need to make another function call or something or the data will just arrive in my data handler?


#10

ADL_FCM_EVENT_V24_DATA_MODE indicates that the UART has completed the switch to Data mode (ie, it is no longer set-up just to handle AT Commands) - so, once you’ve received that event, the data should just start coming in to your handler.

However, you should not attempt to send anything on the Flow until after you’ve received the ADL_FCM_EVENT_V24_DATA_MODE event!


#11

ok i’m still having troubles with this i have this now
bool fcmControlHandler(adl_fcmEvent_e event){
// TRACE (( 1, “fcm control handler event %d”,event ));

// if (event==ADL_FCM_EVENT_FLOW_OPENNED){
// adl_fcmSwitchV24State(fcmHandle,ADL_FCM_V24_STATE_DATA); //swicth to data state
// TRACE (( 1, “switching do data state” ));
// }

}
bool fcmDataHandler(u16 DataLen,u8 *Data){
// TRACE (( 1, “fcm data %d”,Data));

}

void adl_main ( adl_InitType_e InitType )
{
TRACE (( 1, “Embedded : Appli Init” ));

/* Set 1s cyclic timer */

// adl_tmrSubscribe ( TRUE, 100, ADL_TMR_TYPE_100MS, HelloWorld_TimerHandler );
adl_atCmdSubscribe(WSCRIPT,(adl_atCmdHandler_t)atwscript_Handler,ADL_CMD_TYPE_ROOT);

// if (adl_fcmIsAvailable(ADL_FCM_FLOW_V24_UART2)==TRUE) //check if uart2 is available
// {
// fcmHandle=adl_fcmSubscribe(ADL_FCM_FLOW_V24_UART2,(adl_fcmCtrlHdlr_f)fcmControlHandler,(adl_fcmDataHdlr_f)fcmDataHandler);
// }

}
but if i uncomment the part with the if adl_fcmisavailable or the code from fcmControlHandler i can’t compile the code i get
[make_single_bin] Error 1
Done.
Updating RTE kernel file…
no generated DLL found…
[wmmake error #1] Build error.
i am using eclipse 3.1 ide
please help me out . Thanks


#12

i forgot to say that i have declared
u8 fcmHandle;
as a global variable


#13

and now if i comment this variable i get the same error like i said in my previous post. what is happennig?


#14

well i guess there was some problem with the other project i can’t figure it what i have now this code :
#include “adl_global.h”

/***********************************************************************/
/
Mandatory variables /
/
-------------------------------------------------------------------------
/
/
wm_apmCustomStack /
/
wm_apmCustomStackSize /
/
-------------------------------------------------------------------------
/
/***************************************************************************/
u32 wm_apmCustomStack [ 256 ];
const u16 wm_apmCustomStackSize = sizeof ( wm_apmCustomStack );

/**************************************************************************/
/
Local variables /
/
**************************************************************************/
u8 fcmHandle;

/**************************************************************************/
/
Local functions /
/
**************************************************************************/
bool fcmControlHandler(adl_fcmEvent_e event){
TRACE (( 1, “fcm control handler event %d”,event ));

if (event==ADL_FCM_EVENT_FLOW_OPENNED){
adl_fcmSwitchV24State(fcmHandle,ADL_FCM_V24_STATE_DATA); //swicth to data state 
TRACE (( 1, "switching do data state" ));
}
if (event==ADL_FCM_EVENT_V24_DATA_MODE){    
TRACE (( 1, "Now in data mode" ));
}

}
bool fcmDataHandler(u16 DataLen,u8 *Data){
TRACE (( 1, “fcm data %d”,*Data));

}

/*******************************************************************/
/
Function : adl_main /
/
-------------------------------------------------------------------------
/
/
Object : Customer application initialisation /
/
/
/
-------------------------------------------------------------------------
/
/
Variable Name |IN |OUT|GLB| Utilisation /
/
--------------------±–±--±–±---------------------------------------
/
/
InitType | | | | Application start mode reason /
/
--------------------±–±--±–±---------------------------------------
/
/***************************************************************************/
void adl_main ( adl_InitType_e InitType )
{
TRACE (( 1, “Embedded Application : Main” ));

if (adl_fcmIsAvailable(ADL_FCM_FLOW_V24_UART2)==TRUE) //check if uart2 is available
{
fcmHandle=adl_fcmSubscribe(ADL_FCM_FLOW_V24_UART2,(adl_fcmCtrlHdlr_f)fcmControlHandler,(adl_fcmDataHdlr_f)fcmDataHandler);
}
}
in target monitoring tool i get traces
switching do data state
Now in data mode
but the trace from fcmDataHandler never shows up am i missing something?


#15

Your data probably never reach the module. How do you send them? Are you sure that you’ve enabled UART2, that you’ve set it up at the right speed, etc.? You should test your program on UART1: UART2 misses some flow control wiring, which makes it unusable by some serial ports.


#16

well i don’t send it i was told that after ADL_FCM_EVENT_V24_DATA_MODE it should arrive in my datahandler function but this function is never called


#17

Your data handler function is called every time data is received. If you send no data to the UART, there’s nothing to handle, hence no point calling the handler. The idea is:

  • the control handler deals with all events describing the state of the port

  • the data handler deals with data arriving to the port in data mode


#18

ok then how do i send the data from my external gsp so i receive it and be able to use it ? if you look at my code you can see that i subscribe to fcm and switch uart2 to data mode after this i don’t know what to do to get the gps data .


#19

how do i send the data from my external gsp ?

Read your GPS manual. And try it on UART1 if it keeps failing on UART2, because of UART2’s incomplete wiring.


#20

i tried it with uart1 to like this
/**************************************************************************/
/
Local variables /
/
**************************************************************************/
u8 fcmHandle;

/**************************************************************************/
/
Local functions /
/
**************************************************************************/
bool fcmControlHandler(adl_fcmEvent_e event){
TRACE (( 1, “fcm control handler event %d”,event ));

if (event==ADL_FCM_EVENT_FLOW_OPENNED){
adl_fcmSwitchV24State(fcmHandle,ADL_FCM_V24_STATE_DATA); //swicth to data state 
TRACE (( 1, "switching do data state" ));
}
if (event==ADL_FCM_EVENT_V24_DATA_MODE){    
TRACE (( 1, "Now in data mode" ));
}

}
bool fcmDataHandler(u16 DataLen,u8 *Data){
TRACE (( 1, “fcm data %d”,*Data));
adl_atSendResponse ( ADL_AT_UNS,“some data received”);
}

/*******************************************************************/
/
Function : adl_main /
/
-------------------------------------------------------------------------
/
/
Object : Customer application initialisation /
/
/
/
-------------------------------------------------------------------------
/
/
Variable Name |IN |OUT|GLB| Utilisation /
/
--------------------±–±--±–±---------------------------------------
/
/
InitType | | | | Application start mode reason /
/
--------------------±–±--±–±---------------------------------------
/
/***************************************************************************/

void adl_main ( adl_InitType_e InitType )
{
TRACE (( 1, “Embedded Application : Main” ));

if (adl_fcmIsAvailable(ADL_FCM_FLOW_V24_UART1)==TRUE) //check if uart1 is available
{
fcmHandle=adl_fcmSubscribe(ADL_FCM_FLOW_V24_UART1,(adl_fcmCtrlHdlr_f)fcmControlHandler,(adl_fcmDataHdlr_f)fcmDataHandler);
}
}