Configure GPS so NMEA pipes through USB on Boot

Home Forums Forums Technical Support for BerryGPS-GSM Configure GPS so NMEA pipes through USB on Boot

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16502
    automocpy
    Participant

    Hello,

    I’d like to configure my rPi such that on every reboot, data automatically flows through the ttyACM3 serial port. My guess that the best way to do this is to write a script/service that calls the commands in https://ozzmaker.com/how-to-access-gps-nema-sentences-through-usb-on-the-berrygps-gsm/ on startup, similar to the way the ppp connection on boot is created.

    I’ve found that I have to reconfigure the GPS such that it pipes data through ttyACM3 on each boot.

    Is there already a way to do this?

    Thanks,

    Lucas

    #16503
    automocpy
    Participant

    And a follow up question to this. I’m trying to stream GPS data to intialstate.com per https://ozzmaker.com/real-time-gps-tracking-with-a-raspberry-pi/. Currently the stream is showing all data points as zero or nan, however I can pull valid GPS data through my own script. Here’s what GPSTracker.py outputs:

    pi@automocpi:~/tools/gps_tracker $ python GPSTracker.py
    GPS –> CPU time-> 17:15:10.997459 lat 0.0 lon 0.0 speed nan

    Is there a way to point the script to look at /dev/ttyACM3?

    Also – the script is hanging after I Ctrl+C it, is that normal?

    Thanks

     

    #16504
    Mark Williams
    Keymaster

    To have it stream on each boot;

    1.Create start-up script
    nano ~/GPSthroughGSM.sh

    2.Places your commands in the script. (You can echo the commands to the GSM com ports)
    Add a sleep command at the start to allow the Pi enough time to boot.

    #!/bin/sh
    sleep 10
    echo -e "AT+UGRMC=1\r\n" > /dev/ttyACM1
    echo -e "AT+UGGLL=1\r\n" > /dev/ttyACM1
    echo -e "AT+UGGSV=1\r\n" > /dev/ttyACM1
    echo -e "AT+UGGGA=1\r\n" > /dev/ttyACM1
    echo -e "AT+UGPRF=1\r\n" > /dev/ttyACM1

    3.Change the permissions on the script
    chmod +x ~/GPSthroughGSM.sh

    4.Open rc.local, this is where you will tell the script to run on each boot
    sudo nano /etc/rc.local

    5.Right before exit 0 at the bottom enter in the location of your script with ‘&’ at the end so it doesn’t block startup
    /home/pi/GPSthroughGSM.sh &

    6. Reboot

    Mark --OzzMaker.com --

    #16507
    automocpy
    Participant

    This worked great – thanks for the help. I added in this command as well:

    AT+UGPS=1,1,67

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Blip, blop, bloop…