Sending RFID in json file

Ferreira2 years ago

Hello, I would like to know if the equipment's RFID information is sent in the Json file.

See that in the conversion the information is in hexadecimal and in the conversion. RFID:008FB2BEBA39

Could you help us how to send the information in the json file?

We tested it with:
Traccar Version => 64.5.0
Equipment => Sunthec 340UR

The logs:
String log hexdecimal =>

53543330305545583b3531313234383238373b34353b3331313b32303232303730313b31383a34323a30383b3134633934333b2d32322e3937353235373b2d3034332e3337333036353b3030302e3030303b3030302e30303b303b303b303b31322e31343b3130303031303b31393b524649443a3030384642324245424133390d0a3b33453b3030303133353b342e313b313b30303030303030303030303030303b300d

Hexadecimal conversion =>

ST300UEX;511248287;45;311;20220701;18:42:08;14c943;-22.975257;-043.373065;000.000;000.00;0;0;0;12.14;100010;19;RFID:008FB
;3E;000135;4.1;1;00000000000000;0

Json sent =>

{
    "device": {
        "id": 151,
        "name": "SUNTECH RFID",
        "model": null,
        "phone": null,
        "status": "online",
        "contact": null,
        "groupId": 0,
        "category": null,
        "disabled": false,
        "uniqueId": "511248287",
        "attributes": {},
        "lastUpdate": "2022-07-01T18:42:09.192+00:00",
        "positionId": 32255,
        "geofenceIds": []
    },
    "position": {
        "id": 0,
        "speed": 0,
        "valid": true,
        "course": 0,
        "address": null,
        "fixTime": "2022-07-01T18:42:08.000+00:00",
        "network": null,
        "accuracy": 0,
        "altitude": 0,
        "deviceId": 151,
        "latitude": -22.975187,
        "outdated": false,
        "protocol": "suntech",
        "longitude": -43.373145,
        "attributes": {
            "in1": false,
            "in2": false,
            "in3": false,
            "sat": 0,
            "out1": true,
            "out2": false,
            "type": "UEX",
            "hours": 1681000,
            "power": 12.14,
            "charge": null,
            "motion": false,
            "distance": 0,
            "ignition": true,
            "odometer": 0,
            "versionFw": "311",
            "batteryLevel": null,
            "totalDistance": 31.31
        },
        "deviceTime": "2022-07-01T18:42:08.000+00:00",
        "serverTime": "2022-07-01T18:42:09.192+00:00"
    }
}
Anton Tananaev2 years ago

Traccar Version => 64.5.0

There's no such version.

Ferreira2 years ago

Sorry my error 5.0

Marcos Moraes2 years ago

Wouldn't it be version 4.5?

Ferreira2 years ago

I tested with version 4.14 with the same result.

Anton Tananaev2 years ago

There's a bunch of configuration parameters for Suntech. Have you configured any?

https://github.com/traccar/traccar/blob/master/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java#L72-L117

Ferreira2 years ago

I just did the configuration inside the conf file.

I don't know where is the place to configure this information.

Can you help me ? because the RFID information is arriving, it just doesn't go inside the json sent.

Anton Tananaev2 years ago

I just did the configuration inside the conf file.

Please provide what you've configured in the config file specifically for Suntech.

Ferreira2 years ago

my configuration file

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>

<properties>

    <!--

    DO NOT MODIFY THIS FILE. Use traccar.xml instead.

    -->

    <entry key='web.port'>80</entry>
    <entry key='web.path'>./web</entry>

    <entry key='geocoder.enable'>true</entry>
    <entry key='geocoder.type'>nominatim</entry>
    <entry key='geocoder.processInvalidPositions'>true</entry>
    <entry key='geocoder.reuseDistance'>10</entry>
    <entry key='geocoder.url'>http://geocode-contingencia.tecbee.com.br:3001/api/osm</entry>

    <entry key='logger.level'>info</entry>
    <entry key='logger.file'>/var/log/traccar/tracker-server.log</entry>
    <entry key='logger.rotate'>true</entry>

    <entry key='filter.enable'>true</entry>
    <entry key='filter.duplicate'>true</entry>
    <entry key='filter.zero'>true</entry>
    <entry key='filter.skipLimit'>540</entry>
    <entry key='filter.skipAttributes.enable'>true</entry>
    <entry key='filter.skipAttributes'>event,result</entry>
    <!-- <entry key='filter.invalid'>true</entry>
      <entry key='filter.future'>600</entry> -->


    <entry key='coordinates.filter'>true</entry>
    <entry key='coordinates.minError'>30</entry>
    <entry key='event.motion.speedThreshold'>1.11</entry>

    <entry key='event.ignoreDuplicateAlerts'>true</entry>
    <entry key='processing.computedAttributes.enable'>true</entry>
    <entry key='processing.engineHours.enable'>true</entry>


    <entry key='forward.enable'>true</entry>
    <entry key='forward.json'>true</entry>
    <entry key='forward.url'>http://172.18.110.60:8090/scriptcase/app/tecbee_gwa/blank_gwa_v2/index.php</entry>


    <entry key="event.forward.enable">true</entry>
    <entry key='event.forward.header'>Content-Type: application/json</entry>
    <entry key='event.forward.url'>http://172.18.110.60:8090/scriptcase/app/tecbee_gwa/blank_gwa_v2/index.php</entry>


    <entry key='media.path'>./media</entry>

    <entry key='notificator.types'>web,mail</entry>

    <entry key='server.statistics'>https://www.traccar.org/analytics/</entry>

    <entry key='commands.queueing'>true</entry>

    <entry key='database.ignoreUnknown'>true</entry>
    <entry key='database.generateQueries'>true</entry>
    <entry key='database.changelog'>./schema/changelog-master.xml</entry>

    <entry key='database.loginUser'>
        SELECT * FROM tc_users
        WHERE email = :email OR login = :email
    </entry>

    <entry key='database.selectPositions'>
        SELECT * FROM tc_positions WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to ORDER BY fixTime
    </entry>

    <entry key='database.selectLatestPositions'>
        SELECT tc_positions.* FROM tc_positions INNER JOIN tc_devices ON tc_positions.id = tc_devices.positionid;
    </entry>

    <entry key='database.updateLatestPosition'>
        UPDATE tc_devices SET positionId = :id WHERE id = :deviceId
    </entry>

    <entry key='database.selectEvents'>
        SELECT * FROM tc_events WHERE deviceId = :deviceId AND eventTime BETWEEN :from AND :to ORDER BY eventTime
    </entry>

    <entry key='database.selectStatistics'>
        SELECT * FROM tc_statistics WHERE captureTime BETWEEN :from AND :to ORDER BY captureTime
    </entry>

    <!--
    <entry key='database.insertPosition'>
       SELECT id FROM tc_devices WHERE id = :deviceId
    </entry>
    -->
    <entry key='gt06.port'>5023</entry>
    <entry key='gt06.timezone'>-10800</entry>
    <entry key='suntech.port'>5011</entry>

</properties>
Anton Tananaev2 years ago

Have you checked the link I provided? I don't see any of those configuration options in your config.

Ferreira2 years ago

Yes, but I'm trying to understand how to configure it inside the conf file.

I'm having difficulty finding the parameter referring to the field who comes from the RFID

Anton Tananaev2 years ago

You should check the source code to understand how it work. You need to enable at least HBM, but possibly more depending on your device configuration and format.

Ferreira2 years ago

was seeing exactly that would be the HBM.

Would be like this ? How would you use the key for the HBM?

<entry key='suntech.protocolType'>1</entry>
Anton Tananaev2 years ago
<entry key='suntech.hbm'>true</entry>
Ferreira2 years ago

I enabled and there was no change in the json generation