Bearer issue with Location Plug-In


#1

Hi everyone!

I´m trying to establish a GPRS connection with a SL6087 and implementing the XM0110 with Location Plug-In.

My application works fine when running it with no Location Plug-In included (obviously without getting XM0110 reports). I mean, it connects perfectly to the server.

But when I include the Location Plug-In (it works fine, i´m getting NMEA $GPRMC sentences as I needed), the bearerOpen function responses me “WIP_BERR_BAD_STATE”. Then, I made a test code to get information about this error:

case WIP_BERR_BAD_STATE:
			adl_atSendResponse(ADL_AT_UNS, " WIP_BERR_BAD_STATE, Subscribed Bearer Name: ");
			bearerList = wip_bearerGetList();
			adl_atSendResponse(ADL_AT_UNS, bearerList->name);
			adl_atSendResponse(ADL_AT_UNS,", Type: ");
			wm_itoa(bearerList->type, btype);
			adl_atSendResponse(ADL_AT_UNS, btype);
			adl_atSendResponse(ADL_AT_UNS, "\r\n");
			break;

And I get this: “WIP_BERR_BAD_STATE, Subscribed Bearer Name: UART1, Type: 1”

It is very strange, because my hardware shares UART1 with a keypad, so I´m using a Telnet software through USB to debug using some AT responses, and before sending wopen=1 I send at+wmfm=0,0,1, so UART1 is unavailable to the application. Then, why Location Plug-In is starting a bearer in UART1 if it´s connected to UART2, and UART1 is unavailable?

And the worst issue, I couldn´t find where this Plug-In is subscribing a bearer before my application!

Anyone experienced something similar?

Thanks in advance!

Diego M.


#2

Ok, now i´m lost.

I placed the test code on the application without Location Plug-In (the one that works), and for my surprise, I get a similar result: “ADL_GPRS_EVENT_ACTIVATE_OK UART1, Type: 1”.

So, wip_bearerGetList() function seems to get that UART1 is a PPP Bearer when it´s disabled.

Reading WIP guide i realised that Bearer functions must be subscribed and handled in the main application.
I´m trying to figure out how to get it working in my app, but first I´ll make a little test.

My question is, in the Location Plug-In sample, where is the main task? As WIP guide says (if i read right), in that task I have to handle the GPRS Bearer.

Thanks in advance,

Diego M.


#3

Hi

You must make sure that your highest priority task contains your bearer. Here is a sample of the application task table I am using (on a WMP100 with XM0110).

const adl_InitTasks_t adl_InitTasks [] =
{
    { gprsBearerTask,  5120, "GPRS_TASK", 17 },
    { Task_GPS_COM,  32768, "GPS_DATA_TASK", 16 },
    { Task_GPS_CORE,  65536, "GPS_CORE", 15 },
    { Rest of application tasks follow including TCP client, FTP client, SMS, GSM and other tasks...}
}

I’m not sure about the UART1 issues.

Hope this helps.


#4

Thanks for your response Tom!

Ive been trying since a few days ago (im a newbie in multitask), and of course you are right, recently I read that, but now i realized that I didnt initiated the wip_init in main task too, now its working great! :smiley:

And about Uart1, its working too but i had a few headaches making the app work again when it messed up , so after this experience ill think twice before sharing UART1 with GPIOs…

Thank you again, best regards! :slight_smile:

Diego M.