[code] [blog] [VNC] [E-Mail me] [GPS Tracker]

JIMI AM01 Ankle Monitor Reverse EngineeringFebruary 28 2021 22:06:51

I recently came across the JIMI AM01 ankle monitor on alibaba - which is basically a personal GPS tracker.. of sorts ;) Except with a better battery life, and more advanced safety features. Being the awesome Chinese tech company they are at JIMI, they were happy to send me some samples of this device. So this week, this came in the mail:

Unfortunately existing platforms such as traccar do not work too well with it - and JIMI's proprietary platform is just that - proprietary. Personally I like reverse engineering things - and giving people control over where their data is stored. Luckily JIMI used the manufacturer Concox to source their PCB - and their protocols are well documented. With a bit of luck, and a lot of debugging and logging I managed to build a server and a web-interface to this tracker, that looks like this:

Good enough to monitor whatever you can use this device for - and defnitely a lot more lightweight than traccar. You can find the software to use this device below this post. Note that it only supports GPS location for now - as using Google's location API for LBS location can get expensive quickly - at the rate of 200$ or more per device per month. To do indoors tracking, or to enforce a curfew you'd ideally do a lot of averaging or use GPS combined with LBS positioning to ensure that there's no false positives about leaving an area or entering it.

This software uses plain text files instead of a more complicated SQL database to store information. Since a lot of what we're storing is server logging or device status - which is not *that* valuable and plain text files have been used for logging for decades - it's the obvious choice. We do not need transaction guarantees that bad because in GPS data - what's the worst that could happen if a single point is missing - and the risk of that is one in millions? I'd rather have a lot of speed and compactness and ease of use/setup than just one more dependency.

The software itself is fairly simple - the webpage being written in PHP and javascript - with one c program that is directly called from PHP as a passthrough - this program is built to quickly find the piece of a gps log or other log that you want to read - for for instance the history or trips view. Doing this in c was more convenient because any other language is sort of slow for this kind of low level file I/O. The server that hosts the device is written in C entirely, and is lightweight consuming only 6-7mb of memory. Combine these two and you've got a very light, very easy to use GPS tracking server.

8/3/2021: updated software, added a lot of new features and improved performance a lot
8/3/2021: included all libraries in the archive + added backwards compatibility for browsers like Safari
8/3/2021: added a login page and styling. you can now connect your device to this webserver for free on port 9000. link to the tracking app can be found in the top bar.
8/3/2021: saved IMEI in a cookie for later use. Cleaned up code a bit.
8/3/2021: made layout responsive.
8/3/2021: fixed end date for fetching data, made text more readable.
8/3/2021: fixed UTC offset, compressed date_grep with upx.
8/3/2021: fixed time selection in Safari
8/3/2021: OpenLayers performance tweaks to load the map faster
8/3/2021: Enabled ARCGis map when zoomed out, and OpenStreetmaps when zoomed in
10/3/2021: Updated the server, removed a bug with setting defaults on the device.
11/3/2021: Fixed showing the command output in GUI.

File am01_software.zip
Size 7.56MB
crc32 1777526518
md5 d4c4923da0043a702a55bd62e54ed4da
sha512 1d39ccc7596d9d325f407249666e7bb006ea62cbb88ac7c8b3df109394dd4c0db0af05bd705e4763f8fbb06eb90931a6e0b66e033bbfa1aca3f8953d2bd1dd32