Help with Driver Identification for Suntech Protocol

tambiu3 years ago

Hi there, Iam triend to get driver identification with ibutton + suntech ST340UR device, the traccar logs shows below

ST300ALT;511311670;45;311;20210324;14:52:31;529724;-23.303130;-051.151558;003.278;307.08;8;1;11;12.46;100000;59;000078;4.1;0;01A8C02C180000;0

01A8C02C180000 is the data when I put the ibutton, How to get it for driver identification ? thanks

Anton Tananaev3 years ago

Have you configured the decoder? Suntech protocol support a lot of configuration options. Check the source code.

tambiu3 years ago

Sorry, do you mean that I need to change traccar source code ?

Anton Tananaev3 years ago

No, I'm talking about configuration. You can find configuration parameters in the code.

tambiu3 years ago

I did not find a way to get the driver id, the logs show

ST300ALT;511311670;45;311;20210324;14:52:31;529724;-23.303130;-051.151558;003.278;307.08;8;1;11;12.46;100000;59;000078;4.1;0;01A8C02C180000;0

where 01A8C02C180000 is the ID , but can get it on traccar database

I have looked in the decoder

the code I have founded

            if (values.length - index >= 2) {
                String driverUniqueId = values[index++];
                if (values[index++].equals("1") && !driverUniqueId.isEmpty()) {
                    position.set(Position.KEY_DRIVER_UNIQUE_ID, driverUniqueId);
                }
            }

Can you help how to make it work ? do I need to change the protocol and compile the traccar ? thanks

eueduardo310 months ago

did you get a solution for the driver not being identified in the traccar with the ST340UR devices?

tambiu10 months ago

yes, I did to modify the suntech protocol and recompile the code,

if (protocol.equals("ST300") || protocol.equals("ST500") || protocol.equals("ST600")) {
#só acrescentar a linha abaixo
    position.set(Position.KEY_DRIVER_UNIQUE_ID, values[values.length - 2]);
    
index += 1; // model
}
eueduardo310 months ago

Tambiu, thank you very much! thanks for the help!

eueduardo310 months ago

acho que você também é brasileiro né! brigadao demais cara, me ajudou muito mesmo, vc não tem ideia

tambiu10 months ago

Opa , sim sou brasileiro, apanhei p fazer isso funcionar, mas era só um teste, por fim nem usei mais , espero que consiga aí, sucesso pra vc , abraço

eueduardo310 months ago

me ajudou muito. E funcionou!
sucesso para você também.

eu só estou tendo problema agora porque eu vinculo o nome dos motoristas aos ids, mas lá na aba status nunca aparece o nome, sempre só o id do ibutton, caso você tiver alguma sugestão sobre esse tipo de problema também. estou usando o traccar da última versão nativo, web modern.

Eu só fiz um pouco diferente da sua sugestão, pois o rastreador estava enviando 00000 como ID, então coloquei um IF para filtrar essas situações:

if (!values[values.length 2].equals("00000000000000")) {
    position.set(Position.KEY_DRIVER_UNIQUE_ID, values [values.length - 2]);
    System.out.println("novo valor de motorista atrubuido ");

I'm just having a problem now because I link the drivers name to the ids, but there in the status tab the name never appears, always just the ibutton id, in case you have any suggestions about this type of problem too. I'm using traccar from the latest native version, modern web.

tambiu10 months ago

entao Eduardo, eu fiz esses testes uns 2 anos atras, e depois nem usei , era um amigo que queria fazer funcionar, daí consegui achar essa solução, eu nao pego clientes que precisam de identificador de motorista, mas na época que fiz deu tudo certo, reconheceu o motorista, nao tive problemas nao, mas eu usava versao antiga , versao 4.12, nao sei se vai dar erro ou funcionar adequadamente nas novas versoes. Infelizmente nao consigo te ajudar nessa. Atualmente estou usando a versao 4,15, mas sem alterações no código até pq eu nao uso.

eueduardo310 months ago

entendi! muito obrigado pelo retorno!
vou testar na versão legado, ou em versões mais antigas para ver se resolve, acho que o problema é só com a interface moderna, eu acho...