Pet Tracker platform, is there opensource already?

I am currently using a directional radio beacon to track my cats in case they get lost.

I came across the Lilygo T-Impulse T-Impulse LoRa Wristband – LILYGO® and I think it could be the perfect pet tracker platform.

The end device seems reasonably simple to implement. But it means nothing without a good backend.

I wonder, is there already good object tracking software out there that integrates with TTN? I didn’t really find much at all.

It would be nice if I didn’t have to implement it by myself.

What I’m imagining is a website similar to Googles Find My Device or Find My iPhone.
A minimalistic website where I can plot last known locations and can ping my devices.

1 Like

If, as suspect, this is for the purpose of back-end/user saying “hey tracker can you send me a gps reading of where you are now please, or where you last grabbed a location lock” - as battery likely dictates wont be constantly updating… then you may be out of luck as the way a Class A LoRaWAN device works is it sends a scheduled or alarm triggered uplink and only then listens for any back end generated downlink. Hence if a device is only uplinking say 2, 10 or even 20 times per day then you will only get a triggered response after the next one of those 4 uplinks - hardly real time. If you have the device sending messages regularly and more frequently then you will need to limit message sizes to reduce on air time/duty cycle, be it on a private LoRaWAN network or (more constrained due to FUP) on TTN. A full GPS location message will mean a significant size of OTA message (15-27 bytes typical, expecially if other data relating to the device is sent) which may quickly exhaust either your TX capacity or battery capacity or both…doubt if your cat will be happy to carry 1/2 dozen D cells ;-). There are LoRaWAN modes that provide faster responses, with less latency - Class B or Class C, but again not battery friendly as you may need device to sit in constant receive mode (Class C) when not sending - again not battery friendly so anything close to near real-time or even ‘frequent’ and small enough to be tolerated by a pet (ok, your horse or pet cow or yak maybe!) - likely impractical. That is not to even start to consider potential range and SF related issues - which will kill available air-time (and battery) even faster as the fluffy/furry one moves further away and potentially out of range… (SF10…11…12…). Please search the Forum for prior discussion wrt tracker on LoRaWAN & specifically on TTN. Asset trackers giving less frequent updates or relocatable ‘fixed’ location notifications, or alerting when starting to move etc.) are a thing and very valid and valuable use cases for LoRaWAN (I use several every day) but practical limitations tend to prohibit viability for fast update ‘trackers’ that are small enough for your pet rabbit or hedgehog et al…

Thanks, yes my idea is to enable GPS only on demand or otherwise battery life is going to to be too bad.
I think about waking up, every half hour or even less to check in with the network and see if there are downlink commands available.

More frequent check-ins and GPS will only be necessary once the pet is marked as ‘lost’.

A more interactive use case is an option for people who don’t mind recharging their tracker more often.

Anyway, that’s all simple. The backend is where I’m stuck.
Of course I don’t want to rely on ttn-mapper.

If I have to build that from scratch I don’t think I have the skill, resources and patience for that.

In your case a GPS tracker is power hungry. GPS wants ~40mA when operating. With a device yes it is possible (I have 4 GPS trackers) because most of the time are inactive, but the animals are not. The accelerometer wakes the device, so the energy consumption is low, but the animal is not steady.

Since you can’t wake up the device remotely, and the accelerometer does not help, the GPS will eat the battery. Only option is a bigger battery and a firmware that shutdowns the GPS if no satellites are visible to save energy. The last advice is untested.

The device you posted has a 200mAh battery. If I made the right calculations the battery will last only 8 days with an animal (constantly moving). I made the scenario that during the day every 10 minutes the GPS will open for 10 seconds (average time).

1 Like

I have personally no intention to enable GPS until the animal had failed to return home after a while. (But I will probably implement geofencing for people who want it)

The device will literally be in complete deep sleep except for a few dozen wake-ups per day to ping home.

Anyway, we are bikeshedding. I am looking for backend application code.
I’m not really frontend/backend coder. Doing that from scratch is going to be foolish I think.
I looked at sveltekit. Looks cool, but there is still a big learning curve, especially for design decisions.

I would not be that concerned about the ‘Pet Tracker Platform’ aspect of such a project, no doubt it can be written by someone with the rights skills.

What is a very long way from easy is getting a small cat size TTN\LoRaWAN sensor working well enough to be practical.

The antennas for the TTN\LoRaWAN and GPS will be small and very close to the ground and could well be indoors or hiding in bushes etc.

So for TTN\LoRaWAN the node could well be outside of Gateway reception for very long periods. The GPS also could have very bad reception and this would significantly increase power consumption and have a major effect on battery life.

I would start by actually testing the T-Impulse thats to be placed on the pet first to see if the TTN\LoRaWAN reception is good enough and if the GPS works well enough with low enough power.

If performance from the T-Impulse device is not good enough then there are no ‘magic’ solutions to make it work better apart from a different design thats a lot bigger and heavier and thus not suitable for a cat.

Is this for a product to sell?

If it’s in deep sleep it won’t hear any signals to start sending the location - so there could be a considerable delay between the user (there are no owners of cats, cats have care assistants) and the collar returning information. However you do have an accurate time source so you can schedule regular wake ups to listen for a signal.

Erm, as that’s almost all the technical parts of the product, are you looking for a solution to repackage?

No. Opensource.

yes

I was asking if there is some opensource I can use so I don’t have to start from scratch.

Yes you are right. I have no idea how suitable that thing really is. I should get one soon to test.

At TTN Madrid, we are working on 2 geolocation nodes:

  • TTNMAD_SOS: For on-demand people tracking (activated through a push button or remotely using a downlink command) using GPS ard/or WiFi AP geolocation based on Wigle. This device is powered with a rechargable 18650 Li-ion battery.
  • TTNMAD_CATTLE: For farm animals tracking (cows) using only GPS with 2 operation modes: regular that reports the last 4 positions every 15 minutes, and intensive that reports the last 4 positions every 5 minutes. This node is powered with LiSoCl2 batteries.

Both are programmed using STM32CubeIDE, and integrated in our platform “my IoT open Tech”, baed on ThingsBoard open source Community Edition.

The weight of these nodes is about 150 g, so probably not very cat-friendly.

imagen

All our efforts are open-source, but this is still a work on progress, so not ready for production deployment yet. Anyway, if you don’t want to start from scratch we are pleased to cooperate with other communities.

Please keep the fair use policy in mind when deploying on TTN. 30 seconds (uplink) airtime a day…

2 Likes

Thanks, nice projects.

I see you use ThingsBoard. I will look into that. Thanks for the hint.

1 Like

How are you ensuring coverage?

For testing with my indoor gateway.

I live on the top floor of a high building, with the right antenna I should get a very decent range.

So much to unpack about that, including the dead zone immediately around the high building - but I was asking @jfmateos

Regarding TTN coverage, we don’t develop these projects relying on present TTN coverage but just the opposite: we develop them to convince other citizens to deploy TTN gateways at their homes/offices.

Nevertheless, we have just got some uniform coverage in our neighborhood using a few gateways.

imagen

Regarding Wigle geolocation service, we use the Wigle phone app to contribute to the database frequently.

imagen

Regarding GPS coverage, the nodes only try to get a fix if there are satellites at sight… if they can’t see any satellite after a minute, TTNMAD_CATTLE will sleep till the next programmed sending, and TTNMAD_SOS will try to get the 2 most powerful Wi-Fi AP MAC addresses and then will also sleep.

2 Likes

Brilliant - super impressed - looks like good progress with deployment & mapping - do you have the map online so they can see where the need is?

How many cattle do you have in the city centre? :wink:

No, we just use ttnmapper.

Our community meets every Friday from September to June, and we discuss potential use cases and integrations with popular domotics platforms (Home Assistant, OpenHAB and similars), and assist new members in deploying their own gateways and make DIY nodes (TTNMAD_Door, TTNMAD_Fridge, TTNMAD_Plant, TTNMAD_Mailbox…)

Fortunately, some of out members are cyclist/scooter riders and are very active mapping TTN coverage.

As the TTN coverage in Madrid is so irregular, most of our members only use TTN for personal local projects (domotics) o academia, but we are trying to expand through geolocation projects, like TTNMAD_SOS, and are open to citizen science projects or collaboration with other communities (for example, our TTNMAD_Door workshop is very well received and would like to share this experience and know about other successful communities projects).

Unfortunately, one of the main complaints of our less tech-savvy members about LoRaWAN/TTN is that it is too difficult… that is why we have developed our own platforms (my IoT open Tech and my IoT legram).

TTNMAD_Cattle is a derivative project of TTNMAD_SOS (almost the same hardware/software) and is now being tested (we need a 3-4 month battery autonomy). If the tests succeed, it will be deployed in a rural area of Spain to monitor cows in October. There are not many four-legged cattle in our city center :wink:

1 Like

A common issue - it’s up to the more tech capable to provide an insulation layer but it is equally important for people to say what the barriers are for end-user deployment - they get great benefits by being able to use the technology but sometimes they stupidest detail can stand in the way. It is often possible to provide a simplification layer but complaining that the technology that does amazing things is complicated is self-defeating. Hopefully you can make progress by holding feedback sessions. And remind them that driving a manual car requires co-ordination of hands, eyes, feet - with hands & feet doing different things at the same time to change gear - they didn’t think they could do it when they started out, but now it is second nature.

1 Like

I had an idea. Since the GPS is power hungry for geofencing, you could use WiFi to monitor the in-place state of cat. If the device can’t see your wifi - or some others - maybe it’s time to activate the GPS.

To my knowledge you have to implement this by your self. And now you have an extra device to program: the WiFi.

Instead of WiFi you can use Bluetooth beacons, but I think the reach is much smaller. Maybe this is better for room location, not for outdoor geofencing.