New protocol implementation

Anton Tananaev8 years ago

Yes, that's what I'm talking about. I haven't found any other issues so far.

ak20158 years ago

Hi Anton,

Now port is open and listening but why Decoder class is not being called.When I checked log it only shows below details.

2016-10-25 10:41:10  INFO: [5F4E98B1] connected
2016-10-25 10:41:14 DEBUG: [5F4E98B1: 5105 < 112.110.100.24] HEX: 246c6f632c3836353837393032363737343436342c3030303030303030303030302c562c3030303030303030302c302c3030303030303030302c302c3030302c3030303030302c30302c3030303030302c302c302c302c302c302c303030302c303936302c302e30312c312b
2016-10-25 10:41:15  INFO: [5F4E98B1] disconnected
2016-10-25 10:41:15  INFO: [3A3252FE] connected
2016-10-25 10:41:23 DEBUG: [3A3252FE: 5105 < 112.110.100.24] HEX: 246c6f632c3836353837393032363737343436342c3030303030303030303030302c562c3030303030303030302c302c3030303030303030302c302c3030302c3030303030302c30302c3030303030302c302c302c302c302c302c303030302c303936332c302e30312c312d
2016-10-25 10:42:21  INFO: [3A3252FE] disconnected
2016-10-25 10:42:22  INFO: [7EB48434] connected

Note : Using port 5105 here

Anton Tananaev8 years ago

You have to debug your code and find out why it doesn't work. One thing I see straight away is that there is no new line delimiter, so you can't use "LineBasedFrameDecoder".

ak20158 years ago

But by using LineBasedFrameDecoder I am getting data correctly, can u suggest what should I use ?

2016-10-25 12:35:34 DEBUG: [9615D012: 5105 < 106.67.84.201] HEX: 246c6f632c3836353837393032363737343436342c3030303030303030303030302c562c3030303030303030302c302c3030303030303030302c302c3030302c3030303030302c30302c3030303030302c302c302c302c302c302c303030302c303936322c302e30312c312d
2016-10-25 12:36:31  INFO: [9615D012] disconnected
2016-10-25 12:36:31  INFO: [BE14D5DB] connected
2016-10-25 12:36:39 DEBUG: [BE14D5DB: 5105 < 106.67.84.201] HEX: 246c6f632c3836353837393032363737343436342c3030303030303030303030302c562c3030303030303030302c302c3030303030303030302c302c3030302c3030303030302c30302c3030303030302c302c302c302c302c302c303030302c303935352c302e30312c312b
2016-10-25 12:36:39  INFO: [BE14D5DB] disconnected
2016-10-25 12:36:39  INFO: [2CD102E2] connected
2016-10-25 12:36:44 DEBUG: [2CD102E2: 5105 < 106.67.84.201] HEX: 246c6f632c3836353837393032363737343436342c3030303030303030303030302c562c3030303030303030302c302c3030303030303030302c302c3030302c3030303030302c30302c3030303030302c302c302c302c302c302c303030302c303935392c302e30312c312d
2016-10-25 12:38:13  INFO: [2CD102E2] disconnected
2016-10-25 12:41:47  INFO: [2E6089DD] connected

after decode

$loc,865879026774464,000000000000,V,000000000,0,000000000,0,000,000000,00,000000,0,0,0,0,0,0000,0959,0.01,1-

only problem is getting lat lon 000000000, may be this is the issue

Anton Tananaev8 years ago

It seems like you don't have a clear understanding of what frame decoder is and how it work. If that's the case, I would recommend to research it first.

I would probably use "new CharacterDelimiterFrameDecoder(1024, '+')".

ak20158 years ago

Thanks Anton, But here last character +(plus) can be -(minus) also.

ak20158 years ago

can I use \n or \r with CharacterDelimiterFrameDecoder ?

Anton Tananaev8 years ago

Please read about frame decoder. You clearly don't understand the concept. Device message doesn't include \n or \r, how would you use it?

ak20158 years ago

Hi Anton,

Please help, unable to parse data.The last character may be + or -.How can I handle it ?

Anton Tananaev8 years ago

Use this:

new CharacterDelimiterFrameDecoder(1024, "+", "-")

ak20158 years ago

Thanks Anton for reply, Now I am using new CharacterDelimiterFrameDecoder(1024, “+”, “-“).

but again handler is not being called. I am using StringEncoder and StringDecoder also.

Anton Tananaev8 years ago

It should work as far as I can tell. Debug frame decoder if it doesn't.

Gerardo Rivera7 years ago

Hi my friend

I have a new device (Portman NT1000) this is the string

$PTMLA,865609020890069,A,170428163331,N2726.7180W09938.4055,90,194,NA,09820020,NA,108,9,47765.98,16,GNA

what listener can i use?

Thx

Anton Tananaev7 years ago

Gerardo, how is your question related to the topic?

Gerardo Rivera7 years ago

sorry i will put in a new one