traccar / traccar-client-android

Traccar Client for Android
https://www.traccar.org/client
Apache License 2.0
643 stars 715 forks source link

Traccar not connecting to server. Possible Client Device Port Issue #341

Open thalward opened 5 years ago

thalward commented 5 years ago

Traccar Client not running correctly on Android 4.4.2

Client Side:- Service Starts and GPS icon in notification bar flashes away. GPS has been tested using google maps and works ok. It seems as though when 'Android OS Monitor' is run, that only one port is open for traccar communicating with port 443 and there is no port open which is set to communicate with port 5055? Running Traccar Client v5.10

Server Side:- After trying it on a more recent version of android os we can confirm the connection to the server is ok. We have checked the server logs and no HEX messages are being received so we can only assume the client has not open the port on the device for some reason. Port forwarding enabled at the server end (All ports forwarded from 5000-5200).

Any help welcome.

tananaev commented 5 years ago

Have you checked status screen in the app?

If GPS icon is flashing, it means that there is no GPS fix.

thalward commented 5 years ago

I am able to send an instant location update in other apps so it is getting a fix ok. The only difference is that it doesn't seem to want to open the port and communicate with the server.

I left it open all last night by the window so it had clear view of the sky. Checked it this morning and it has sent no location update and the port is still not open.

This seems to be the only difference between this unit and another android unit. It has previously worked on this device but this was on a different ROM which is not designed for this unit.

thalward commented 5 years ago

Just an update, I have used developer mode to falsify my location and even with this enabled it fails to open the port to communicate with the server therefore can only assume the app will not open the port to communicate.

I was able to confirm the falsified location on other apps as a test to ensure a GPS fix was established. I then disabled the function and the GPS fix returned to my exact location.

tananaev commented 5 years ago

What do you mean by "open the port to communicate"? Do you mean bind/listen to the port? Only servers listen to ports.

thalward commented 5 years ago

I would assume so (apologies for my terminology).

It seems as though when Traccar runs correctly, it establishes a secure connection on port 443. It also opens up a second port to communicate and provide the information to the server (port 5055) and it is this port that is not opening to allow the device to communicate.

I would assume this port (5055) opens regardless so a 'connected' event appears within the server log and that only a successful location update will create a hex event in the log file with the device identifier and location etc. I would still expect it to log as connected in the server log even if no GPS fix can be obtained. The fact it is not even connecting and no port is opening points to the device.

Unfortunately if I knew more about the android os I could investigate and diagnose further but it seems like its either an issue with the device not opening the port or the software not asking the port to be opened.

If you are able to advise any other steps you want me to take I would be more than happy to give them a try. It may be an android os issue with the ROM but I do not have the knowledge to go into that.

tananaev commented 5 years ago

I don't think you understand it correctly. Traccar Client only connects to the server when it successfully got a location from Android OS.

thalward commented 5 years ago

Ok, if this is the case, do you know how to test the android os to see why traccar seems to think a location hasnt been obtained? It obtains fine in other apps such as google maps.

tananaev commented 5 years ago

Have you checked status screen in the app?

thalward commented 5 years ago

All i get is service started, network offline, network online.

tananaev commented 5 years ago

OK, that proves that your device doesn't return location info. You need to check:

thalward commented 5 years ago

I have just run it on a different ROM on the same device and it works ok. I have reinstalled the correct ROM for the device and it fails to update again. From my limited knowledge the baseband firmware may be at fault but I could be having a complete wild 'stab in the dark' moment! I knew it could be one or the other but its still a case of pinpointing it.

My personal opinion would suggest that the app should be able to connect without providing GPS data so you know the server connection is up. Just my personal opinion though.

I've gone back to the supplier and asked them to check the firmware so I'll close the thread if I get information back from them confirming so.

Worked on: Baseband = MOLY.WR8.W1315.MD.WG.MP.V36.P1, 2016/11/29 19:57 Kernel Version = 3.4.67 sw05@honyao-Series #1 Wed Sep 13 11:31:02 CST 2017 Build = MTK6572 Custom Build = V0.4

Not Working on (Inrico): Baseband = MOLY.WR8.W1315.MD.WG.MP.V4, 2018/05/08 16:31 Kernel Version = 3.4.5 sw05@honyao-Series #1 Tue May 29 16:52:20 CST 2018 Build = ALPS.JB3.MP.V1.8 Custom Build = V0.1