traccar / traccar

Traccar GPS Tracking System
https://www.traccar.org
Apache License 2.0
5.26k stars 2.58k forks source link

Enfora Protocol for Binary #1078

Closed gioramies closed 7 years ago

gioramies commented 9 years ago

Hi. @tananaev

I would like to develop the Enfora protocol to read binary messages. Is this handbook the right one to do it?: http://s193925491.onlinehome.us/Enfora_MTGL/GSM2000AN009_-_Mobile_Tracker_Output_Message_Header_Decoding_-_Revision_1%5B1%5D.02.pdf Will I just need the Gt02ProtocolDecoder as foundation or will need a FrameDecoder also?

Thanks. Regards.

tananaev commented 9 years ago

The problem with Enfora is that it doesn't send the field mask, so there is no way to decode it on the server side without providing some additional info.

gioramies commented 9 years ago

Thank you for the tip, I figured out how and did it. Already sent you by email the Enfora Binary Protocol Decoder with BITMASK = 1310719, if you want to include it in the project.

tananaev commented 9 years ago

Can you extend your decoder to support any mask?

gioramies commented 9 years ago

I don't know exactly how to do it right now, and there are more than 10 possible masks. I read that can configure the modem to send the mask within the message and then use if/else to decode the message according to the mask, but don't know how yet.

Few weeks ago I changed the original EnforaProtocolDecoder to make it work with the 528454 mask (in ascii: https://github.com/tananaev/traccar/issues/955), because traccar is supporting only one mask (in ascii, but don't know which one), and althoug it is easier to decode any message in ascii, if someone wants to use binary, below is a Bitmask Calculator (needs some improvements), to find out the bitmask you have to use depending of what parameters you want to receive, anyway, the bitmask 1310719 for binary is a really good one. Hope it helps.

https://github.com/crofty/Enfora-Event-Code-Calculator

tananaev commented 9 years ago

Can you try various combinations of flags and provide me with HEX message examples. It would help me to implement full protocol.

gioramies commented 9 years ago

Using the handbook I'm going to develop a detailed Bitmask Calculator like the one in the link, with more explanations until anyone can make the combinations and know what parameter will be in each byte of the message, and also the bitmask and the maximum message length. This is the most I can do because I don't have a test device to reprogram and obtain the example messages. I will get in touch after done it.

gioramies commented 9 years ago

Hi. I have a device for testing, how can I help you now to implement the full protocol to include it in traccar, and also event messages.

tananaev commented 9 years ago

As I said before, you can try different variations of flags and get corresponding HEX messages from device.

gioramies commented 9 years ago

Hi. After a long time I send you an email with the messages. I'm going to have a modem to work with it.

gioramies commented 9 years ago

I'm using the Decimal Bitmask 1835007 that send a binary message. I have identified the events and think we assign the identification number of every event when configuring the modem, so, think the identification I have done is only usefull with my configuration file. Would you like the work I did? Like I said maybe it just works with my configuration file (I can share it). And think the bitmask 1835007 is a really good one, and consume less mobile data than another in ascii. Regards.