Anti theft GPS

Figured out how to get the tracker working with ruhavik (gps-trace), a free third party tracking platform offered by Gurtam. Even better I was able to leverage one of Gurtam's other free platforms (flespi) to act as a proxy server so I can send data from the tracker to multiple servers at the same time. This is awesome as it means you don't have to choose between ruhavik or the native app, you can use both at the same time, gettting the best of both worlds!




<>native tracker server
tracker <>​
flespi proxy server​
<>ruhavik server
<>or another third party server

Steps:

Sign up for a free ruhavik account
- add your tracker to ruhavik (note: free accounts are limited to 1 tracker)
- it will give you the tcp link to the ruhavik server to point your tracker to

Sign up for a free flespi account
- add a proxy channel with two proxy targets
- for the first target enter the link to the ruhavik server (you may need to add a tcp:// prefix to it) and click the options "mandatory target" and "proxy replies back"
- for the second target enter the link to native server (for eelink this is: tcp://hkgps.sky200.com:32001) and click the options "mandatory target" and "proxy replies back"
- after you add the channel it will give you the link to the flespi proxy server to point your tracker to that will look something like this:
12345678.flespi.gw:9876

Configure your eelink tracker via SMS to point to flespi's proxy server instead of the native server
- to do this for eelink you text the following command via SMS to the tracker (modify with the actual link provided by flespi)
SERVER,"tcp://12345678.flespi.gw:9876"#

That's it!

Optional (for advanced users only): You can view / modify the data in flespi before sending to ruhavik. To do this you would add your tracker to flespi instead of ruhavik, create a channel in flespi for the tracker, get the link for this channel, set the first proxy target to this link (instead of ruhavik), create a plugn to modify the tracker data (see example below), then stream the modified data to ruhavik using the flespi-to-ruhavik option:


In the plugin example below I filter out non-critical data to allow more tracking history in ruhavik (it only retains 10MB per device) and modify alarm events so they trigger push notifications in the free version of ruhavaik. I also calculate battery % for the hardwired ebike battery so it can be monitored in ruhavik.

Code:
// code for flespi  msg-pvm-code plugin

// unset parameters that don't contain useful information
unset .ain.2
unset .battery.voltage
unset .carbon.dioxide.ppm
unset .device.temperature
unset .din
unset .engine.ignition.status
unset .event.enum
unset .gnss.status
unset .gsm.cellid
unset .gsm.lac
unset .gsm.mcc
unset .gsm.mnc
unset .gsm.signal.dbm
unset .obd.connected.status
unset .sensor.humidity
unset .sensor.illuminance
unset .sensor.temperature
unset .steps.count
unset .vehicle.mileage
unset .walk.time

// uneset engine.blocked.status (unless true)
if .engine.blocked.status != true:
    unset .engine.blocked.status

// movement.event (mottion per vibration sensor) doesn't
// trigger an alarm notification in ruhavik so set a towing
// event instead and enable towing notifications in ruhavik
if is_set .movement.event:
    false ==> #engine.ignition.status
    true ==> #towing.event
    unset .movement.event

// convert ain.1 to battery.voltage and battery.level
if is_set .ain.1:
    .ain.1 * 10 ==> #battery.voltage
    unset .ain.1
    48 ==> $x // nominal voltage of pack (36, 48, 52, etc.)
    $x / 3.7 ==> math.round ==> $x // cells in series
    .battery.voltage / $x ==> $x // voltage per cell
    // % = sum(voltage to 3v cutoff) / sum(4.2v max charge to 3v cutoff) * 100
    ($x - 3) * ($x + 3) / (4.2 - 3) / (4.2 + 3) * 100 ==> math.round ==> #battery.level
    // if charging, set negative at 80% charge to trigger ruhavik notification
    if !is_set .position.speed || .position.speed == 0:
        if  .battery.level == 80:
            -.battery.level ==> #battery.level
 
Last edited:
I've been planning to add another tracking device for one of my other bikes and saw this tkstar TK408-4G tracker on amazon on sale for under $50 so decided to give it a try and compare to my eelink tk419.


The tkstar is about the same length x width as my eelink, but almost twice as thick. It could still fit it in the neck of my Frey CC and it seemed to be able to acquire GPS just as well, but the thickness could be an issue if you are tight on space.

It took me a while to figure out how to insert a SIM card in the tkstar. It uses a very old skool tray with a metal cover that you need to pull back and flip up to insert the card. One thing I appreciated in the SIM compartment is a power switch so your internal battery doesn't drain. It also makes it easier to reboot the device as you can cycle the power, something I can't do with my eelink until the internal battery runs out of juice.

In terms of quality the tkstar feels like a step down. It's bulkier and not weather sealed like the eelink, not that weather sealing matters if you are securing it inside your frame, but edge to the eelink here.

The interface of the tkstar app has more options, but overall I prefer the simplicity of the eelink app. One thing I really dislike about the tkstar app is reviewing trips. You get one big trip for the entire day, regardless of stops. If you want to review a trip you have to go in and enter the time start and stop. It's comically bad! Push notifications seem to work in the tkstar app (in the eelink app push notifications are pretty much AWOL) although some didn't trigger. If you plan to rely on notifications from these native apps I think you're better off with SMS notifications. Unfortunately my SIMs are all data only so I couldn't test, but I've been playing around with ruhavik (a third party app, see above) and push notifications working well for eelink after tweaking the data in flespi. If you want the best app experience ruhavik is the way to go, but you'll need to pony up $2/month if you want ruhaik to track more than 1 device or you want vibraton movement notifications (and don't want to use flespi to trigger them).

In terms of SIM compatibility, I've been testing a few SIM cards and one refused to work in the tkstar device after one day. It worked without incident in my eelink so I'd give eelink the edge. The tkstar device also seemed to consume more data than my eelink device.

In terms of tracking I think either device would suffice to track a stolen bike. However, I found the eelink device has a significant advantage when it comes to accurately tracking routes. A picture is worth a thousand words. The first image is the eelink and the second is the tkstar.

tracking.jpg


I always been impressed by how my eelink tracks what direction I ride around the neighborhood despite only being set to track in 30 second intervals. I found what's actually happening is when you turn more than 40 degrees the eelink is smart enough to send a tracking point! So it's actually sending more frequent tracking points than 30 seconds, but only when it needs to. Not only did the eelink track the direction and the curvature of my route much better but also tracked exactly where I turned around. The tkstar (and most other GPS devices) don't have this "smart" functionality and only track in time intervals. You could set the time interval to be more frequent, but that will increase your data usage. This pretty much sealed the deal for me in terms of whether to keep the tkstar or return it and get an eelink tracker for my other bike.

In terms of other trackers with smart angle updating, I noticed this one has it but looks a lot bulkier than the TK419 and the app reviews are horrible!


Edit: just ordered another TK419 directly from eelink and had them add 2 relays and 2 external batteries to test. Pretty sure the external battery will fit in the neck of my frame with the tracker and provide adequate backup if the ebike battery is pulled, not sure about the relay, but it would be nice to cut power to the motor if I can find room for it. The TK419 is $50, relays are $3 (but not needed, see next post), and external batteries are only $4 (similar batteries cost ~$20 on amazon). Adding batteries will require more expensive express 3 day shipping ($50). Order directly via the following link or chat with them to add any optional accessories. They didn't seem to care I wasn't buying in bulk.

 
Last edited:
Now onto finding what wire to interrupt on the bike:)

in-between the battery and the controller
I'm assuming you were speaking hypothetically, or did you actually set up a relay this way? Pretty sure the battery will be sending more current to the controller than an automotive relay switch can safely handle. Also, the coil resistance in an automotive relay needs a 12/24v battery to trigger the switch so a 36-52v ebike battery won't bode well for the relay unless the tracker is stepping down the voltage sent to the coils.

A much simpler solution is to tap in to a brake (or shift) sensor circuit. These behave like "normally open" relays (pulling on the brake closes the circuit which disables assist and activates the brake light). To cut assist all we have to do is close the circuit and we don't need a mechanical relay to do this! When a GPS tracker activates relay all it does is connect the relay wire to the battery (-) wire allowing current to flow thru the relay coil since the other side of the coil is connected to the battery (+) wire. Instead of using a relay we can just connect the yellow relay wire and black battery (-) wire in parallel to a brake (or shift) sensor circuit and the circuit will close and disable assist when the GPS tracker activates relay!
 
Last edited:
Great find that you can just connect the brake sensor or gear sensor wire to the TK directly avoiding the use of a relay !!
You should make a Wiring diagram to make it clear for everyone :)
Thanks
 
Here is a typical shift / brake sensor wiring loop. When you shift (or brake) the sensor connects the 2 wires which tells the controller to cut power.

Code:
controller --- sensor red (+) wire ---
|                                     \
 ----- sensor black (-) wire ------ sensor

Splice into this loop (in parallel) with the yellow and black wires from the GPS:

Code:
                            --- GPS yellow wire ---
                           |                       \
controller --- sensor red (+) wire ---              |
|                                     \            GPS
 ----- sensor black (-) wire ------ sensor          |
                     |                              |
                      ----- GPS black (-) wire -----

When GPS activates relay the yellow and black wires will be connected which connects the sensor red and black wires and cuts power.

Edit: Splicing into the sensor black (-) wire is optional. You can just connect the GPS black (-) wire to ground (see comments below).
 
Last edited:
If your GPS sensor is powered by the battery, then the ground (black) should already be connected to the battery ground, as shouldm normally be the ground of the fear/brake sensor, and so eventually only the + wire of the brake/gear sensor would need to be connected to the GPS yellow.
Have you checked that by any chance?
 
From what I understand, ebike batteries aren't typically grounded to the chassis (for safety reasons due to the high voltage). One of the wires in the sensor loop is (+) and the other wire is (-) but I don't think that's the same as battery (-) or ground (there is actually a third wire in the sensor loop which I believe is ground). Just to be safe connect the yellow relay wire to the (+) wire in the sensor loop. I'll update the diagram to highlight that.
 
Last edited:
I disconnected the 2 black wires and did a connectivity test with my multimeter to see if they were still connected. It indicated connectivty so you may be able to get away with just running the yellow relay wire to the shift sensor (+) wire. That said I'm not sure of side effects since I don't know how the 2 black wires are otherwise connected. If connected via wire that carries higher voltage current could that cause some issues?
 
If the black (-) of the GPS is connected to the (-) of the gear/brake sensor (shared with the battery black), It should not.
Think of a car, where the minus is common to everything from the high amp starter to the low amps accessories.
The current only flows between the + of the accessory to the minus, what happens to the plus of others has no influence.
And when you connect both wires of the sensor to the yellow and the black, you are in effect just doubling down on the connection to the common black.
 
Found another great use for the TK-419. Charging alerts! It's best for battery longevity to not charge beyond 80% unless you want to balance cells or need the extra capacity and plan to ride right away. What I've done (until now) is guesstimate how long it will take to charge to 80%, and set a timer on my phone to remind me to unplug. It has worked pretty well, although sometimes I overshoot or undershoot the time. Yes, I know, you can buy a charger that will automate this, and I actually have a grin satiator, but it came with the wrong plug and I've been to lazy to order the right plug for my bike, lol. Since my battery is hard wired to the tracker I figured why not monitor charging in ruhavik and have it send a notification to unplug when the charge gets to 80%. Works like a charm and no more guesswork!

How to do this? As noted above you can point your tracker to flespi to act as a proxy server, allowing you to forward data to the native app while modifying data in flespi and forwarding it to the ruhavik app. In ruhavik there is an option to get notifications for various low battery %. The TK419 does not calculate battery %, but it does send ain.1 (auxiliary input) voltage. I noticed this is 1/10 of my battery voltage, so I multiply by 10 in the flespi plugin and calculate battery %. To trigger the ruhavik notification I set the battery % negative when it reaches 80% charge.

Code:
// convert ain.1 to battery.voltage and battery.level
if is_set .ain.1:
    .ain.1 * 10 ==> #battery.voltage
    unset .ain.1
    48 ==> $x // nominal voltage of pack (36, 48, 52, etc.)
    $x / 3.7 ==> math.round ==> $x // cells in series
    .battery.voltage / $x ==> $x // voltage per cell
    // % = sum(voltage to 3v cutoff) / sum(4.2v max charge to 3v cutoff) * 100
    ($x - 3) * ($x + 3) / (4.2 - 3) / (4.2 + 3) * 100 ==> math.round ==> #battery.level
    // if charging, set negative at 80% charge to trigger ruhavik notification
    if !is_set .position.speed || .position.speed == 0:
        if  .battery.level == 80:
            -.battery.level ==> #battery.level

1659586557825.png
1659737791766.png


Side benefit is a more robust battery % calculation. Most SOC (state of charge) calculators don't properly weight remaining voltage which overstates remaining capacity. While I generally prefer to monitor voltage, the calculation above performs the proper weighting and can be displayed in the ruhavik app for reference.

2.jpg
 
Last edited:
Where are you going to secure / hide it? Looks bulky. I doubt under the seat is going to fool a thief.

61b+CGdAEfL._SY256.jpg
B1MGn5s3veS._SY256.jpg


Even with the cheapest plan you're still bending over for $84 / year with shitty 1 day tracking intervals. No thanks!

Also, I doubt the battery will last as long as they claim. If you don't want to hide / secure / hardwire a unit inside the frame the invoxia is probably a better solution and more places to hide it.
 
year with shitty 1 day tracking intervals. No thanks!
r u talking about the Trak-4 ? b/c that can have the tracking interval set for 1min/10min/1hour . battery is one of the biggest from all of them -4000mah puch cell and after opening it , there is enough space to install 3x5000mah 21700 Cells;can also make a custom case but 15.000mah will last many months.
 
r u talking about the Trak-4 ? b/c that can have the tracking interval set for 1min/10min/1hour . battery is one of the biggest from all of them -4000mah puch cell and after opening it , there is enough space to install 3x5000mah 21700 Cells;can also make a custom case but 15.000mah will last many months.

Where you going to hide all those cells? Anti theft GPS needs to be discreet. On the Trak-4 you can set tracking interval as short as you want as long as you're happy paying $15+ / monthly fee. No thanks! Do it right, get a small competent tracker like the eelink and hardwire it to your battery, track as frequently as you want, and pay close to nothing.
 
Where you going to hide all those cells? Anti theft GPS needs to be discreet. On the Trak-4 you can set tracking interval as short as you want as long as you're happy paying $15+ / monthly fee. No thanks! Do it right, get a small competent tracker like the eelink and hardwire it to your battery, track as frequently as you want, and pay close to nothing.

Tom, the eelink features look great . i have to read up your whole thread.


On eelink website it doesn't mention :
- geofencing
- monthly fees
- if Gps is NA , does it use Wifi signals instead ?

IS THIS FREE to use ?? that would make it the nr. 1 tracker then and Thank you for lettings us know about it. I will have to box up, return , delete my Trak-4 account, and end the memebership😉.


Can it powered from 12v or only with the external battery ?

I put the link here for others too , b/c i couldn't find it on amazon ...

 
Back