Where do I start from to get GPS data transfered via UART on WP7502 using mangOH red?

Hi, Im fairly new to these systems so can you provide me with right direction to where to start from ? I have installed devloper studio and have ran some basic example programs to print some values etc but I find myself stuck here! So where should I start to learn to build my application?

my current requirement is as follows
I need to acquired GPS data and send it through UART port of Rpi header repeatedly.

Hey @hitheshkaranth,

My suggestion would be to dig into some sample code and documentation. I’ve prepared a tiny list that should get you going.

Hi @nick

Thanks for suggesting so many docs to start with and I have been successful in acquasition of position using one of the sample codes however the code doesnt give the co ordinates on a real time basis. I suppose its stuck there with the co ordinates once it gets at the startup I did go through documentation and figured out that my location acquasition command ie “le_pos_Get3DLocation()” works in retriving the location status of the pre acquired co ordinates and doesnt initiate with new co ordinates.

So I went with another commad “le_pos_sample_Get2DLocation()” i do get an error as follows
the full used command being “le_pos_sample_Get2DLocation(le_pos_SampleRef_t,latitudePtr,longitudePtr,horizontalAccuracyPtr);”
the error being

too few arguments to function le_pos_sample_Get2DLocation() //But I have adjusted pointers as per docs provided.
expected expression before le_pos_SampleRef_t // Even is I try to add an expression here it rejects.
add a break point

Im new to this field any help would be appresiated

if the above command doesnt provide the location co ordinated on a moving platform which is my requirement what should I use to obtain it ?

Thanks in advance.

Hey @hitheshkaranth,

If you compare your call to the call signature for le_pos_Get3DLocation in the API docs, you’ll see you need to pass a total of 5 arguments instead of just 4.

If you want this updated in real time, you’ll need to poll it using a timer/loop/thread. I have some sample code that shows how this can be done between processes: https://github.com/brnkl/mangoh-gps-monitor. You could also consider binding a handler function for movement using something like le_pos_AddMovementHandler.

Going forward, please try and provide as many code samples as possible when asking questions. It really helps us give quality answers as it’s difficult to understand a situation with only one line of code.

Cheers!

Hi @nick

In accordance to your suggestion I went in for running the resources you provided and ran into the follwing error.

It seems that util.h library remains undetected and throws an error “fatal error:util.h no such file or directory”
follwoed by “type le_posCtrl_ActivationRef_t could not be resolved”

How can I resolve this issue ?

Hey @hitheshkaranth,

There is a problem with your util dependency. I’ll sort this out with a git submodule by the end of the day. Sorry for the confusion.

Cheers!

Hello again,

I’ve update the repo and included some instructions/recipes for building. Let me know if you’re still having issues.

Cheers!

Hi @nick,

Thanks for the update although I did get it running without util.h latter that day. However thanks for you gracious support.

Now that the GPS acquasition is take care of thanks to you.Can you help me with the UART on pin 10,8(CN307) for transfering the co ordinates ?

Hey @hitheshkaranth,

The first step is to configure one or both UARTs on your chip to be available to user space apps. This is discussed here: Need Information On UART.

I got tired of running these commands by hand all the time, so I built a small app to configure things for me: https://github.com/brnkl/cf3-config

This app uses the same API (le_tty) that you will need to communicate with your UART. In this app I use the device at /dev/ttyAT (the modem in the WP chip), but your UART device will show up as either /dev/ttyHS0 or /dev/ttyHSL (UART1 and UART2, not certain which is which).

Hopefully this is helpful,
Cheers!

Hi @nick,

Thanks for replying, Im bit cofused on how to use the PIN 10,8 on CN307 for UART I have read and performed the above steps yet the question remains the same! How to get PIN 10,8 working as UART?

Plus it came with 2 errors (the code in the git repository you sent)

Multiple markers at this line - ‘for’ loop initial declarations are only allowed in C99 or C11 mode - use option -std=c99, -std=gnu99, -
std=c11 or -std=gnu11 to compile your code

‘for’ loop initial declarations are only allowed in C99 or C11 mode

Hey @hitheshkaranth,

I believe that error is an issue with the way you’re compiling it. I included a Makefile that includes a recipe for the WP85.

In terms of the physical UART connection, I’m not certain how to get at this one. I sifted through the circuit drawings, and it seems they refer to this UART as UART0_TX_EXP and UART0_RX_EXP. @asyal, would you be able to comment on how this connector relates to UART1 and UART2 on the actual WP series chips?58%20AM

@Alex got this working here:

Hi!! See my post on how I got this working with AT commands. Looks like you can get the GPS information with AT commands using AT!GPS, etc. I am using a WP8548 and HL chip, and not the WP 7502. I am not running any special code on the WP chip for the purpose of cellular function. I am not sure what you need to do for GPS (if all that you are wanting is to get GPS positioning). This document will help: https://source.sierrawireless.com/resources/airprime/software/airprime_wpx5xx_wp76xx_wp77xx_at_command_reference/

Let me know if you have any questions getting the RPi connector to work. Maybe start out just trying to send an “AT\r” and once you get that working, you can send the !GPS commands. My company’s project, I will be using an HL for cellular data and an Airprime XM1110 for GPS positioning.

@asyal @Alex @nick

My setup as of now >>>>

USB to serial converter where I have connected Tx,Rx(of USB-Serial converter) to (10,8)of CN307 aka Rpi compatible header.

Question >>

Does uartMode set 1 app //set the UART0 which is at 10,8 ?
If yes why is there no output at the hyper terminal connected to USB-Serial converter on CN307 pin 8,10 ?
If no where can I enable it ?

NOt sure how you have it setup, but make sure a ground is connected too. If you are able to hook up the module to hyperterminal and send AT commands directly to it via USB, make sure the AT mapping is correct. Use at!mapuart to check this. If all that checks out , best to probably scope it and see what is going on.

Hi @Alex

as of usb-uart is concerened I have set it as follows >

Pin 8 (CN307) to Rx pin of USB UART

Pin 10(CN307) to Tx pin of USB UART

Pin 25(CN307) to ground of USB UART

Baudrate is set for 115200

That should be it. If you are getting no responses , try tying CTS and RTS together on the WP chip. I did this via the IOT connector breakout board.

Hi @Alex

Thanks for replying, I did try shorthing CTS and RTS (pin 14,15) on IOT0 but ended up with no result again!

Do you have a scope ? If so I would see what is going on.

Another thing that you can do on a WP module is to convert the second UART(UART2) into a AT port.
https://source.sierrawireless.com/resources/legato/howtos/customizeuart/

So basically, this means rather than using Rpi connector (UART1) , you can get the AT out from the USB connector on the board but you lose the console capability which maybe ok for quite a few use cases.