Sending data from Teltonika FMB003 to Traccar behind Nginx

Foo3 months ago

I have Traccar up and running via Docker. I use Nginx as a reverse proxy to map its port 81 to the external port 443 (SSL) -> proxy_pass http://127.0.0.1:81; as well as proxy_pass http://127.0.0.1:81/api/socket; for the API calls. The web manager runs perfectly, as well as the Traccar Client on an iPhone.

Now I bought a Teltonika FMB003 for my car. I configured it and everything (GPS, GPRS, ODB stuff) works.
But it seems like it is not connecting to my server. I use the same as data to connect as in the iOS app: Hostname (traccar.server.com no protocol) and port 443 (SSL).

Any ideas what the problem is? Perhaps the SSL?

Track-trace3 months ago

Your tracking device should connect on a specific protocol port on your server.

https://www.traccar.org/troubleshooting/

Foo3 months ago

That's what I am trying to solve at the moment. netstat -nlptu | grep 5027 shows, that the port is forwarded to Docker.

Track-trace3 months ago

And did you check that the server port has acces from the internet with a port checker ?

If so you logicly also check your traccar server log.

Foo3 months ago

I did both. This is what I get in the logfile, when I check via https://www.traccar.org/port-check/

2024-02-11 19:00:45  INFO: [Tc2ffe65c] connected
2024-02-11 19:00:45  INFO: [Tc2ffe65c] disconnected
2024-02-11 19:00:45  INFO: [Tc2ffe65c] error - NullPointerException (... < ConnectionManager:191 < MainEventHandler:168 < ... < WrapperInboundHandler:50 < ...)
Anton Tananaev3 months ago

Looks like the port is accessible, so the issue must be with the device .

Foo2 months ago

Yes, but I don't find out why. I tried the usual things (curl, netcat, test-generator.py) and nothing comes through. When I use the port check, it says "open". I also checked iptables and ip6tables. The port is open for TCP and UDP.

Entry in the tracker-server.log if I use the port check:

2024-02-15 09:28:29  INFO: [Tf383a40d] connected
2024-02-15 09:28:29  INFO: [Tf383a40d] disconnected
Foo2 months ago

Just checked and the device posts data to a Traccar demo server, so this seems not to be the problem.
What I really don't understand: Traccar iOS app works (port 5055), Traccar port check works (port 5027 and any other port opened by Traccar), everything else from outside does not work. Does the app and the port check connect differently than netcat or curl?

Track-trace2 months ago

So where do you actually connect point your device to: ip/port

Logicly if you run that traccar server locally, you should also forward the device port on you internet routerto your local server..

If in this case the device port is 5027 you should foward it from your internet router to your local traccar server. And only then when you could reach it through a port checker you would see device data in traccar server log if you pointer the device correctly

Foo2 months ago

It's a "real" server, no hosting at home. I double checked iptables etc. As I wrote, I don't understand why one client works, but others don't.

iptables and ip6tables:

-A INPUT -p tcp -m tcp --dport 5027 -j ACCEPT
-A INPUT -p udp -m udp --dport 5027 -j ACCEPT
netstat -nlptu | grep 5027
tcp6       0      0 :::5027                 :::*                    LISTEN      24429/java
udp6       0      0 :::5027                 :::*                                24429/java
Foo2 months ago

I have no idea what happened but it seems like it's working now. I have to check later directly from my car. There is some strange things going on between ipv4 and ipv6. If I use ipv6, it works.

Track-trace2 months ago

Well, a cliƫnt has nothing to do with device reporting on another port. if you do not get any data from the device in the server log it can only be a few things.

  • Device not pointed to the correct server / ip port
  • Device Server port not accesible
  • Device server port not enabled
  • Device simcard has no data

You can also sniff the device port for incoming data. But i just use ubuntu 22.04 and no containers. For me its more difficult when having issues with docker. Also i would first make it work without proxys or ssl.. Just to first cut out every obstacle:)

Foo2 months ago

As I wrote: It seems to be a problem with ipv6 and ipv4. This is a point where I can start with.

Foo2 months ago

As far as I understand:

  • Traccar binds ports only to ipv6
  • Ports 5027 and 5055 are accessible via ipv6.
  • Ports 5027 and 5055 are not accessible via ipv4.

So it seems like I have 2 (theoretical) solutions: Let Traccar bind ports also to ipv4 or some sort of "forward" connections from ipv4 to ipv6.

Anton Tananaev2 months ago

Traccar binds ports on all interfaces by default, so it should listen on both IPv4 and IPv6.