Shop OBEX P1 Docs P2 Docs Learn Events
Receiving Parsed GPS Data Using FullDuplexSerial4Port — Parallax Forums

Receiving Parsed GPS Data Using FullDuplexSerial4Port

SteveWoodroughSteveWoodrough Posts: 190
edited 2012-11-27 18:06 in Propeller 1
What is a good way to receive parsed data from a GPS using the FullDuplexSerial4Port (FDS4) object?

When I say parsed, I mean I want to get the heading data, the speed data, long, lat etc. at my discretion.

I have experience using GPS_IO_mini to retrieve specific data from the GPS message strings, but the GPS_IO object relies on a call to FullDuplexSerial_mini lanched into a separate cog. Since I’m using FDS4 I’d rather use a port and not launch FDSMini in a separate cog.

I have a basic understanding of FDS4 object and I can open ports and successfully simultaneously send data to an LCD at 19,600 baud or the PST at 115,200 baud. I have also opened a port to receive the GPS data within FDS4. I know the port settings for my GPS data are correct since I can receive GPS data and display on the LCD from the GPS module through GPS_IO_mini while running a separate cog running FDSMini.

Clearly GPS_IO is designed to run with FDS_mini. I tried to hack my way along and modify GPS_IO but I’m out of my depth.

Thanks
Steve

Comments

  • Tracy AllenTracy Allen Posts: 6,664
    edited 2012-11-25 19:48
    Hi Steve,
    I posted a note in your earlier thread before I saw this specific question. Do take a look at Tim Moore's original OBEX object. It is embedded in a demo, gpstest.spin, which does show exactly how he parsed out the GPS data.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2012-11-25 20:51
    I attached some code where we were experimenting with a GPS-enabled MultiTech IP GPRS socketmodem. There is a command followed by a response from the GPS, which the program then parses. I don't even remember if it works, but it compiles and it looks okay in outline. It first chops the GPRMC sentence up into individual strings by substituting nulls for commas, then it creates an array of pointers to the start points of those strings, like Tim did in his program. Strangely though, and I don't recall why, it doesn't use that information for the numeric parsing but instead just goes ahead and parses the GPRMC sentence based on fixed field positions.

    If you want to use DIO4port plus FDS4port, declare both as objects, and change the numerical conversion calls from uarts.dec(...) to dio.dec(...).
  • max72max72 Posts: 1,155
    edited 2012-11-26 03:22
    I modified the GPS_io_mini to use the 4 ports FDS.
    I tried using an hard coded port, and never bothered updating the start method to allow port definition. Anyway it works..
    In the main program I simply add a port before the start method.
    uart.addport(1,4,5,-1,-1,0,%10,uart#BAUD9600) 
    

    Please find attached the modified object.
    Massimo
  • SteveWoodroughSteveWoodrough Posts: 190
    edited 2012-11-27 18:06
    Thank You all for your time and assistance. There is some really good stuff here and I appreciate you all taking the time show me where the gold lies.
    Regards
    Steve
Sign In or Register to comment.