Home › Forums › Forums › Technical Support for BerryGPS-GSM › Configure GPS so NMEA pipes through USB on Boot
- This topic has 3 replies, 2 voices, and was last updated 2 years, 5 months ago by automocpy.
- December 19, 2020 at 10:13 am #16502
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?
LucasDecember 19, 2020 at 12:19 pm #16503
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?
ThanksDecember 21, 2020 at 8:04 pm #16504Mark WilliamsKeymaster
To have it stream on each boot;
1.Create start-up script
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
Mark --OzzMaker.com --December 22, 2020 at 5:37 pm #16507
This worked great – thanks for the help. I added in this command as well:
- You must be logged in to reply to this topic.