Freematics ONE firmware for full traccar support with OBD data?

Vladimir S3 years ago

Hi, anybody have software with traccar support with sending obd data? Freematics have firmware_v4 (traccar_client_sim5360) but it is without code to send obd data to server. I have tried to create simple script to fetch data from freematics hub and send it via osmand to server. But there are lot of issues with firmware, it is switching to standby mode when obd is disabled, when no motion is here and battery. I have tried to disable these not useful functions but without success. Maybe some skilled arduino programmer know how to write traccar client with obd support and sleep disable function. Thanks a lot

Anton Tananaev3 years ago

Is there a reason you are using Traccar Client version of the firmware and not the standard one?

Vladimir S3 years ago

How can i use telelogger_v4 with traccar? It is different than v5 version. I have tried freematics supported protocol.. it shows me freematics data received but no update in traccar..

Anton Tananaev3 years ago

Hmm.. not sure about versions.

Vladimir S3 years ago

Is there freematics native support in traccar? Same protocol as used in freematics hub?

Anton Tananaev3 years ago

Have you tried freematics port?

Vladimir S3 years ago

Yes.. i can look at old logs.. i will send it..

Vladimir S3 years ago

Hi..here are logs:

2021-02-10 14:40:39  INFO: [c7a0dc23: freematics < 85.237.234.71] HEX: 4d305a523458302344463d343230382c5353493d2d37352c45563d312c54533d33303635352a4436

dehex: M0ZR4X0#DF=4208,SSI=-75,EV=1,TS=30655*D6

Vladimir S3 years ago

Device has only SERVER... NO logs

Anton Tananaev3 years ago

Doesn't look like it sends any location data.

Vladimir S3 years ago

Yes..device shows only SERVER..NO.. it not try to send location data.. it thinks that there is no server response and it not try to send GPS. I think this si really poor device support from freematics..

there is no real traccar support on 'one' device.. there is 10month old application which is sending only location to traccar server no obd.. why my device not communicate with server, when there is freematics protocol support on port 5170? It will be fair to add comment to traccar supported devices tab.

somtehing like this.. Freematics ONE is only supported with osmand protocol on 5055..

users will be announced and may buy more expensive device with real support.

Anton Tananaev3 years ago

If you know what the issue is exactly and what response is expected, happy to fix it.

Vladimir S3 years ago

Dont know exactly.. this is part of code from device...

bool notify(byte event)
{
  cache.header(devid);
  char buf[32];

  if (event == EVENT_LOGIN) {
    if (state.check(STATE_OBD_READY)) {
      char vin[128];
      if (obd.getVIN(vin, sizeof(vin))) {
        Serial.print(F("VIN:"));
        Serial.println(vin);
        cache.dispatch(buf, snprintf_P(buf, sizeof(buf), PSTR("VIN=%s"), vin));
      }
    }
    cache.dispatch(buf, snprintf_P(buf, sizeof(buf), PSTR("DF=%u"), DEV_SIG | (unsigned int)state.state));
  }
  int rssi = net.getSignal();
  if (rssi) {
    Serial.print(F("RSSI:"));
    Serial.print(rssi);
    Serial.println(F("dBm"));
    cache.dispatch(buf, snprintf_P(buf, sizeof(buf), PSTR("SSI=%d"), rssi));
  }
  cache.dispatch(buf, snprintf_P(buf, sizeof(buf), PSTR("EV=%X"), (unsigned int)event));
  cache.dispatch(buf, snprintf_P(buf, sizeof(buf), PSTR("TS=%lu"), millis()));
  cache.tailer();

  Serial.print(F("SERVER.."));
  for (byte attempts = 0; attempts < 3; attempts++) {
    Serial.print('.');
    if (!net.send(cache.buffer(), cache.length())) {
      delay(1000);
      continue;
    }
    if (event == EVENT_ACK) {
      Serial.println(F("ACK"));
      return true; // no reply for ACK
    }
    // receive reply
    delay(1000);
    int len;
    char *data = net.receive(&len);
    if (!data) {
      // no reply yet
      
      continue;
    }
    data[len] = 0;
    // verify checksum
    if (!verifyChecksum(data)) {
      Serial.println(data);
      continue;
    }
    char pattern[16];
    snprintf_P(pattern, sizeof(pattern), PSTR("EV=%u"), event);
    if (!strstr(data, pattern)) {
      continue;
    }
    lastSyncTime = millis();
    connErrors = 0;
    // success
    Serial.println(F("OK"));
    return true;
  }
  Serial.println(F("NO"));
  return false;
}
Anton Tananaev3 years ago

What is EVENT_ACK value?

Vladimir S3 years ago

Here #define EVENT_ACK 6