LC29H ML1220 battery - how do I now it is working?

I’ve recently bought a LC29H Pi hat and I have a used rechargeable battery that I’ve put in it. Simple question: how can I tell if the battery is working? (other than looking at the battery with a volt meter I mean). Looking at the output of cgps I don’t see a lot of difference in how long it takes to start reporting data after powering up the Pi. What indication should I look for to confirm that the battery is being used? thanks. (btw I’m just using it as a standard gps unit at the moment with gpsd, I haven’t done anything with the RTK stuff yet)

What I’ve done in the past, in almost the exact same scenario, is boot up the Pi with the GNSS attached, the battery removed, and the antenna disconnected. If you have a good skyview it’ll probably get a lock before the Pi finishes booting and you get into cgps or gpsmon. If the antenna is disconnected you can control when the GNSS is able to start actually looking for SVs.

So - boot the Pi + GNSS with no battery and no antenna, then start up cgps and attach the antenna, time how long it takes to get a lock. Then once it gets a lock, put in the battery, shut down the Pi, and unplug it (unplug it to make sure the power is completely removed from the GNSS). Disconnect the antenna again, boot it back up, open cgps, then attach the antenna and time how long it takes to get a lock - if the battery did its job, it should get a lock within less than five seconds.

I hope this helps!

Thanks. That’s the sort of solution I was afraid I would have to work towards - I was hoping there was something more direct available such as reading saved data out of battery-backed RAM, but I guess something like that just doesn’t exist. Thanks for thinking through the details. I’ll give it a try. There is one mild problem though - it’ll be hard to insert the battery into a running system. I guess I can find a GPIO ribbon cable and move the GPS hat away from the Pi so I can have access to the underside of the hat, because there’s no way I can squeeze my fingers into the gap the way it’s normally mounted. Either that or relocate the battery away from the socket with a couple of wires… yeah, that might be easier since I’ve no idea where my Pi ribbon cable has got to…

Before you start modifying your hat, here’s an example of how you can run the tests without putting a battery into a running system, it’s just a few more steps.

  1. Boot the system with no battery, antenna disconnected
  2. Send the cold start command $PQTMCOLD*1C which will reboot the module without time, location, almanacs, or ephemerides
  3. Log in, start up cgps -s, connect the antenna, and time how long it takes to get a lock. If you wanted to get an average baseline this would be easy to do multiple times - disconnect the antenna, send the cold start command, reconnect the antenna, etc.
  4. Take the setup apart, add the battery
  5. Connect the antenna, start it up
  6. Wait for the almanacs and ephemerides to be received from the satellites. I don’t think there is any way to tell when this is complete on these modules. They take approximately 12.5 minutes to be completely received, and are sent on a constant cycle, so 15 minutes should be safe.
  7. Turn off the unit, disconnect power and antenna.
  8. Boot the unit, wait for it to start, open up cgps -s
  9. Attach the antenna and time how long it takes to get a lock. If the data was retained by the battery, it should lock up very quickly.

If you want to get really fancy, you can also experiment with a warm start ($PQTMWARM*11) where only the position, time, and almanac are retained.

Also, if you’re not familiar with the sending commands to the unit from within linux, one really easy way to do it is to echo them directly. gpsd will have to be stopped to do this.

echo -en '$PQTMCOLD*1C\r\n' > /dev/ttyAMA0

This is a good brief explanation of almanacs and ephemerides: https://novatel.com/support/known-solutions/gnss-ephemerides-and-almanacs

1 Like