Home › Forums › Forums › Technical Support for BerryGPS and BerryGPS-IMU › GPS settings are _not_ persistent!!!
Tagged: GPS configuration
- This topic has 2 replies, 2 voices, and was last updated 1 year, 11 months ago by Michael Sacarny.
- AuthorPosts
- October 21, 2021 at 3:12 am #17045Michael SacarnyParticipant
What I wanted to do was configure the GPS permanently for 5 Hz sampling and 57,600 baud. That way, GPSD could be configured to start at boot time, set system time, and produce info for my GPSD client. However, the settings on the UBlox in the BerryGPS-IMU V4 are not saved by any command I could find. I suspect this is due to the lack of flash on the UBlox CAM-M8 chipset. Settings may survive a warm reboot, but not a cold restart.
In the end, I set baud and sampling rate in a boot script, which then started GPSD. This took me several rather frustrating days to work out. I think the lack of persistent settings of the GPS should be made more clear in the documentation. Also, the ability to make settings persistent would make cleaner designs possible.
October 21, 2021 at 12:37 pm #17046Mark WilliamsKeymasterHi Michael
You are right, none of the settings are kept as the GPS module has no flash.
Ill update our documentation to clearly state this.
I can also create a guide on how to set it on boot. So i don’t have to “reinvent the wheel”, are you able to share what you did?
Mark --OzzMaker.com --
October 23, 2021 at 5:43 am #17053Michael SacarnyParticipantMark,
I’ll outline it here, but an easier alternative would have been if gpsctl worked as stated. Although the -s command changes gps baud rate, I could never get the -c command to change sampling rate. Any help on tracking down that problem would be worthwhile, as that would result in a simpler, cleaner scripting solution.
What I ended up doing is letting gpsd boot up at start time as is the usual case. However, I make sure a gps configuration service runs first:
- Create gps_config.sh shell script to set gps baud and sample rates:
<p style=”margin-left: 40px;”>
#!/bin/bash
stty -F /dev/serial0 9600
echo -e -n "\xB5\x62\x06\x08\x06\x00\xC8\x00\x01\x00\x01\x00\xDE\x6A" > /dev/serial0
echo -e -n "\xB5\x62\x06\x00\x14\x00\x01\x00\x00\x00\xD0\x08\x00\x00\x00\xE1\x00\x00\x07\x00\x03\x00\x00\x00\x00\x00\xDE\xC9" > /dev/serial0
stty -F /dev/serial0 57600- Make script executable: sudo chmod u+x /path/to/script/gps_config.sh
- Create a gps_config.service file in /etc/systemd/system as follows:
<p style=”margin-left: 40px;”>
[Unit]
Description=Configures gps sampling and baud rate for gpsd service.
[Service]
Type=simple
ExecStart=/bin/bash /path/to/script/gps_config.sh
[Install]
WantedBy=multi-user.target- Set privileges: sudo chmod 644 /etc/systemd/system/gps_config.service
- Enable service: sudo systemctl enable gps_config.service
- Copy /lib/systemd/system/gpsd.service to /etc/systemd/system
- Edit /lib/systemd/system/gpsd.service:
Add to [Unit] section: After=gps_config.service
After reboot, gpsd will start after gps has been configured. PPS synchronizes ntp as expected and gpsd clients are serviced as usual.
- AuthorPosts
- You must be logged in to reply to this topic.