Hi.
I try to use WIPLib 310 and OS6.57g on Q24Plus modem. I cannot initialize gprs bearer in Rte. Function wip_bearerStart() return value is -26. Any idea for this problem?
typedef struct
{
const ascii * gprs_apn;
const ascii * gprs_user;
const ascii * gprs_password;
}gprs_config_t;
/***************************************************************************/
/* Function : gprs_config */
/*-------------------------------------------------------------------------*/
/* Object : Open and start the GPRS bearer. Normally, the bearer will */
/* answer IN_PROGRESS, and the initialization will be finished */
/* by the callback evh_bearer(). */
/***************************************************************************/
void gprs_config ( gprs_config_t *gprs_cfg_info,void (*callback_f)(int) )
{
int r;
ascii *p;
GPRS_DEBUG_SEND_DBG_INFO("gprs_config()",0);
/* Initialize the stack */
r = wip_netInitOpts(
WIP_NET_OPT_DEBUG_PORT, WIP_NET_DEBUG_PORT_UART1, /* WIP traces on UART1 */
//WIP_NET_OPT_DEBUG_PORT, WIP_NET_DEBUG_PORT_UART2,
//WIP_NET_OPT_DEBUG_PORT, WIP_NET_DEBUG_PORT_TRACE,
WIP_NET_OPT_END);
_callback_f = callback_f;
r = wip_bearerOpen( &gprs_bearer, "GPRS", evh_bearer, NULL);
GPRS_CFG_ASSERT(r==0);
r = wip_bearerSetOpts( gprs_bearer,
WIP_BOPT_GPRS_APN, gprs_cfg_info->gprs_apn,
WIP_BOPT_LOGIN, gprs_cfg_info->gprs_user,
WIP_BOPT_PASSWORD, gprs_cfg_info->gprs_password,
WIP_BOPT_END);
GPRS_CFG_ASSERT(r==0);
r = wip_bearerStart( gprs_bearer );
switch ( r )
{
case 0:
case WIP_BERR_OK_INPROGRESS: // OK.
return;
case WIP_BERR_BAD_HDL:
p = "Invalid handle";
break;
case WIP_BERR_BAD_STATE:
p = "The bearer is not stopped";
break;
case WIP_BERR_DEV:
p = "Error from link layer initialization";
break;
default:
GPRS_CFG_ASSERT(0);
}
// Error on open bearer
wcu_send_error_m(r,"GPRS CFG","wip_bearerStart()",p,NULL);
_callback_f( GPRS_CONFIG_BEARER_NOT_OPEN );
}
You are better off looking through the header files for the return values, as sometimes the documentation lags the code.
-26 is WIP_BERR_PARAM - i.e. one of the parameters in your call to wip_bearerStart() is wrong. Which parameter and why is anybody’s guess…
Try running your application again (i.e. AT+CFUN=1, AT+WOPEN=1 etc) and see if the problem goes away.
I’ve got an outstanding problem logged (since early December) with my distributor (and upstream to Wavecom) about this issue.
Using the default wavecom WIP http_get sample, I can reliably reproduce this feature using the following steps:
Create new project based on WIP http_get sample application
Change the GPRS logon and APN details to those required by your ISP and compile application in Target mode
Reflash module firmware (or erase application) using DWLWin
Download compiled application to modem and start with AT+WOPEN=1
First time the application runs, wip_bearerStart will return -26
Reboot module using AT+CFUN=1
Second (and further) time the application runs, all is OK.
I can reliably reproduce this on all modules I have (Q2686G & H, Fastrack Supremes). My distributor can reproduce this on their modules. Wavecom tech support don’t seem to be able to reproduce this…