Data from uart to gprs

I have a wavecom modem with q24pl001 module.I need the data come through the moden to the device connected to UART and to get the answer back.I can do this by the sequenc of AT commands:
at+wopen=1 //1 time
at+cgdcont=1,“IP”,“internet”
at+cgatt=1
at+cgact=1,1
at+wipcfg=1
at+wipbr=1,6
at+wipbr=2,6,11,“internet”
at+cgdata=1
at+wipbr=4,6,0
at+wipcreate=3,1,2000,1,1
at+wipdata=2,1,2
But I need to programm the modem to restore its work after deenergization.I tried to use adl_atCmdCreate() function and I execute it for each command in cycle untill the handler parameter returns OK,but the problem is that when I reach WIP commands the function can’t work with them,I dont get OK answer.Can anyone explain why?And if its possible hit me upon an idea how to realise this.Very appreciate source code.

The Q24 is very old - what Open-AT version does it have?

In that version, does adl_atCmdCreate() actually support running custom AT commands - such as the AT+WIP commands :question:

Yes,is supports adl_atCmdCreate() with common commands like cgatt,cgact but not with wip ,and I dont know what to do now.I downloaded from the archive archive.sierrawireless.com/Default.aspx?Folder=\AirPrime\Open_AT_SDK_All_devices\ this version Wavecom Open AT SDK v3.19.exe Open-AT version is 3.14.
Here is the matching table sea.com.ua/news/view737.html.
I also downloaded Wavecom Open AT Software Suite v2.20.exe because it has M2M Studio and while criating an open at project in it I imported the Firmware and others from v3.19

You have to use the WIP library API calls - not AT commands.

I know how to exchnge data with tcp/ip stack without at commands.But cant find how properly to recive and send data to uart.This series does not support Open uart.I think it’s somehow using FCM but all my efforts were failed yet.If itry to initialize tcp/ip and to subscribe the uart1 flow ,something goes wrong and i dont connect to the net(dont get ip):? :confused: :confused:

Yes, you will need to use FCM.

It is definitely possible to use FCM and WIP at the same time.

Do you have FCM working without WIP :question:

Couldnt you help me with my code?I wrote only main handlers after all have been initialised.
Or explain please what is the differance between AT and data modes.Does it mean that if I send for example
adl_fcmSendData(Handle, “at\r\n”,sstrlen(“at\r\n”)); in at mode ,the modem should understand it like at command?
I tried of course but it didnt work=(

...
//The driver calls over a transducer connected to UART.
//---------------------------------------------------------------------
bool fcmCtrlH ( adl_fcmEvent_e event ){
      switch(event){
      case ADL_FCM_EVENT_FLOW_OPENNED:{
            adl_fcmSwitchV24State(Handle, ADL_FCM_V24_STATE_DATA);
            break;
      }
      case ADL_FCM_EVENT_V24_DATA_MODE:{
            adl_fcmSendData(Handle, buffer,sizeof(buffer));
            break;
      }
      default:
            break;
      }
      return TRUE;
//------------------------------------------------------------------
bool fcmDataH (u16 DataLen, u8 * Data){
     if(buf){//buf is a pointer
          free(buf);
          buf  = NULL;
     }
     buf = (char*)malloc((int)DataLen);
     strcpy(buf,Data);
     flag = TRUE; 
     adl_fcmUnsubscribe(Handler);
      free(buf);
     return TRUE;
}
....
//---------------------------------------------------------------
static void evh( wip_event_t *ev, void *ctx) { 
  switch( ev->kind) {

  case WIP_CEV_OPEN: {
    wip_debug ( "New client connected.");
    break;
  }
  case WIP_CEV_READ: {
    wip_debug ("Some data arrived.");
    wip_read(ev->channel,buffer,sizeof(buffer)); //buffer is a static array
    Handle=adl_fcmSubscribe(ADL_FCM_FLOW_V24_UART1,fcmCtrlH, fcmDataH);
    while(!flag);
    flag = FALSE;
    wip_write( ev->channel, buf,strlen(buf));

    wip_setCtx( ev->channel, ctx);
    wip_close( ev->channel);

    break;
  }
  default:
	break;
  }
}

AT Mode is when data coming into the port is routed to the AT Command Processor, and the AT Command Processor’s responses are sent out to the port.

Data Mode is when when data coming into the port is routed to your application, and your application’s output is sent out to the port.

Clearly, you want Data Mode

Pretty sure there was an example in the SDK?

There’s an example here: https://forum.sierrawireless.com/t/simple-uart-echo-program/4739/1

I tried an example,and now I have the ony problem,I can read and write data using TCP and i can write data to UART ,but I cant read the correct data from UART.I know the response which I have to get from the transducer sending a special string,and now i receive just a piece of it.It is about 100 characters and I get up to 10.Connecting directly to the computer and using terminal I get the full responce.What could it be?Mabe some setting of FCM I dont know?
I also tried to change the return value of the handler to FALSE ,I read in a manul this way it will not clear the data buffer untill it is overflowed(and then will work HFC),but the answer was the same.

static bool EvhDataUart1(u16 datalength, u8 *data){
   s8 error;
   ....
   return TRUE;
}

So,without the TCP, can you read the correct data from UART :question:

You won’t get all 100 characters in one go - they will arrive as smaller “chunks”

https://forum.sierrawireless.com/t/faq-forum-wiki/3491/35