DigitalMatter Oyster/Yabber

Kjetil Pedersen10 days ago

Have lost updates from my Digital Matter Oyster and Yabber devices.

Decoded HEX:

POST / HTTP/1.1
Host: traccar.XXYY.no:5139
Request-Context: appId=cid-v1:c207665a-d894-42f1-be65-0d0a8cbd0060
Request-Id: |32c1707ae7ab416fac6d1a1859e76b09.f3f15a388c63700d.
traceparent: 00-32c1707ae7ab416fac6d1a1859e76b09-f3f15a388c63700d-01
Content-Type: application/json; charset=utf-8
Content-Length: 824

{"date":"2025-03-16T02:14:43.5974222Z","device":{"sn":"7777777","prod":104,"rev":5,"fw":"9.1","module":"202","iccid":"89518385701534931411","imei":"266679796195871"},"sqn":4007,"reason":20,"lat":-10.13656396071491,"lng":-41.15553876525405,"posAcc":37.51888513272475,"alt":2037,"posInfo":{"GDOP":8.95766001330414,"HDOP":4,"PDOP":3,"BSat":6,"GSat":1,"Src":1},"analogues":[{"id":1,"val":2234},{"id":3,"val":1213},{"id":4,"val":62},{"id":5,"val":3578},{"id":12,"val":7},{"id":13,"val":7},{"id":17,"val":204},{"id":18,"val":2411},{"id":19,"val":27},{"id":20,"val":14}],"inputs":6,"outputs":4,"status":1,"counters":[{"id":0,"val":7065},{"id":3,"val":265},{"id":4,"val":6750},{"id":128,"val":5890},{"id":129,"val":25360},{"id":130,"val":29},{"id":131,"val":4751},{"id":142,"val":463140},{"id":145,"val":8162},{"id":146,"val":337}]}

Protocol changed?

Track-trace10 days ago

Why dont you write more context ?
Have you upgraded ?
Which version of traccar server are you using?

Kjetil Pedersen10 days ago

Using 5.10.
I have not updated, but i know DigitalMatter have updated. The Forwarder at DigitalMatter give this error:

Skjermbilde 2025-03-16 153932.png

Anton Tananaev10 days ago

Have you tried the latest version of Traccar?

Do you have an updated protocol documentation?

Tony Shelver9 days ago

Not that I know what is going on, but I have looked at and talked to Digital Matter, and that error looks like there is an error on the Digital Matter forwarder configuration or, else, a mismatch between that configuration and the Traccar endpoint.
Did you see the message being sent in the Traccar logs?

Just a guess.

Kjetil Pedersen9 days ago

Tony; The decoded HEX is from Traccar log.
Do you use DM trackers and maybe want to share your config? Worked before. But stopped like 52 days ago..

Tony Shelver9 days ago

We looked at them, but didn't carry on with the deal, didn't quite suit our market.

Have you asked DM if they changed the format at all? I have been writing my own integrations between our legacy tracking system, and Traccar, and have found that sometimes a change in network or system permissions have temporarily blocked the system.

Kjetil Pedersen9 days ago

Yes. Have contacted them, but not any luck so far.. Will try to update Traccar tomorrow:)

Kjetil Pedersen9 days ago

Here are traccar-log after update:

2025-03-17 13:08:07  INFO: [Ta1f2ba82: dmthttp < 104.45.178.83] POST /
HTTP/1.1\r\nHost: traccar.xx.yy:5139\r\nRequest-Context:
appId=cid-v1:c207665a-d894-42f1-be65-0d0a8cbd0060\r\nRequest-Id:
|eb6182ae9d4a42cfbd7cbd7d8e9866d6.fe3ba58d91df3fe3.\r\ntraceparent:
00-eb6182ae9d4a42cfbd7cbd7d8e9866d6-fe3ba58d91df3fe3-01\r\nContent-Type:
application/json; charset=utf-8\r\nContent-Length:
831\r\n\r\n{"date":"2025-03-17T12:08:07.2596477Z","device":{"sn":"6666666","prod":182,"rev":1,"fw":"5.1","module":"297","iccid":"89371500621095701417","imei":"610510067985169"},"sqn":6498,"reason":26,"lat":31.760309164866143,"lng":3.805967355805194,"posAcc":84.48151201579343,"alt":2916,"posInfo":{"GDOP":0.22089332865654954,"HDOP":2,"PDOP":4,"BSat":6,"GSat":3,"Src":1},"analogues":[{"id":1,"val":7316},{"id":3,"val":6726},{"id":4,"val":27},{"id":5,"val":1880},{"id":12,"val":15},{"id":13,"val":-89},{"id":17,"val":253},{"id":18,"val":4664},{"id":19,"val":13},{"id":20,"val":-59}],"inputs":7,"outputs":8,"status":2,"counters":[{"id":0,"val":3450},{"id":3,"val":903},{"id":4,"val":1225},{"id":128,"val":3339},{"id":129,"val":95904},{"id":130,"val":88},{"id":131,"val":2556},{"id":142,"val":9145227},{"id":145,"val":3701},{"id":146,"val":155}]}
2025-03-17 13:08:07  WARN: Unknown device - 610510067985169 (104.45.178.83)
2025-03-17 13:08:07  INFO: [Ta1f2ba82: dmthttp > 104.45.178.83] HTTP/1.1
400 Bad Request\r\ncontent-length: 0\r\n\r\n
2025-03-17 13:08:39  INFO: [T42f0ceaf: dmthttp < 104.45.178.83] POST /
HTTP/1.1\r\nHost: traccar.xx.yy:5139\r\nRequest-Context:
appId=cid-v1:c207665a-d894-42f1-be65-0d0a8cbd0060\r\nRequest-Id:
|eb6182ae9d4a42cfbd7cbd7d8e9866d6.dd977f0b1fbadb75.\r\ntraceparent:
00-eb6182ae9d4a42cfbd7cbd7d8e9866d6-dd977f0b1fbadb75-01\r\nContent-Type:
application/json; charset=utf-8\r\nContent-Length:
828\r\n\r\n{"date":"2025-03-17T12:08:39.2352308Z","device":{"sn":"8888888","prod":145,"rev":9,"fw":"9.8","module":"278","iccid":"89616247010477877475","imei":"469477311104203"},"sqn":7659,"reason":26,"lat":-34.3384156531205,"lng":142.51992838825203,"posAcc":41.00424730086851,"alt":2661,"posInfo":{"GDOP":9.54306838601634,"HDOP":3,"PDOP":1,"BSat":0,"GSat":4,"Src":1},"analogues":[{"id":1,"val":2920},{"id":3,"val":1949},{"id":4,"val":35},{"id":5,"val":7741},{"id":12,"val":83},{"id":13,"val":-12},{"id":17,"val":918},{"id":18,"val":4026},{"id":19,"val":86},{"id":20,"val":31}],"inputs":8,"outputs":4,"status":1,"counters":[{"id":0,"val":5943},{"id":3,"val":258},{"id":4,"val":5350},{"id":128,"val":1237},{"id":129,"val":28090},{"id":130,"val":60},{"id":131,"val":10366},{"id":142,"val":4753736},{"id":145,"val":7890},{"id":146,"val":141}]}
2025-03-17 13:08:39  WARN: Unknown device - 469477311104203 (104.45.178.83)
2025-03-17 13:08:39  INFO: [T42f0ceaf: dmthttp > 104.45.178.83] HTTP/1.1
400 Bad Request\r\ncontent-length: 0\r\n\r\n

Ignore the Unknown device, that just a test from DigitalMatter when created a new forwarder, as seen on the previous scrrenshot.

Anton Tananaev9 days ago

Not sure why we need to ignore the unknown device. Can you elaborate?

Kjetil Pedersen8 days ago

That is not a real device.
See response from support here.
Skjermbilde 2025-03-17 165119.png

Not sure how familiar you are with Digital Matter's Forwarder, here a diagram for reference.
1717658345104-1717658345104.png

Anton Tananaev8 days ago

OK, but then what's the point of this test?

Kjetil Pedersen8 days ago

Not sure...
Just did a test.
Captured the test output from DM. Manually posted that to Traccar:
{"date":"2025-03-17T16:28:16.4048802Z","device":{"sn":"1111111","prod":105,"rev":2,"fw":"4.6","module":"353","iccid":"89349493467812254594","imei":"932107325522097"},"sqn":6543,"reason":40,"lat":-22.116219895334325,"lng":-177.39340181963536,"posAcc":21.604855728667616,"alt":2245,"posInfo":{"GDOP":3.428375225541277,"HDOP":1,"PDOP":4,"BSat":11,"GSat":6,"Src":3},"analogues":[{"id":1,"val":4104},{"id":3,"val":6035},{"id":4,"val":73},{"id":5,"val":2378},{"id":12,"val":87},{"id":13,"val":-25},{"id":17,"val":354},{"id":18,"val":4984},{"id":19,"val":23},{"id":20,"val":-11}],"inputs":9,"outputs":0,"status":0,"counters":[{"id":0,"val":6859},{"id":3,"val":521},{"id":4,"val":7266},{"id":128,"val":1298},{"id":129,"val":67142},{"id":130,"val":91},{"id":131,"val":6310},{"id":142,"val":727084},{"id":145,"val":3281},{"id":146,"val":6}]}
and it returned 200 OK, after i added the random test IMEI 932107325522097 to the Traccar server, and sees to work. So the only real issue is the "pointless" test from DigitalMatter. If Traccar returns 200 OK when serial are 1111111, 2222222, 3333333, 4444444, 5555555, 6666666 or 7777777 it should work..

Kjetil Pedersen8 days ago

Did a temporary fix. Sendig all data to a PHP script, so DM always get a 2XX response. And then forward the data to Traccar.

<?php
// Get raw POST data
$rawData = file_get_contents('php://input');

// Prepare log entry with timestamp
$timestamp = date('Y-m-d H:i:s');
$logEntry = "[{$timestamp}] " . $rawData . "\n";

// Append to single log file
$logFile = __DIR__ . '/forwarder.log';
file_put_contents($logFile, $logEntry, FILE_APPEND);

// Setup curl request
$ch = curl_init('http://traccar.URL-xx.yy:5139');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $rawData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Forward headers
$headers = getallheaders();
$curlHeaders = [];
foreach ($headers as $key => $value) {
    if ($key != 'Host') {  // Skip host header
        $curlHeaders[] = "$key: $value";
    }
}
curl_setopt($ch, CURLOPT_HTTPHEADER, $curlHeaders);

// Execute request and get response
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

// Log the response code
$logEntry = "[{$timestamp}] Response Code: {$httpCode}\n";
file_put_contents($logFile, $logEntry, FILE_APPEND);

// Always return 200 OK regardless of forward response
http_response_code(200);
echo "OK";

// Force connection close
if (function_exists('fastcgi_finish_request')) {
    fastcgi_finish_request();
} else {
    flush();
    if (function_exists('ob_flush')) ob_flush();
}
?>

Now it works, until it's finally fixed in Traccar :)