Teltonika FBM130 SOS

Giovannic14 days ago

Hello, I have an FMB130 GPS with the SOS configuration set to DIN3 high. When I activate the SOS, Traccar doesn't detect it. What configuration do I need to set up to make the SOS function work? thanks

Cristian14 days ago

you tried with calculated attributes?

Giovannic14 days ago

fmb130 attributte.jpg

error fmb130 error.jpg

fmb130 ain2.jpg

Thanks Cristian, I already tried with calculated attributes and with the variable din3 it throws an error, and with ain.2 it doesn’t throw an error, but it doesn’t do anything either

Cristian14 days ago

and adding the gps model?

Cristian14 days ago

And I think it is di3 and not din3.

Anton Tananaev14 days ago

You need to make sure that in your expressions you're using attributes that your device actually sends. Not randomly guessing names. Check more details in the popup to see everything your device reports and the names are in Traccar.

Byron 10 days ago

Sin título.png

Giovannic3 days ago

I already solved it. I tried using calculated attributes with the expression in3 == 1 ? "sos" : null, but it kept throwing an error saying that the variable in3 doesn't exist. So I decided to check TeltonikaProtocolDecoder.java, and in the line:

register(3, null, (p, b) -> p.set(Position.PREFIX_IN + 3, b.readUnsignedByte() > 0));

it's clearly storing the value in a variable in3, but for some reason Traccar doesn't recognize it. So instead of saving the variable, I decided to directly trigger the SOS alarm like this:
// Modified version to trigger SOS alarm:

register(3, null, (p, b) -> {
    if (b.readUnsignedByte() > 0) {
        p.addAlarm(Position.ALARM_SOS);
    }
});

And now it's working correctly. I'm sharing this in case it's helpful for someone else.