News for hackers. Stuff that matters.
Re:Find my cat: open-source Cat Tracker by demondemidi on Friday September 15, 2023 @07:26AM (#37521393)
Months of battery life with gps is impossible.

It is 20 hours in gps mode:

https://www.findmycat.io/docs/TrackerModes#summary

I have a Jiobit. It starts in ble mode and switches to gps when the cat exits a 30 m radius. It gets about 8 hours of fulll gps gsm battery life once it starts updating every 60 seconds. Normally it is 2 weeks battery life.

Note I take my cat out supervised in a large fenced in yard. He got away from me thrice over seven years. This is just a temporary safety feature now. He’s never ventured more than 100m during his getaways.

Re:Find my cat: open-source Cat Tracker by gitgud on Friday September 15, 2023 @07:38AM (#37521494)
> Months of battery life with gps is impossible.

Apple air tags last for 12 months apparently

https://www.tile.com/en-au/blog/airtag-battery-life#

Re:Find my cat: open-source Cat Tracker by wccrawford on Friday September 15, 2023 @07:47AM (#37521560)
They aren't GPS. They rely on a proprietary network of devices from one of the biggest tech giants in the world.
Re:Find my cat: open-source Cat Tracker by rplnt on Friday September 15, 2023 @09:54AM (#37522999)
That's why Apple makes it so damn hard (compared to any Android I've ever owned) to turn off Location, Bluetooth (and maybe WiFi) on their mobile devices.
Re:Find my cat: open-source Cat Tracker by binarymax on Friday September 15, 2023 @10:20AM (#37523374)
Disabling location is annoying yes (a couple levels deep in the settings) - but disabling bluetooth and wifi is at the top level and very easy to do.
Re:Find my cat: open-source Cat Tracker by rodorgas on Friday September 15, 2023 @10:35AM (#37523653)
Since iOS 11, turning Bluetooth off from the control center only puts Bluetooth on a timeout until the next morning instead of disabling it permanently, as one would expect. Even when it’s off, the antenna stays on, looking for new devices. You can turn it all the way off by digging into the settings menu, but as soon as you turn it on for any reason, the cycle starts again.
Re:Find my cat: open-source Cat Tracker by enraged_camel on Friday September 15, 2023 @01:16PM (#37526271)
I personally really like this, because 95% of the time when I turn off my Bluetooth what I’m really wanting to do is put it on pause. The times when I want to turn it off completely, I also want to turn off everything else (Wi-Fi etc.) so airplane mode (which does not time out) works great.
Re:Find my cat: open-source Cat Tracker by joshspankit on Friday September 15, 2023 @11:40AM (#37524733)
Similar to what rodorgas said about bluetooth, when you disable WiFi it’s normally “stop connecting to (currently) nearby wifi until tomorrow”. The radio doesn’t turn off and it still actively scans for other wifi to connect to (will connect 5min later at your friend’s house, for example).
Re:Find my cat: open-source Cat Tracker by hackmiester on Sunday September 17, 2023 @01:15PM (#37547301)
I definitely think it’s inexcusable that the control center buttons are so misleading, but at least “Hey Siri, turn off Bluetooth” (or Wi-Fi) really does it.
Re:Find my cat: open-source Cat Tracker by h1fra on Friday September 15, 2023 @10:42AM (#37523780)
I don't know much about GPS, but I always assumed it was a passive tech. What is consuming battery in that case?
Re:Find my cat: open-source Cat Tracker by krisoft on Friday September 15, 2023 @10:56AM (#37524024)
It is a lot of work to acquire and track the signals and this is often implemented in software. And then afterwards it takes a lot of work to calculate the navigational solution from these raw measurements.

This basically keeps a microprocessor busy which uses energy.

One trick people do for ultra-low energy non-realtime GPS tracking of wildlife is to store the “raw” radio samples and do as little processing on the tracking device as possible.[1] Then once the tracker gets back they batch process all the samples recorded and reconstruct where the animal has been. That is obviously a tradeoff of more storage used for less energy consumption. Obviously that trick does not work if you want to know where the animal is live, it can only tell you where it has been once you have processed the data.

1: https://arxiv.org/abs/2207.06310

Re:Find my cat: open-source Cat Tracker by joshspankit on Friday September 15, 2023 @11:37AM (#37524678)
Are there no hobby-level GPS chips that do hardware decoding?
Re:Find my cat: open-source Cat Tracker by krisoft on Friday September 15, 2023 @12:00PM (#37525087)
What do you mean by "hardware decoding"? There are custom chips which do the whole GNSS business. So they are doing "hardware decoding", the chip is the hardware.

I'm not aware of how all of them are implemented internally, but my understanding is that the acquisition&tracking of signals usually happens in the digital domain. Can be wrong on that of course.

Re:Find my cat: open-source Cat Tracker by joshspankit on Friday September 15, 2023 @12:21PM (#37525459)
“hardware decoding” in this case meaning “implemented at the transistor level” and more to the point: “as optimized and low-power as possible”.
Re:Find my cat: open-source Cat Tracker by iracigt on Friday September 15, 2023 @02:22PM (#37527176)
All of them I am aware of do hardware decoding of the signal and do the linear algebra to find their location in software. Speaking mostly based on the cheap ublox chips and partially open source navspark chips I've dealt with.

The problem is the signal processing part of GPS is quite computationally difficult. I think it was around 10ish years ago it even became possible to do the full real-time decoding on a laptop. At startup, you need to find the GPS signals. This means searching for all 32 possible satellite code patterns across the range of possible Doppler shifts. During testing, this was what took most of the startup (cold start) time. You need roughly 4-6 of them to get a position, so this has to be done in parallel. Once you've found the satellite it takes another 30 seconds to get the satellite position. GPS signals are very slow at 50 bits/sec.

By comparison, actually solving for location is a simple linear algebra problem with 4 unknowns (lat, long, alt, time; but in a more convenient coordinate system). You only do this a few times per second. The hardware does the higher rate signal phase estimation. For example the navspark is a single core SPARC microcontroller running at 100MHz with 200 kB of RAM. That's enough to do 50 solutions per second, though they reduced that to 10 Hz to make space for a user program too.

A ton of work goes into caching strategies to narrow down that initial search space. Modern chips will let you load in exactly which satellites to expect overhead (e.g. based on position and orbit info from cell network). There is a whole other caching strategy based on a approximate "almanac" in the GPS signal for offline devices. With all of that known before the receiver turns on, you can get a solution in a couple seconds.

Re:Find my cat: open-source Cat Tracker by h1fra on Friday September 15, 2023 @11:04AM (#37524165)
Ah I see, the continuous tracking is the culprit here. Thanks
Re:Find my cat: open-source Cat Tracker by OmarShehata on Friday September 15, 2023 @11:58AM (#37525052)
> Obviously that trick does not work if you want to know where the animal is live, it can only tell you where it has been once you have processed the data.

why can't you just forward those radio samples back, and process that on the receiver end (your phone), vs processing on device and sending back the location?

It should be a tradeoff of less battery consumption on device, and no need for large storage, at the expense of a lot more bandwidth? Would having to send all the raw samples consume more or less battery than just processing it and sending the result?

Re:Find my cat: open-source Cat Tracker by krisoft on Friday September 15, 2023 @12:11PM (#37525280)
> It should be a tradeoff of less battery consumption on device, and no need for large storage, at the expense of a lot more bandwidth?

Yes. I believe so.

> Would having to send all the raw samples consume more or less battery than just processing it and sending the result?

Good question. I don't know the answer to that. Maybe someone can chime in?

What would be interesting if you could send a "ping" signal to the tracker and it only start sending samples back then. After all most of the time you don't need to know where the cat is, only when it is "overdue" and the owner starts worrying.

Re:Find my cat: open-source Cat Tracker by dhosek on Friday September 15, 2023 @02:04PM (#37526913)
One of the things I found initially surprising (but less so when I thought about it), was that when I switched from wired headphones to bluetooth, I got longer battery life from my phone. Apparently, there’s less energy involved in sending a radio signal than in driving a speaker.
Re:Find my cat: open-source Cat Tracker by iracigt on Friday September 15, 2023 @02:46PM (#37527522)
The "chip rate" of GPS L1 C/A (the main one) is 1023 kchips/sec. So you end up with a signal that is over 1 MHz wide to encode 50 bits/sec. Nyquist-Shannon theorem says* you thus need over 1 Msamp/sec (using complex numbers), probably more like 2 Msps because of Doppler, to capture that. GPS is pretty forgiving and 4 bits/sample is plenty (2 bits is usable), but that would still be 1 MB/s of high entropy data. Note the system linked in the parent comment only records in 12 ms bursts. That captures enough info to find position offline, but only if you add in the historical orbit information that normally takes 30 sec to download off of the GPS signal. Streaming 1 MBps of data is doable, but I think would draw much more power than solving on device. Just recording to an SD card is far less.

* The Nyquist-Shannon theorem actually says the converse, but for anything you'll encounter outside the recesses of a math department, it's still the optimal solution.

Re:Find my cat: open-source Cat Tracker by lxgr on Friday September 15, 2023 @03:17PM (#37527903)
I'd guess that it would take more energy to send all of the samples to a central server over an IoT network (which are optimized for infrequent, very small messages) than to calculate a position fix locally.

Maybe it might be worth it for a complete "from scratch" GPS fix (where the receiver needs to figure out where it approximately is and needs to re-download the complete GPS almanach and ephemerides), though – I have no idea how short a server-side-decodeable sample actually is!

But since we're talking about a network-connected device anyway, I'd guess that downloading the ephemerides via the IoT connection (single-digit kilobytes) would be much more economical in that case too.

Maybe as an analogy, consider local vs. cloud QR code decoding: If you can manage to send a single, shart photo of the code, the cloud might be better, but since you can't actually be sure when the camera is pointed at the code and not moving, you might need to take a minute-long video, and look for the one non-blurry frame on the cloud.

Edit: Just saw the other comment – apparently we're talking about a short video moreso than a small JPEG :)

And here's an interesting research paper on the topic: https://www.microsoft.com/en-us/research/wp-content/uploads/...

Re:Find my cat: open-source Cat Tracker by lozenge on Friday September 15, 2023 @04:06PM (#37528480)
Sending to your phone via the cell network? That will be a lot of battery usage.

Sending to your phone via radio? If the phone is in range you don't need GPS. You can use UWB or an audible beeper to find the cat.

Re:Find my cat: open-source Cat Tracker by solardev on Friday September 15, 2023 @12:44PM (#37525821)
Really? It's the math that's power hungry, not something to do with the antenna or whatever...? I'm surprised.
Re:Find my cat: open-source Cat Tracker by ilyt on Friday September 15, 2023 @01:29PM (#37526429)
RF part is also power hungry; the chip they use for example uses 15mA during receiving.
Re:Find my cat: open-source Cat Tracker by FridayNightTV on Friday September 15, 2023 @05:09PM (#37529162)
I'm surprised you think otherwise.

"Ordinary" antennas are completely passive, just a bit of metal. It's the maths for data recovery and trilateration (not triangulation!) that is processor heavy.

Re:Find my cat: open-source Cat Tracker by solardev on Friday September 15, 2023 @07:30PM (#37530340)
It's the "RF chip" from the other reply I'm curious about. What is it doing when it's in active receiving mode? Is it doing the math on the chip?
Re:Find my cat: open-source Cat Tracker by krisoft on Sunday September 17, 2023 @04:33AM (#37542816)
You can buy chips which only do the RF tasks. But you can also buy chips which do “everything”, the RF, the maths, some even do sensor fusion with data from accelerometers and wheel odometry sensors. All in one chip.

You can read here[1] more about what the RF frontend does. This is the crux of it: “Its two-stage receiver amplifies the incident 1575.42MHz GPS signal, downconverts it to a first IF of 37.38MHz, further amplifies it, and then downconverts to a second IF of 3.78MHz. An internal 2- or 3-bit ADC (selectable as a 1-bit sign with a 1- or 2-bit magnitude) samples the second IF and outputs a digitized signal to the baseband processor.”

1: https://www.analog.com/en/technical-articles/rf-frontend-ic-...

Re:Find my cat: open-source Cat Tracker by solardev on Monday September 18, 2023 @01:00PM (#37558798)
Thanks for this! It's interesting that the article says doing it in software can be more power efficient than having a dedicated chip for the intermediate frequencies. Does that mean there exists "dumber" RF chips that do less, offloading the math to the main CPU for power savings? It seems like the kinda thing that would be commonplace if so...?

I guess my fundamental confusion is why "listening" to a broadcast signal takes so much power, vs say a FM receiver or passive wifi snooping.

Re:Find my cat: open-source Cat Tracker by ilyt on Friday September 15, 2023 @01:21PM (#37526340)
The fact GPS satellites are 20k km away

Weak signal, small antenna, high gain, lots of current to run amplifiers. And you need to keep receiving signal to get the position, not just enable it for a second then disable

Re:Find my cat: open-source Cat Tracker by dboreham on Friday September 15, 2023 @03:22PM (#37527987)
It's not passive. There's a bunch of DSP on the RF plus regular CPU on computing the location from the demo demodulated signals. 32-bit CPU.
Re:Find my cat: open-source Cat Tracker by e44858 on Friday September 15, 2023 @03:23PM (#37527991)
You also have an LTE modem transmitting the GPS coordinates to the cell tower.
Re:Find my cat: open-source Cat Tracker by dreamcompiler on Friday September 15, 2023 @06:50PM (#37530027)
GPS receivers are passive only in the sense that they don't transmit. But pulling a meaningful signal from a 25W transmitter 20,000 km away requires some seriously power-hungry signal processing. It's an engineering miracle that it works at all.
Re:Find my cat: open-source Cat Tracker by paxys on Friday September 15, 2023 @11:33AM (#37524615)
It is not impossible if the GPS is off by default. Battery life is 20 hours only in "lost mode", aka when the location is being updated every 30 seconds. If you don't need that, and are okay with updates on demand, it can last a year.
Re:Find my cat: open-source Cat Tracker by demondemidi on Friday September 15, 2023 @01:38PM (#37526555)
Obviously.
Re:Find my cat: open-source Cat Tracker by wussboy on Friday September 15, 2023 @02:57PM (#37527663)
It wasn’t obvious to me.
Re:Find my cat: open-source Cat Tracker by demondemidi on Sunday September 17, 2023 @01:48PM (#37547614)
I posted the table that literally said exactly OPs comment. It clear you commented without reading, which violates the good-faith covenant of this website.
Re:Find my cat: open-source Cat Tracker by 0xFF0123 on Friday September 15, 2023 @06:04PM (#37529646)
This was unnecessarily snarky in an otherwise insightful discussion.
Re:Find my cat: open-source Cat Tracker by demondemidi on Sunday September 17, 2023 @01:49PM (#37547617)
I posted the table that literally said exactly OPs comment. I have little patience for people that can’t be bothered to read yet still voice their opinions. They do not belong here.
Re:Find my cat: open-source Cat Tracker by helsinkiandrew on Sunday September 17, 2023 @04:27AM (#37542780)
20 hours for Lost Mode seems much too low. Ideally if away from home for a certain period (or if no motion is detected - I'm not sure if the device has the technology) it should go into sending out position every hour rather than 30s so it can last indefinitely - days/weeks atleast (like some vehicle trackers do)