wip_bearerStart() return -26

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 );
}

For a start, have you looked-up the meaning of -26 as a return value from wip_bearerStart :question:

I see in documentation. Possible return values is

WIP_BERR_OK_INPROGRESS -27
WIP_BERR_BAD_HDL -24
WIP_BERR_BAD_STATE -28
WIP_BERR_DEV -29

-26 is a bug

Hiya,

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:

  1. Create new project based on WIP http_get sample application
  2. Change the GPRS logon and APN details to those required by your ISP and compile application in Target mode
  3. Reflash module firmware (or erase application) using DWLWin
  4. Download compiled application to modem and start with AT+WOPEN=1
  5. First time the application runs, wip_bearerStart will return -26
  6. Reboot module using AT+CFUN=1
  7. 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…

See also viewtopic.php?f=16&t=2947&p=10768#p10768 for an earlier post on this topic and some responses.

ciao, Dave

Unfortunately, this is all too often true - but, in this case, it is documented in the PDFs that I have:

[attachment=0]berr_codes.gif[/attachment]

Yes

Yes :angry:

My code work on older version of OS and WIPSoft. In new version return this wrong code.

wip_bearerStart() have only one parameter. This is brear parameter. It is not worng.

In documnetation for this function,i see in section “Return Value”,there is only 4 possible values:

WIP_BERR_OK_INPROGRESS -27
WIP_BERR_BAD_HDL -24
WIP_BERR_BAD_STATE -28
WIP_BERR_DEV -29

I debug my aplication on RTE. I not test in target mode.