data not set in position in alematics protocol

kartik6 years ago

hi
I am using alematics protocol for that i configure port 5140 in my device. this protocol give string kind of message . i get message using this protocol in traccar source code . now my question is that my message parser with pattern but when if condition arravies for parser.matches() it return false .
i am talking about following condition in alematicsprotocolDecoder

        if (!parser.matches()) {
            return null;
        }

following is my message :

$T,2,64,866050035975497,20180726103446,20180726103514,23.033305,72.558032,0,0,41,5.4,4,0,0,0.000,12.960,0,
$T,2,65,866050035975497,20180726103646,20180726103736,23.033305,72.558032,0,0,41,5.4,4,0,0,0.000,12.976,0,0

can you please tell me why this happen with traccar code ?

Thanks for Your help.

Anton Tananaev6 years ago

I guess format is slightly different or there is some issue in the decoder.

kartik6 years ago

Thanks for your reply .
can you please tell me how can i solve this issue ?

my message is : -

$T,2,289,866050035975497,20180730062446,20180730104002,23.033445,72.557850,0,0,85,4.9,5,0,0,0.000,13.056,986,0

i used traccar alematics protocol decoder .

Anton Tananaev6 years ago

I guess that you need to fix regex pattern.

kartik6 years ago

Thank you Anton.
I find following things message and it's pattern can you please tell me what's wrong with pattern and message ?

\$T,        								$T
(\d+),				 					 2
(\d+),									289
(\d+),									866050035975497
(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2}),			20180730062446
(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2}),			20180730104002
(-?\d+\.\d+),								23.033445						
(-?\d+\.\d+),								72.557850
(\d+),									0
(\d+),									0			
(-?\d+),								        85
(\d+\.\d),								        4.9
(\d+),									5	
(\d+),									0
(\d+),									0
(\d+\.\d+),								0.000								
(\d+\.\d+),								13.056	
(\d+),									986
(?:0,\$S,								        0
(.*)|(\d+),
(.*))									

for last two i can't get any things .

Anton Tananaev6 years ago
kartik6 years ago

Thank You Anton it is work for me .