Inquiry Regarding Jimi JC261 Camera Integration with Traccar

Rishi5 days ago

Hi Team,

I hope this message finds you well.

I am currently exploring the possibility of integrating the Jimi JC261 camera with the Traccar platform. Specifically, I am interested in configuring the position packets to be sent to the Traccar server. For the live video functionality, we plan to handle it separately.

Could anyone kindly provide information on whether the Jimi JC261 camera is supported by Traccar? If so, I would appreciate details on the specific port configuration required for the position packets.

Thank you in advance for your assistance.

Anton Tananaev5 days ago

I'm pretty sure it's supported. Check this page:

https://www.traccar.org/clones/

Rishi5 days ago

Okay, thank you. Just to confirm, video from the dash cam is not supported in Traccar, right?

Rishi2 days ago

Hi,

The Jimi JC261 GPS device that I need to connect to both Traccar (port 5023—since the position packets are starting with 78, I hope it is the correct port as per the documentation) and a Jimi IoT Hub (port 21100). The device itself can only connect to a single server, so I created a Node.js TCP proxy that listens on a local port and forwards all device packets to both Traccar and the Jimi Hub.

Here’s the challenge:

Traccar marks the device offline if no data is received within 160 seconds.

The device only sends position packets every 5 minutes (300 seconds).

When the device first connects, Traccar receives data and shows the device online.

After ~3 minutes, Traccar closes the connection due to inactivity.

The next device packet (after 5 minutes) does not reach Traccar because the proxy socket is not updated correctly, and the device is shown offline.

I do not want to increase Traccar’s global timeout, because that could mask genuinely offline devices and create other issues.

My questions:

What is the recommended approach for devices that send data less frequently than Traccar’s timeout, without adjusting the server timeout?

Is this the standard approach for receiving the data in the proxy service and then sending it to Traccar and the IoT hub?

Are there any best practices for forwarding data through a proxy in this scenario?

I can provide my Node.js proxy code if needed.

Thanks in advance for your guidance!

Anton Tananaev2 days ago

Why is the timeout 160 seconds?

Andres2 days ago

Rishi,
could you also share the Node.js TCP proxy you created please?

Rishi2 days ago

Thanks for your response. The 160-second value was chosen as a safe default for detecting genuinely inactive connections, rather than being specific to our device.

However, in our case, increasing the timeout wouldn’t resolve the issue. If the device actually goes offline, the same problem would still occur. Therefore, I’d like to know what the best approach would be for handling a setup where both the camera and Traccar need to be integrated within a single device.

Thanks!

Anton Tananaev2 days ago

So it's not a timeout issue and the device disconnects by itself? Then what is the problem?

Rishi2 days ago

Hi,

Here is the proxy setup I have implemented using Node.js and the TCP server created with the net package.

const net = require("net");
const dotenv = require("dotenv");
const fs = require("fs");

dotenv.config();

const TRACCAR = { host: process.env.TRACCAR_HOST, port: +process.env.TRACCAR_PORT };
const JIMI_HUB = { host: process.env.JIMI_HOST, port: +process.env.JIMI_PORT };
const LOCAL_PORT = +process.env.LOCAL_PORT;
const LOG_FILE = process.env.LOG_FILE || "logs/proxy.log";

if (!fs.existsSync("logs")) fs.mkdirSync("logs", { recursive: true });

function log(msg) {
  const line = `[${new Date().toISOString()}] ${msg}`;
  console.log(line);
  fs.appendFileSync(LOG_FILE, line + "\n");
}

function createForwardSocket(name, host, port) {
  let socket = new net.Socket();

  const connect = () => {
    log(`${name}: connecting to ${host}:${port} ...`);
    socket.connect(port, host);
  };

  socket.on("connect", () => log(`${name}: connected`));
  socket.on("error", (err) => log(`${name} error: ${err.message}`));
  socket.on("close", () => {
    log(`${name}: connection closed, retrying in 5s`);
    setTimeout(connect, 5000);
  });

  connect();
  return socket;
}

const server = net.createServer((deviceSocket) => {
  const deviceId = `${deviceSocket.remoteAddress}:${deviceSocket.remotePort}`;
  log(`Device connected: ${deviceId}`);

  const traccarSocket = createForwardSocket("Traccar", TRACCAR.host, TRACCAR.port);
  const jimiSocket = createForwardSocket("JimiHub", JIMI_HUB.host, JIMI_HUB.port);

  deviceSocket.on("data", (data) => {
    log(`data recieved : ${data.toString("hex")}`)
    traccarSocket.write(data);
    jimiSocket.write(data);
  });

  traccarSocket.on("data", (data) => deviceSocket.write(data));
  jimiSocket.on("data", (data) => deviceSocket.write(data));

  deviceSocket.on("error", (err) => log(`Device ${deviceId} error: ${err.message}`));
  deviceSocket.on("close", () => {
    log(`Device disconnected: ${deviceId}`);
    traccarSocket.destroy();
    jimiSocket.destroy();
  });
});

server.listen(LOCAL_PORT, () => log(`Proxy listening on port ${LOCAL_PORT}`)); 
Rishi2 days ago

Hi Anton,

When we configure the device to send packets directly to the Traccar server (IP and port 5023), this issue occurs — the device disconnects, but once it sends the next packet, it comes back online automatically.

However, in our proxy setup, this recovery doesn’t happen. I just wanted to confirm whether the approach we’re following is correct, or if there’s an existing implementation or recommended method for handling this kind of setup.

Thanks!

Anton Tananaev2 days ago

Helping with your proxy script would be out of scope for my help, but if there's some specific Traccar issue you want to discuss, let me know.

Rishi2 days ago

I just wanted to know whether my proxy setup is a valid approach and if anyone has implemented something similar before. That’s fine — I’ll try to work it out on my end. Thank you!