not receiving data while using domain name

Khaksar4 years ago

Hello supporters,
I have a fresh installation of Traccar, installed by following the instruction provided here. Traccar is started and receiving data.

Problem:
I am testing this fresh installation with a device from LK-GPS (LK-209) which is using h02 protocol with port 5013. This device is connecting to the server and sending location data normally while I set the IP of the server to the device. But, if I set the subdomain (which is pointed to the same IP), it stops sending data immediatly.

On the server logs, changing to the subdomain, I can see only:

2021-10-09 22:28:18  INFO: [2eaf320b] connected
2021-10-09 22:32:10  INFO: [2eaf320b] disconnected

I added an "A" record to my DNS provider which points to the server-ip where I installed the Traccar.
I changed the web.port to 80 on Traccar.
I am not using SSL and no Apache installed.

I suspect if the device has problem, but when I pointed the device to demo.traccar.org, it was working without any problem.

Any help will be appreciated.

Anton Tananaev4 years ago

If it works with IP directly, but doesn't work with domain, then the issue is clearly with the domain. Are you sure it's already propagated? What was/is the timeout?

Khaksar4 years ago

Thank you @Anton for the reply.

I am sure the domain is already propagated, as I can browse it through different brwosers and devices and able to login to Traccar web interface through same subdomain. I checked it through this dns checking tool and it shows fully propagated. Also, If I set the same subdomain with Traccar Client app, it is doing the location update normally without any problem.

I didn't set any timeout, so it is default.

Anton Tananaev4 years ago

And what's the default?

Khaksar4 years ago

From timeout, I was thinking if you are asking about server.timeout which I didn't set.
If you mean the TTL it is 7200.

If you are asking for any other timeout, please let me know and I will report it.

Anton Tananaev4 years ago

I was talking about domain TTL. So, you tested it 2 hours after you set it? If yes, then the issue must be with device.

Khaksar4 years ago

According to your suggestion I waited even 12 hours and tested again, unfortunately no luck.

I wonder, if device has the issue then why:

  • I am able to connect the same device to demo.traccar.org, demo3.traccar.org and lkgps.net
  • I can see connected in Traccar logs when the device starts up, and disconnected after 5 minutes when device's light turns off.

I tried with two of my servers, both have the same problem, even I tried a different domain name and the result was same.

I don't know exactly if connected appears in log then what happenned with device and server, but logically if it is coming, then it means the device was able to find the server and send a connection message. And also, when the lights of device are turning off, immediatly a disconnected message appear on the logs again, which also signals a connection. @Anton, am I right with this assumption?

Still struggling...

Anton Tananaev4 years ago

Well, if you are sure that's connection from your device, then it must be connecting. My guess is still that it's a network or device issue.

Track-trace4 years ago

@Khaksar Can you show what you have set exactly in your device to point it to the sub domain (the config).

Khaksar4 years ago

Hello,
I just ended up with my struggle and I was planning to share the result here in forum, in case it helps someone else if heading here.

As @Anton and I were both thinking of it as a network issue then I tried to solve it with my DNS provider, after several tests we noted there is no issue with DNS. We tried different DNS providers as well but the result was the same, even demo.traccar.org also stopped working with this mystery device ;)

Sometimes, it was sending the position data while the devices were in movement, but not all the time.

Finally I found:
These specific devices LK-209 are not happy with subdomains to set it as domain for them, but if we change it to top level domain names it will immediately start working after setting up in device configuration. Of course it was working with IP without any problem.

So, we changed to top level domain and after several tests, the issue seems to be resolved.

Thanks @Anton for the help and of course for the nice platform as well.

Track-trace4 years ago

@Khaksar

Nice to hear you have solved it. I wonder though, if you have a fixed server ip. Then pointing it directly to the server ip would be better. Since then there is no need for DNS translation to server ip.

Khaksar4 years ago

@Track-trace,
Yeah, I know about fixed and floating IPs, but my intention is to have the flexiblity of changing between servers, configuring failover and load balancing.

Anton Tananaev4 years ago

Then pointing it directly to the server ip would be better.

It's never better. It's a bad practice. If server changes you have to reconfigure all devices.

Track-trace4 years ago

@Anton

Really ? Major companies i know, who have more then 10 million gps devices online use fixed ip for their devices (like 3G-elec etc). And from their documents i read there is more delay if not using fixed ip. Which seems logic to me.

Anton Tananaev4 years ago

The only reason to use IP address directly is if your devices don't support DNS properly. There should be no delays 99.9% of the time if DNS caching is implemented properly.