General info on Xexun TK102 GPS tracker

This is general post about Xexun TK102 GPS tracker and many of its clones. You’ll find here a bunch of useful information, including some tech specs, list of differences between original tracker and clones and some more.

The localizer and its clones

We’re talking about “Xexun TK102 Tracker” here. The original one, because there are many clones under other companies from China, selling similar hardware, with the same cover and logo, but with:

  • lesser performance (able to report location once per 20-30 seconds, not once per 5 seconds),
  • lesser information (lack of direction/bearing, altitude, number of satellites used for location fix and more),
  • different format of data or non-standard protocols (unable to use UDP protocol, using non-standard data packets).

“Coban” / “Kintech” are just two of many clones sold on eBay etc., claiming to be original “Xexun” trackers.

On the other hand, original “Xexun” and some clones (like “Coban” for example) are harder to control from own script, because they require a correct answer from the server, where data is sent over GPRS. If unit does not receive such reply, it breaks connection. The cheapest unit does not have this checking and will always sent location data to specified IP address over provided port.

Product description

Here is product description of original “Xexun” localizer (and here is a clone under “Kintech” name).

Possible buyer must be very careful (and should secure return policy, for which buying directly in China is not recommended) as there are many reports about sellers claiming to sell original “Xexun” device and sending a clone actually.

Though this device is five years old, it is still sold at many places (including eBay), but even at theses sources it is very hard to get anything worth for developers, except some simple, very basic user guide.

I have confirmed information (from two different sources) that there is no official API available for this device. The only option is to Google around, ask other users or use forums (see below).

If you own original “Xexun” localizer, you may try to contact company international departament and ask their technicians to include some changes to device source code and to send you updated firmware, with your changes – wow! That was confirmed by company itself.

Forum

I found a perfect forum for TK102 device, with a lot of questions and answers:

  • here is a general forum on TK102 device (kept alive for 5 years with 174 pages and 2000+ posts!),
  • here you’ll find more specific topic on receiving data from this localizer,
  • this forum is also about TK102 unit, but it is entirely in French.

There are many other devices dissussed and in general, this is the biggest forum in the world, with topics for localizers and similar information.

GPRS Protocol Specs

In general, any TK102 related devices is opening a socket for a direct TCP transmission (original one can be switched to use UDP protocol). Data is being transmitted over port specified by user, in configuration and using GPRS only (requires SIM card with enabled GPRS, there is no way to use WiFi).

Sending frequency, format and amount of data being send, entirely depends on kind of device is being used — it is more extensive and more configurable in original one than in clones.

Correct server response problem

Take into consideration, that many TK102 clones requires a correct response from the server after each data, it send. It breaks connection after sending some welcome garbage UDP packet, as it does not receive response, it waits for.

It is quite hard (quite impossible?) to find any guide to many of these clones, on what kind of responses server should sent. This often leads into situation of developer being unable to establish two-way communication between server and localizer. Many localizers are sold to be used only via SMS communication or throughs paid services that had signed and agreement with producer and received protocol specification that contains valid responses server should generate for particular TK102 clone.

Double check, if this is not source of problem, if you can’t communicate with your localizer from your app.

Summary

This is all the information, I managed to get up until now. I don’t found any API for this tracker so far. I found some technical documentation, but it did not helped me much in the area of programming this device on server-side. If you need more information, look around this blog or make Google your friend.

Using AJAX head-type requests to check size of remote scripts

Checking size for inline scripts is as easy as document.getElementsByTagName('script')[0].text.length (solution taken from here). But, when it comes to measuring size of remote resources things gets a little bit complicated. Mostly due to cross-site restrictions and reducing unnecessary server load. Head-type of AJAX call, not so famous among developers, may help in this case.

Read More “Using AJAX head-type requests to check size of remote scripts”

Free hosting for ASP

You can find a lot of free hostings for PHP and MySQL, but not that much for ASP and MS Access. In addition to being free, these hostings also offer absolutely not ads, neither on your websites nor in sent e-mails:

100 MB might seem to be very low among nowadays offers (counted in GB or even not limited in space). But since you get: ASP Support, MS Access database and ISS 6 (on Windows 2003), absolutely free for lifetime with 100% no ads, then I think it would be hard to find similar offer with higher storage.

Configuring NAT, DMZ or Virtual Servers on ASMAX AR1004g

This is a very short brief on how to properly setup NAT functions on ASMAX AR1004g router, i.e. how to route all (or part of) incoming traffic to a specific machine in your local network. In this text, I assume that your router is available under 192.168.1.1 static IP address in your local network and you want to route all traffic using FTP protocol to your video-player, available under 192.168.1.3 and all traffic using HTTP to another computer, that is accessible under 192.168.1.4 static IP address in your local network. Adjust this assumption to your actual situation. Read More “Configuring NAT, DMZ or Virtual Servers on ASMAX AR1004g”

Five major software development rules

To all those, who just don’t get it!

  1. DRY = Don’t Repeat Yourself!
  2. KiSS = Keep it Simple, Stupid!
  3. You ain’t gonna need this!
  4. Premature optimization is the beginning of all hell!
  5. Copy-paste is time waste!

Never, ever forget about these five, if you’re developing anything.

Simple script for showing contents of a folder

Long long time ago in a galaxy far far away I wrote a very simple PHP script, that I usually put into index.php of a directory, which contents I’d like to print out to the browser. I’m using this solutions on all servers and hostings which has Apache-based directory listings disabled and thus are showing empty page or error screen, if folder does not contain index.php.

Here’s the code:

[code language=”php”]
$dir = getcwd();

if (is_dir($dir))
{
if ($dh = opendir($dir))
{
echo(‘Files in this folder:<ul>’);

while (($file = readdir($dh)) !== false)
{
if ($file != ‘.’ && $file != ‘..’ && $file != ‘index.php’)
{
echo(‘<li><a href="’.$file.’">’.$file.'</a></li>’);
}
}
closedir($dh);

echo(”);
}
}
[/code]

That’s pretty much everything, folks!

Is it possible to convert working pure PHP appication to Yii

I was once asked, if it would be possible to do step-by-step conversion of a large project written in pure PHP into Yii. In my opinion, it is possible, but absolutely not worth it.

Most professional frameworks are complete opposite to “pure PHP” code in actually all areas. Code is separated most times (i.e. into model, view and controller in MVC design pattern) and uses mostly framework classes or code. I would even say, that writing an application in some framework means using only 10-20% of pure PHP code and doing rest purely on framework classes, extensions, controllers etc.

In other words: porting a “pure PHP” application into framework code would mean writing that application from scratch. I’m not sure, if you would be able to reuse more than 5% of your original source code?

Installing SVN on QNAP using IPKG (Optware)

This article is based on information provided by QPKG package created for SVN by noski and on QNAP Wiki article about SVN and of course a piece of my experience. But since SVN is relatively easily to install by-hand (so you don’t actually need QPKG package) and since Wiki article about SVN is outdated / contains some garbage (directory /share does note belong to /dev/ram!), I decided to write my own guide.

Read More “Installing SVN on QNAP using IPKG (Optware)”

Sending *.exe files through GMail and other mail servers

As for right know (when anything goes web and desktop applications are nearly dead) there aren’t many situations, when you would like to send an *.exe file as an attachment. But, suppose you want. Then you, the good question, is how to do this? Well… in general, you can’t do that. Gmail itself will block you from sending an EXE file directly or ZIP archive containing it. Saying that it did so, for the security reasons. And, even if you pass it over (see below), most mail servers will block you from delivering such contents to mailboxes operated on this or that server.

Read More “Sending *.exe files through GMail and other mail servers”

Installing Optware (IPKG) on QNAP TS-210

Outdated article! Read the updated version instead.

This article deals with installing Optware (IPKG) on QNAP TS-210 NAS machine. Optware is a must-have, if you want to do anything with your NAS that goes beyond using as simple network storage. I.e., if you want to access it via SSH and play a little around Linux on-board. In other words, in installs many core utils, that are simply gone from default distribution of Linux on-board QNAP.

Read More “Installing Optware (IPKG) on QNAP TS-210”

Fix for problem with mixing USB shares on QNAP

Most QNAPs randomly mounts USB disk shares. I.e. you can have disk attached to left USB port as USBDisk1, second as USBDisk2 and after reset — changed together. This causes many problems, where being unable to write some script accessing particular disks could be named at first. There isn’t an easy way to work around it. The only solution I found out was to write an script that resides in flash memory (therefore is called upon each restart of QNAP) and that mounts disks under shares similar to their disk labels.

Read More “Fix for problem with mixing USB shares on QNAP”

Remove non-empty directory on QNAP or Linux

You may try to use rm -rf [directory] to delete given directory along with all its content (including all subdirectiories and all files). Use this with caution, to not end up deleting all files on your root! :>

Note, that on QNAP (but not on regular Linux) you have to start your session as admin user, as you cannot use su command to become root. If you try this, you’ll end up with error su: user root does not exist.