Close
0%
0%

Paul's Items Reinvented and Then I Changed Some!

I got this idea and found some resources and followed along in some more experienced manners.

Similar projects worth following
BeagleBone Green Wireless saved my data while the SIM28 got my data and the Google Earth program allowed me to track myself. I know where I live now!

Here are some items needed...

Get the BBGW or BBG, respectively. Use the site for toptechboy.com and follow along. The groveGPS with the SIM28 should do the trick.

Oh and download the software, change it to suit your needs, and Bam!

Seth

P.S. Enjoy!

As some of you know, Python is now Python3. So, w/ this update (some time ago), I have found this source is no longer a viable option for making the SIM28 Grove Connector GPS device work on the UART2 port on the BBG. But, if you know better, be my guest. TopTechBoy is still around doing things but I have been unable to make this source work so far...

Updates on the way!

GPSDataIV.txt

This is the .txt file I had to change, without the data I collected, to .gpx format at some site. I will have to research it again. http://www.gpsvisualizer.com/convert_input?convert_output=gpx is one of those sites that produce .gpx files for people.

plain - 487.00 bytes - 10/13/2017 at 06:25

Download

SIM28andWhorterandGoogle.py

This is Paul's software he produced. I changed it a bit and got it to work with my set-up.

plain - 4.54 kB - 10/13/2017 at 06:24

Download

  • 1 × BBGW
  • 1 × SIM28 GroveGPS
  • 1 × Computer and PuTTY or Linux based Distro with SSH
  • 1 × Software from TopTechBoy.com and knowledge to change it to suit your needs.
  • 1 × Conversion software and Google Earth

View all 6 components

View project log

  • 1
    Grove Connection on UART'2' and BeagleBone Green

    Just stick the grove connector to the GPS w/ grove connector into the right grove connector on the BBG (beaglebone green). UART2!

    config-pin p9.21 uart && config-pin p9.22 uart

    That command will give you the access to UART2!

    ...

    Then...

  • 2
    Add the given source to your distro on the BBG...

    Hello,

    Please forgive me. For some reason the Python and Python3 exchange has not worked to my liking. I am going to go back to regular Python if you still run Buster and not Bullseye.

    ...

    import serial
    import Adafruit_BBIO.UART as UART
    from time import sleep
    
    UART.setup("UART2")
    ser=serial.Serial("/dev/ttyS2", 9600)
    
    class GPS:
    
        def __init__(self):
            # This sets up variables for useful commands.
            # This set is used to set the rate the GPS reports
            UPDATE_10_sec =  "$PMTK220,10000*2F\r\n" # Update Every 10 Seconds
            UPDATE_5_sec =  "$PMTK220,5000*1B\r\n"   # Update Every 5 Seconds  
            UPDATE_1_sec =  "$PMTK220,1000*1F\r\n"   # Update Every One Second
            UPDATE_200_msec =  "$PMTK220,200*2C\r\n" # Update Every 200 Milliseconds
            # This set is used to set the rate the GPS takes measurements
            MEAS_10_sec = "$PMTK300,10000,0,0,0,0*2C\r\n" # Measure every 10 seconds        
            MEAS_5_sec = "$PMTK300,5000,0,0,0,0*18\r\n"   # Measure every 5 seconds
            MEAS_1_sec = "$PMTK300,1000,0,0,0,0*1C\r\n"   # Measure once a second
            MEAS_200_msec = "$PMTK300,200,0,0,0,0*2F\r\n"  # Meaure 5 times a seconds
            # Set the Baud Rate of GPS
            # BAUD_57600 = (b"$PMTK251,57600*2C\r\n")          # Set Baud Rate at 57600
            BAUD_9600 = "$PMTK251,9600*17\r\n"             # Set 9600 Baud Rate
            #Commands for which NMEA Sentences are sent
            ser.write(BAUD_9600)
            sleep(1)
            ser.baudrate = 9600
            GPRMC_ONLY = "$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" # Send only the GPRMC Sentence
            GPRMC_GPGGA = "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" # Send GPRMC AND GPGGA Sentences
            SEND_ALL = "$PMTK314,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" # Send All Sentences
            SEND_NOTHING = "$PMTK314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n" # Send Nothing
            ser.write(UPDATE_1_sec)
            sleep(1)
            ser.write(MEAS_1_sec)
            sleep(1)
            ser.write(GPRMC_GPGGA)
            sleep(1)
            ser.flushInput()
            ser.flushInput()
    
        def read(self):
            ser.flushInput()
            ser.flushInput()
            while ser.inWaiting() == 0:
                pass
            self.NMEA1=ser.readline()
            while ser.inWaiting() == 0:
                pass
            self.NMEA2 = ser.readline()
            NMEA1_array = self.NMEA1.split(',')
            NMEA2_array = self.NMEA2.split(',')
            if NMEA1_array[0]=='$GPRMC':
                self.timeUTC = NMEA1_array[1][:-8] + ':' + NMEA1_array[1][-8:-6] + ':' + NMEA1_array[1][-6:-4]
                self.latDeg = NMEA1_array[3][:-7]
                self.latMin = NMEA1_array[3][-7:]
                self.latHem = NMEA1_array[4]
                self.lonDeg = NMEA1_array[5][:-7]
                self.lonMin = NMEA1_array[5][-7:]
                self.lonHem = NMEA1_array[6]
                self.knots = NMEA1_array[7]
            if NMEA1_array[0] == '$GPGGA':
                self.fix = NMEA1_array[6]
                self.altitude = NMEA1_array[9]
                self.sats = NMEA1_array[7]
            if NMEA2_array[0] == '$GPRMC':
                self.timeUTC = NMEA2_array[1][:-8] + ':' + NMEA1_array[1][-8:-6] + ':' + NMEA1_array[1][-6:-4]
                self.latDeg = NMEA2_array[3][:-7]
                self.latMin = NMEA2_array[3][-7:]
                self.latHem = NMEA2_array[4]
                self.lonDeg = NMEA2_array[5][:-7]
                self.lonMin = NMEA2_array[5][-7:]
                self.lonHem = NMEA2_array[6]
                self.knots = NMEA2_array[7]
    
            if NMEA2_array[0] == '$GPGGA':
                self.fix = NMEA2_array[6]
                self.altitude = NMEA2_array[9]
                self.sats = NMEA2_array[7]
    
    myGPS=GPS()
    GPSdata=open('/GPS_data/GPS.txt', 'w') # write the file but first make sure it is located in the GPS_data dir.
    GPSdata.close()
    while(1):
        myGPS.read()
        if myGPS.fix != 0:
            try:
                latDec = float(myGPS.latDeg) + float(myGPS.latMin)/60.
                lonDec = float(myGPS.lonDeg) + float(myGPS.lonMin)/60.
                if myGPS.lonHem == 'W':
                    lonDec = (-1)*lonDec
                if myGPS.latHem == 'S':
                    latDec = (-1)*latDec
                alt = myGPS.altitude
                GPSdata = open('/GPS_data/GPS.txt', 'a') # append the writen file GPS.txt in the GPS_data directory...
                myString = str(lonDec) + ',' + str(latDec) + ',' + alt + ' '
                GPSdata.write(myString)
                GPSdata.close()
            except:
                pass

    This is the update to Python3 but for some reason, it is not running right now. I will get closer to the window or go outside to run the GPS module to keep testing. Sorry for the conclusive evidence. It seems that on Python3, there are many changes that affect the output of bytes and strings.

View all instructions

Enjoy this project?

Share

Discussions

Seth wrote 03/02/2021 at 03:12 point

If you have seen where I have taken a 'left turn at Millsville,' please let me know...

  Are you sure? yes | no

Seth wrote 10/12/2019 at 02:57 point

Well...this no longer works b/c of the changes w/ Python3 as most of everyone is aware. So...blah! I will update things in time. Who knows?

Seth

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates