26 ms·
Localize your cat at home with BLE beacon, ESP32s, and Machine Learning
- ryanschneider 6y agoI’m pretty sure this is the first time I’ve seen the word “localize” used to refer to spatial location and not cultural/linguistic locale. Totally makes sense but definitely threw me off when first reading the headline. :)
- leetcrew 6y agonot technically wrong, but "locate" would be more idiomatic here. I don't think english is the author's first language.
- puzzlingcaptcha 6y agoIt's a calque from Polish, where "to locate" is "lokalizować"
- gota 6y agoI think all Latin languages as well. From "locus" meaning place.
- theschwa 6y agoLocalization is actually the common term, frequently used in robotics and autonomous vehicles. There's a really interesting field of research here [0]. [0] - https://en.wikipedia.org/wiki/Simultaneous_localization_and_mapping https://en.wikipedia.org/wiki/Simultaneous_localization_and_...
- mhh__ 6y agoIt might be a common term but I don't think it's the common term here.
- theschwa 6y agoI totally hear that. Especially if people are commenting that they were thrown off. I just wanted to make sure people knew to use this term if you're looking to learn more about the topic of this project. If anyone is looking to implement this or another method to do indoor mapping, you'll probably want to familiarize yourself with the research field of Simultaneous Localization and Mapping or SLAM.
- mikepurvis 6y agoI work at a robotics company, so we've had a perception team that manages robot localization since forever, and now that we're also internationalizing our product, there's a separate frontend team dealing with third-party localization firms to create the needed translations. :)
- singlow 6y agoYeah, _localize_ has always meant to adapt something to its location, when I've seen it used. _Locate_ means to determine the location. Edit to add: But I can see how in a specialized field, where methods for locating an object are frequently discussed, using localization over location would be useful for describing the process of finding something, since location is also a noun referring to the place itself.
- mikepurvis 6y agoWell and in the specific context of SLAM, the business of localizing is itself an adaptive and constructive process. "Locating" is what the user does when they simply tell the robot where it is on the map. Localization is building a continuous graph of your immediate surroundings and past movement history and fitting that to what is known about the environment.
- mattkrause 6y agoThere also shades of different meanings. 'Locate' implies that you're predominately interested in the object being sought but 'localize' suggests you're more interested in the place where it is/was. I think localize can also be less-than-exact if it rules out some plausible locations, but it seems odd to partially 'locate' something. It's used a lot in neurology/neuroscience for the process of identifying where (e.g.) a tumor is or the brain structures on which a particular behavior or process depend.
- w0mbat 6y agoI'm pretty sure it's actually wrong usage, and should be replaced with "Locate" in this context. "Localize" has various meanings, but in a physical location sense is to restrict something to a particular area, e.g. "We successfully localized the fire to the Johnson farm so no other farms were damaged.". I can't see a definition that is equivalent to "locate" or "find".
- mywittyname 6y agoA better title would be either: Locate your cat at home using... Or Domestic Feline location using... Depending on the level of techno-mumbo-jumbo the author is looking for.
- didymospl 6y agoI don't know what's idiomatic here as English is not my first language, but according to my dictionary "localize" can also mean "to find the position of something" https://dictionary.cambridge.org/dictionary/english/localize https://dictionary.cambridge.org/dictionary/english/localize Maybe it's British vs American English?
- w0mbat 6y agoI looked at Merriam-Webster online, the snippet Google pulls from the OED and the Mac dictionary app which uses the New American Oxford. "Locate" would lead to less confusion among readers. It unanimously has the right definition, and is a simpler word.
- MauranKilom 6y agoI think one of the reasons that one is not used because usages like "Simultaneous Location And Mapping" (instead of the "Simultaneous Localization And Mapping" that SLAM stands for) would read a bit strange... "location" is more commonly used to mean "the place" and not "the act of finding the place".
- deleted 6y ago
- Lvl999Noob 6y agoI was thinking that it would localize cat (unix command) somehow.
- schoen 6y agoThat's already been done to a great extent: $ LANG=ca_ES.UTF-8 cat asldkj cat: asldkj: El fitxer o directori no existeix $ LANG=ca_ES.UTF-8 cat --help Forma d’ús: cat [OPCIÓ]… [FITXER]… Escriu la concatenació de tots els FITXERs a la sortida estàndard. Sense cap FITXER, o quan FITXER és «-», llegeix l’entrada estàndard. [...]
- wpearse 6y agoAircraft guidance systems have localizers, too. It’s not wrong, and I would encourage the author to leave it as it is.
- danaliv 6y ago...which, funnily enough, don't tell you where you are. :)
- isbvhodnvemrwvn 6y agoIn Polish locating something is "lokalizowanie", I guess that's why the word "localize" was used.
- teddyh 6y agoI don’t want to localize my cat. I prefer subtitles.
- nix0n 6y agoThis is a cool project. But my first thought was: Input: "meow" Output: "miau"
- laurent92 6y agoI was looking at GPS localisers for walking dogs in the forest, but it’s 10-200$ + ~$7 a month. So I’m wondering whether a timer that inflates a big red balloon after 4hrs wouldn’t be the best choice.
- eeZah7Ux 6y ago...to safely fly the dog back home.
- TrueGeek 6y agoI've been using a GPS collar for a my escape artist dog for a few years. Do you have a link to your big red balloon Kickstarter page?
- elisaado 6y agowhy don't you use a drone?
- molszanski 6y agoNot sure if it can help but check getfindster.com. It works without cellular. It has two modules, gps on a dog which emits some data RF signal and a receiver in your pocket. They claim 3km range. I can confirm 1.5km. Didn’t test further. Quite magical actually
- ksm1717 6y agoPart of me was expecting that “cat” was a technology term I didn’t know
- adolph 6y agoNo, just the normal utility that first "appeared in Version 1 AT&T UNIX." It uses Bing by default but you can specify a translation service in your cat.conf. Use like this: $ cat -L "en/us" /tmp/french-file.txt
- snvzz 6y agoOr you could just shake the cat food envelope.
- ajb 6y agoInteresting. I was hoping for someone to do this with LoRa, which would allow you to find your cat in a bigger area.
- tamaharbor 6y agoA ‘cat scan’?
- pacaro 6y agoThere used to be (~20years ago) a catscan website where people posted images of their cats as taken with flatbed scanners (when those were a thing). It wasn't uncontroversial. One of my favorites was a color scan taken in multiple passes with filters. The cat was not stationary through the whole process
- kaybe 6y agoI managed to find some, hiding behind CAT scans and quantum cat/dog scanners (wtf): https://thecatscan.tumblr.com/ https://thecatscan.tumblr.com/ http://www.cat-scan.com/cat-scan/ http://www.cat-scan.com/cat-scan/ (put up your sunglasses..)
- paulie_a 6y agoVery cool and I know what I am building this weekend
- sli 6y agoThis is interesting. I've been considering a similar project using computer vision, but I think I'd prefer to just set this up instead.
- kuu 6y agoVery cool project! :D
- pjc50 6y agoIf somebody manages to build a reasonable-precision (tens of cm?) indoor location system with decent user experience (ie reasonably easy to set up, reliable, cheap, and stable), they have a massive hit on their hands. Never mind the cat, never lose a key or a remote ever again. Or your pills. Hugely valuable for the elderly.
- Cthulhu_ 6y agoThere's commercial products for locating cats outside; probably GPS and either a mobile chip to pass the data or LoRa. $75 or so, but I'm sure they come with subscription costs as well because monies. There's a cat in our neighbourhood with one of those, it's funny to walk out there in the middle of the night (we violate curfew and walk the dog close to midnight) and see a cat with a collar with some blinking lights staring at us from the bushes. Kinda wish one of our cats had one of those when he went missing, but it's likely he would've lost the collar at some point anyway (he looked like he squeezed himself through a tiny hole and couldn't get out again until he lost a ton of weight two+ weeks later when he came back)
- Razengan 6y ago> we violate curfew Why?
- flyingfences 6y ago> Why? Why not? Curfews are ridiculous, authoritarian measures taken to curb "improper" activities not associated with walking a dog.
- jfk13 6y agoAlternative point of view: they are a mitigation for the fact that many people cannot be trusted to behave sensibly (in terms of protecting society at large from this pandemic) if large numbers of people are out and about at night, and it is not feasible to check each individual's activities to assess whether they're "improper".
- ptudan 6y agoWithout anymore context, I'll assume that he's referring to a logic lacking covid curfew in the US. Those might make sense for dense downtown districts with bars, but almost nowhere else
- mschuster91 6y ago
- idlewords 6y agoRemember that the more precisely you track your cat's location, the less you will know about its momentum (although since it's a cat, you can assume it is zero for most of the day).
- dhon_ 6y agoIf you attach an IMU to your cat would it become blurry?
- cjdell 6y agoAn unfinished project on mine is to try to track my cat outside using an ESP32 LoRa module attached to his collar. The idea is to periodically send a list of WiFi SSIDs along with RSSI's so I can triangulate the cat's location using the signal strengths of each network. Similar to how the first iPhone would find your location without needing GPS.
- flak48 6y agoYou might find Gene Bransfield's War Kitteh project enlightening: https://www.youtube.com/watch?v=DMNSvHswljM https://www.youtube.com/watch?v=DMNSvHswljM
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- mattanamg 6y ago"What a lack of privacy" says the cat
- EGreg 6y agoAnd proceeds to lick its genitals in front of you
- ljhsiung 6y ago-- "now let me sit in my owner's pants as he sits on the toilet"
- reaperducer 6y ago"Have you seen my butthole? Look at my butthole! Let me turn around so you can get a better view of my butthole!" — Every cat ever.
- roel_v 6y agoSo I don't know much about ML; how much better would one expect ML (which I take in this context for 'deep neural network'?) approaches to be compared to a multinomial logistic regression, for applications like this? Is logistic regression old school and/or outdated now?
- martin_a 6y agoI think ML is completely unnecessary here. In the end it's triangulation of a signal. No need for ML after all. Looks like a classic case of the famous Jurissac Park quote: "Your scientists were so preoccupied with whether or not they could, they didn’t stop to think if they should."
- fock 6y agoiirc BLE is not that exact and you'd also have to model/measure your sensor position. I think creating a primitive statistical model for looking up the location seems sensible but the ML aspect is definitely a little bit overrated, but I think this thing was never meant to clickbait (it's means to an end available for ~40years now).
- djrogers 6y ago> In the end it's triangulation of a signal. No need for ML after all. Triangulation works accurately in open space, however this use case is inside a home with signals being blocked, bouncing, or attenuated by walls, mirrors, appliances, etc. On top of that, the goal is to use as few BLE rx'ers as possible (meaning not one per room). Given those constraints, a trained ML model actually does make sense.
- eeZah7Ux 6y agoThe pattern emerging from RF reflection across rooms is not completely obvious. "ML" is just a very overstated word for: "I have a handful of example data and a library that does basic math things"
- srean 6y agoThere are no convincing reasons to consider logistic regression to be outside of ML. ML isnt just deep learning. To me its a collection of mathematical tools that help in designing predictors. This involves stats, optimization, algorithms, stochastic processes, information theory. The main difference between stats and ml is (i) community, (ii) stress on the details of compute and the focus on prediction accuracy rather than accurate recovery of parameters. A scheme that ensures good prediction even if the parameter is not recovered, for ML that's still a success.
- reaperducer 6y agoI like this project a lot. It makes me wonder if I put one of those Apple AirTags on her for the HomePods to sense, if I can then say, "Hey, Siri, where is the cat?" It would be nice to get a response like, "She's in the litter box" so I know to use a different bathroom to wash my hands.
- r00fus 6y agooff topic: is it common to have a litter box in a bathroom? According to the things I've read, cats prefer to have their "scent soaker" in more common areas, so I've not ventured there...
- saghm 6y agoI think a lot of people do it so they only have one place that's a bit smelly instead of two
- astura 6y agoFairly common - if say ~20% of cat owners I know keep the litter box in the bathroom.
- richardw 6y agoWe do. Tiles, not carpeted. Keeps smells away from living room etc.
- pelliphant 6y agoWhen living in a larger house, I had the litter box under the stairs, in a small apartment, bathroom was the best option.
- hombre_fatal 6y agoPSA: Make sure to get collars for your cats that either detach under load or, perhaps best, have an elastic segment that lets them slip it off if it catches. A couple months ago my friend found his cat dead after her collar caught while jumping over the fence. Poor little baby beast. :/ I look at my fun-loving critter basking in the sun as I write this and it breaks my heart to imagine her suffering like my friend's poor cat did. Example of a collar with elastic segment: https://amazon.com/dp/B07P8V374M https://amazon.com/dp/B07P8V374M
- monadic3 6y agoThe term for this is "break-away collar" if that helps.
- dkersten 6y agoI’ve also seen them referred to as “safety collars”.
- sgt 6y agoDo they still sell rigid collars?
- onli 6y agoYes. And that's not all that bad if you use them to go for a walk with the cat, like with a dog on a leash (but then a harness is better). But it's a real problem if the cat is alone. The veterinarian looked so damn sad when talking about how important those breakaway collars are...
- godelski 6y agoIf you're walking them get a harness (same for a dog). Don't pull on the neck, pull on the body. This is not only better for them but you'll have more control.
- 6y ago
- mzkply 6y agoI bet you Airtags will be put on every cat and dog since it's likely they'll be picked up by everyone's iPhones, not just the owner's.
- holman 6y agoIf you're using Home Assistant, Room Assistant is a lovely project to repurpose Raspberry Pis to handle BLE tracking as well: https://www.room-assistant.io https://www.room-assistant.io
- skeletonjelly 6y agoSide note: that is some really elegant documentation
- jeromenerf 6y agoI would have been interested in the training set initial construction. It seems like the author has been walking the cat around the house from 15:30 to 22:00 :)
- lifeisstillgood 6y agoThere seems to be a limit to how useful home automation gets - in fact this is common across car and most other areas too. I have a hard time describing it but the write up above triggered something. I am interested in setting up wifi-valves on my home radiators - this would be really useful in a three storey house as getting balance right otherwise is impossible. But turning on lights and closing curtains just seems to be a foolish trade if complexity for convenience (ie we bought a big second hand car that had electric doors - they were great - till they stop working and you realise there are electric motors, sensors, relays and god knows what else where there used to be a lever.) Anyway pretty much anyone can see that trade off (even if they do get excited by the electric doors and buy the darn thing anyway). No the issue is the motion sensor and the lights. I have found myself in offices with those devices - it's a good idea saves electricity- and I understand how it works without any difficulty - and the solution is easy too - a motion sensor has timed out, therefore wave my arms around. The interface is simple. But when we add "smart" to it - when we write some algorithm to work out if a person is still in the room - either by direct sensing or cunning working out if they were in room A and now are in B, we end up in failure edge cases quite quickly. And the problem is it is it simple or intuitive to work out how to "wave our arms" to fix it. If the room assistant is counting people in and out, what happens if I carry my daughter in, but she walks out - how many people are left in the room? How do I deregister ? A similar thing happened with those electric doors - I let my kids jump out to go see Gran, parked too close to a tree. The electric door wanted to roll back to its full open position before coming forward to shut. But the tree won't let it go fully back. Ok the the engine back on and drive two feet - oh, I can't drive cos the door is open. Shut the door, but the door wants to go back first and hits the tree ... it took two grown men fifteen minutes to work that one out. The problem is that software engineers like us have tried to make sensible defaults and decision trees - but we fail to cover everything. Now FOSS is a partial solution to this - but for any appliance, for any IoT, for any thing that I am not paid professionally to understand, if I have to read the code to workout how to get around it, something is seriously wrong. I am not sure where this leads - it's just ... user friendly usually is not. Simplicity is not just hard but sometimes orthogonal to sales and growth and, frankly I dont think most of our lives need more automation - i think we need help, actual assistance, advice and good curation. I think I just wrote the opening paragraph on my chapter in MOOP.
- akiselev 6y agoAn off the shelf solution: https://www.tabcat.com/ https://www.tabcat.com/ Works well for some outdoor critters
- Whitespace 6y agoI don't need Machine Learning to tell me that my cat is sleeping. 95% accuracy rate with zero training!
- RealStickman_ 6y agoYes, but where? Mine rotates that spot on a weekly basis.
- dkersten 6y agoMine tend to stick to the same four or five spots. Those spots do change, but rather infrequently.
- k__ 6y agoMy changes their spots depending on temperature. From warm to cold: Hall floor Livingroom floor Hall box Livingroom box Livingroom couch Bedroom bed Bedroom bed under the sheets
- adolph 6y agoAnd it is always local. I18n the cat would be something to see.
- m463 6y agoYou could probably get the other 5% if you have a specific time you set out food. catnip might introduce jitter.
- simiones 6y agoWill this solution work if my cat has become non-local by having it's state become entangled with some wave-packet?
- 1_2__4 6y agoSo I have some experience with this. I decided to add BLE beacons to my vehicles and bicycles, and an RPI to listen for the pings and retransmit them over mqtt. The idea was I could setup some Home Assistant alerts for things like "multiple vehicles are absent at once" or "vehicle went from home to away at odd hour" where "odd hour" is something like 12AM-5AM, a time when I wouldn't expect me or my vehicles to be departing. The way I implemented it was to have each beacon transmit on I think 1s (might have been 5s to save power) intervals, and some python code on an RPI that listens for them, with a timeout for each. If the listener gets a ping it immediately forwards it to mqtt as a "home" ping, using the beacon id to set the topic. If it doesn't get a ping within the timeout then the rpi generates and sends an "away" mqtt message for that beacon. My expectation was to have it alert me within ~2-3 minutes of a vehicle going from "home" to "away". In practice: - BLE beacons aren't very popular really, most of them are made by small foreign companies who don't sell them in places like Amazon. The ones Amazon does sell are kind of crappy. Setting them up usually involves downloading a vaguely-sketchy app to your phone (I haven't figured out how to configure them from the rpi). They all seem kind of janky honestly. - Bluetooth and Wifi use the same (some) hardware on an rpi, meaning if you start rapidly scanning for BLE tokens your wifi performance will drop to the point of the rpi being unusable (ssh sessions timing out). I fixed this by buying a separate USB bluetooth dongle, although even that was a pain to get working in the pybluez module - in general bluetooth under linux along with the python bindings are finicky and crap out easily, it seems. - I have my dmesg and syslog spammed with "Bluetooth: hci0: advertising data len corrected" when using bluetooth scanning, I managed to find a couple bug references to it and other people complaining about it but no fixes over multiple system updates. - It's just... Not reliable. I don't know why. I've tried really hard to make it reliable, and maybe the problem is the RPI-as-bluetooth (maybe if I used a microcontroller as the receiver it would work better?), but I've tried all variations of scanning windows and such and dug down into the code for Bluez without figuring out either what I'm doing wrong or where the issue is. Beacons will supposedly not ping for minutes at a time despite being on a 5s interval no matter what I do, and this is for beacons maybe 6 feet from the receiver (although ones further away do timeout more). The last thing is what finally killed the project for me. I had it (still have it) all setup in HA with notifications and schedules and such, but I just turned off all the automation for it until I get a chance to tear it down. Failed experiment.
- universa1 6y agoSee also [1], a research collaboration that did this basically 12 years ago... Iirc they also had a project where they tracked cats across a town... But most of their "experiments" were just tracking interactions between pupils and not so much the location tracking... Though I remember the original hardware (was open sourced) had this as well. [1] http://www.sociopatterns.org/ http://www.sociopatterns.org/
- PeterStuer 6y agoAt least over here all cats have an RFID implant injected after their first vet visit. I'd try to work with that instead of putting a BLE on the cat. Your localization target ("Cat is in kitchen" etc.) is coarse grained enough to make it work with RBP's.
- bo0tzz 6y agoAs far as I know, the usual range on those implants is no more than ~30 cm, so I expect you might need a pretty powerful transmitter to find them across a room.
- rtkwe 6y agoThat's less a hard number and more a limit of how much power you're directing at it (with limits due to the inefficiency of RF energy transmission mostly) and how sensitive your receiver is. The passport RFID tags have been read from over 200 feet away for example. (this number is from years ago too) https://www.darkreading.com/vulnerabilities---threats/researcher-reads-rfid-tag-from-hundreds-of-feet-away/d/d-id/1134117 https://www.darkreading.com/vulnerabilities---threats/resear...
- faeyanpiraat 6y agoYou might be able to monitor chokepoints with a low RF pollution, like the small square opening at the main entrance/exit of the house. This way you can tell when your Cat has left the building without getting cancer.
- PeterStuer 6y agoI assumed that given the target was to come to a 'cat in room x' resolution, a few readers placed at strategic sites (doorposts, mainly), would suffice.
- rsmets 6y agoWith a few other other elements (i.e. weather) added to learning model I bet this would be super accurate! Pretty neat. I love finding use at home DIY use cases with commodity hardware, ESP32s ftw.
- colechristensen 6y agoThis beats my method of cat locating, which usually takes the form of increasingly urgent searching followed by noticing my target following me around wondering what I'm up to.
- MisterTea 6y agoFar simpler cat location method: Shake a box of dried cat food around and then pick the cat which is yours.
- aidenn0 6y agoMostly OT, but this article made me ponder it: I know that people have done various forms of radar with wifi signals; I wonder if I could have a few sensors throughout the house and use ML to determine if various doors are open or closed.
- JoeAltmaier 6y agoConfused: how do you train the model? Don't you need an independent source of 'cat location' data?
- kimburgess 6y agoIf you make the bump to Bluetooth 5.1+ RTLS like this get even more interesting as you can measure not only signal strength, but angle of arrival too. Nordic Semiconductor have some beautiful development kits [1] for this if you want to play. Cisco also have quite a nice write-up [2] on other approaches to location resolution from WiFi and BLE. It's worth acknowledging that setups like this exist in most workplaces, shopping centres, stadiums and other public spaces in many developed countries. 'Free wifi' is not there for your benefit. There are useful experiences enabled by this which may make your life simpler in some contexts, but also worth being cognisant of how common this is. If the benefit provided to you does not balance the privacy loss, you may be interested in https://account.meraki.com/optout https://account.meraki.com/optout and https://optout.smart-places.org/ https://optout.smart-places.org/ (you may need to pop a few addresses in here if you use private addresses on iOS). [1]: https://www.nordicsemi.com/Products/Low-power-short-range-wireless/Direction-finding https://www.nordicsemi.com/Products/Low-power-short-range-wi... [2]: https://www.cisco.com/c/en/us/td/docs/solutions/Enterprise/Mobility/WiFiLBS-DG/wifich2.html https://www.cisco.com/c/en/us/td/docs/solutions/Enterprise/M...
- astura 6y agoI shake the treats to geolocate my cat. 100% accuracy.
- ramraj07 6y agoThat triggers Heisenbergs cat problem - the uncertainty in its position rapidly decreases (converging towards your location) while momentum becomes highly uncertain. Brace yourself
- MatthiasWandel 6y agoTracking location by signal strength is highly error prone. Antenna orientation and multi-path can change signal strength a lot (+/- 6 dB easily) without the object actually moving. So the location data you get will be VERY approximate.
- brokenmachine 6y agoI would much rather localize my neighbor's cat to know when the bloody thing is shitting on my property again.
- mschuster91 6y agoCats are not things. That aside, house cats usually only shit in sand-ish environments - is the cat by any chance shitting in an uncovered playground?
- brokenmachine 6y agoNo, I don't have a playground on my property, and I dispute your assertion that cats will mostly shit only on sand. Also, a cat is a thing.
- dboreham 6y agoSure fire solution is to get your own cat. Preferably big one.
- brokenmachine 6y agoI appreciate the suggestion, but I don't think that will solve my problem of too many cats on my property.
- dboreham 6y agoSure would -- the number of cats would be capped at one.
- brokenmachine 6y agoIs there really no way to have zero cats?
- datenhorst 6y agoI've had the same problem, what helped was starting to feed the cat semi-regularly. Cats quite literally don't shit where they eat!
- 867-5309 6y agobeen thinking about kitt(y)ing my cat out with a 3G+GPS module for tracking outdoors but the weight of lithium in the battery pack required for hours-long adventures has hindered any further effort
- deleted 6y ago[deleted]
- pvaldes 6y agoremote pet detection by car computers would be a nice feature