Help with Custom Protocol

271 views
Skip to first unread message

Scott Carter

unread,
Jun 17, 2015, 1:22:11 PM6/17/15
to xsocke...@googlegroups.com
I am planning to use XSockets to setup a TCP server for custom GPS devices to report their location.  I am having a difficult time creating the custom protocol, as I am a VB programmer, and have found no examples in my native programming language.  I believe that if I can get some initial help, I will be able to figure out the rest.  

My situation is fairly simple.  I will be basically handling 3 messages from the device.  All messages will have a start character of "(" and an end character of ")".  The initial "login" message has the following format:

"(" + 11 Character DeviceID + "BP05" + 77 data characters + ")"

For example:
(01363278450BP05000013632782450080524A2232.9806N11404.9355E000.1101241323.8700000000L000450AB)

When the server receives this message, it needs to respond with:

"(" + 11 Character DeviceID + "AP05" + ")"

Like this:
(040331141830AP05)


The second message is what they call a handshake:

"(" + 11 Character DeviceID + "BP00" + 15 data characters + "HSO" + ")"

Server will respond with:
(040331141830AP01HSO)


If someone can get me started modifying the Custom Protocol example to handle these messages, I should be able to figure out the rest on my own.

Thanks in advance,

Scott




Ulf Björklund

unread,
Jun 18, 2015, 3:52:27 AM6/18/15
to xsocke...@googlegroups.com
Hi Scott

Sounds super cool, so who can say no to helping you with that? :)

I am out traveling but have a few hours at the next airport. Will try to post you a custom protocol then. I prefer using the v5 pre release but I am guessing that you use v4?

Regards
Uffe

Scott Carter

unread,
Jun 18, 2015, 7:42:06 AM6/18/15
to xsocke...@googlegroups.com
I'd be glad to use v5, if that is what you prefer to work with.  Let me know if you need more details of the protocol the devices will be using.

There will be other messages that have the following format:

(088000210425BR01150606A3029.1655N08409.1201W000.0095955288.0000000000L00000000)

DeviceID
Command
Data sent

Thanks again,

Scott

Ulf Björklund

unread,
Jun 18, 2015, 9:12:35 AM6/18/15
to xsocke...@googlegroups.com
Hi

The more I know about the messages the better the sample will be.
So if you have details about what the data represents that will be awesome.

Regards
Uffe

Scott Carter

unread,
Jun 18, 2015, 12:42:35 PM6/18/15
to xsocke...@googlegroups.com
Here is the protocol guide.  It is a rather poorly translated document, but I was able to figure out most of it.  The sections that you want are:

3.2.1 and 3.2.2 for the devices login and handshake messages

3.2.6 is for the BR00 message to report location.

4.1 defines the GPS data area.

Let me know if you need anything else.


Scott
tk102-b-3 GT02A TK206-1 GPS tracker Communication__ Protocol.pdf

Ulf Björklund

unread,
Jun 22, 2015, 4:43:20 AM6/22/15
to xsocke...@googlegroups.com
Hi Scott


Created a very basic sample.
I know that I am not following the protocol, but I think you will get the idea.

Please let me know if you need some explanation and we can have a short Skype meeting where I walk you through this.
Send an email to uf...@xsockets.net if you would like to have a Skype meeting.


Regards
Uffe

Vinicius Sin

unread,
Aug 6, 2015, 12:22:08 AM8/6/15
to XSockets.NET Developer forum
Hi Scott I have the same problem of you. But I am listening to the device on a port using a .NET socket. My problem with this protocol is not to listen and recognize the coordinates. My problem is that the device send multiple times the same coordinates and it happens all the times with command BR01. After the car stops it appears it coming again on the map but it is stopped because the device is sending again the path . I believe that it is waiting a message for the br01 command. Do you know what message I should return when the command is br01?
Thank you very much!

Ulf Björklund

unread,
Aug 6, 2015, 4:27:03 AM8/6/15
to XSockets.NET Developer forum
Hi 

I never got any feedback on the protocol sample from Scott.
Are you using the protocol I wrote, or the question is rather... Are you using XSockets at all?

I have a project where I need a GPS with XSockets myself, that is why I am asking. The GPS you are using, is it any good?

Regards
Uffe
Reply all
Reply to author
Forward
0 new messages