Test data for Positions table

Kowshik5 months ago

I have tried manually adding data to tc_positions table and tried fetching positions data using API, but getting only empty json as a response. Is there any way to put in some dummy data in the positions table to check the API?

Ashok Chandra5 months ago

you can use traccar client app

Anton Tananaev5 months ago
Kowshik5 months ago

Thanks, this helped.

Kowshik5 months ago

I am trying to simulate one more device simultaneously. I replicated the same script with different id(123456789012346), but it throws an error:

Traceback (most recent call last):
  File "test-generator2.py", line 82, in <module>
    send(conn, lat1, lon1, altitude, course(lat1, lon1, lat2, lon2), speed, battery, alarm, ignition, accuracy, rpm, fuel, driverUniqueId)
  File "test-generator2.py", line 55, in send
    conn.getresponse().read()
  File "/usr/lib64/python3.7/http/client.py", line 1373, in getresponse
    response.begin()
  File "/usr/lib64/python3.7/http/client.py", line 319, in begin
    version, status, reason = self._read_status()
  File "/usr/lib64/python3.7/http/client.py", line 288, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
Anton Tananaev5 months ago

You probably forgot to register the device on the server.

Kowshik5 months ago

No, I have added the device with the same ID as well.

Anton Tananaev5 months ago

Have you checked server logs?

Anton Tananaev5 months ago

Please make sure you do all the basic troubleshooting first before asking for help. And provide all the findings.

Kowshik5 months ago

This is what the log says:

2024-07-23 15:24:33  INFO: [T68f9544e] connected2024-07-23 15:24:33  INFO: [T68f9544e: osmand < 127.0.0.1] 474554203f69643d3132333435363738393031323334362674696d657374616d703d31373231373438323733266c61743d34382e3835343738266c6f6e3d322e33343533343726616c7469747564653d35302662656172696e673d33342e323338313138373332313137342673706565643d3026626174743d383026616c61726d3d736f732669676e6974696f6e3d66616c73652661636375726163793d3130302672706d3d373930266675656c3d363926647269766572556e6971756549643d31323334353620485454502f312e310d0a486f73743a206c6f63616c686f73743a353035350d0a4163636570742d456e636f64696e673a206964656e746974790d0a0d0a2024-07-23 15:24:33  INFO: [T68f9544e] error - Device is disabled - SecurityException (Disableable:32 < ConnectionManager:138 < BaseProtocolDecoder:140 < ...)
2024-07-23 15:24:33  INFO: [T68f9544e] disconnected
Anton Tananaev5 months ago

Why would you disable the device? That's exactly the problem here and it tells you the problem with very clear message.