Google Find Hub devices in Traccar

Anton Tananaev 20 days ago
Massimo 17 days ago

I got traccar/google-find-hub-sync working, but I had to make a few adjustments.

What worked for me:

  1. Use a clean virtual environment with Python 3.11.
    This repo works more reliably with Python 3.11 than with older macOS system Python versions.

  2. Make sure Google Chrome is updated to the latest version.
    The first authentication flow requires Chrome, and Chrome/ChromeDriver version mismatches can break the login process.

  3. Delete the local undetected_chromedriver cache before retrying.
    This helps when the wrong cached ChromeDriver version is reused.

  4. Patch a few files in the repository:

    chrome_driver.py

    • Force the correct Chrome major version in both uc.Chrome(...) calls
      (example: if Chrome is version 145, use version_main=145)

    • Add a dedicated Chrome profile in get_options() using:

      • --user-data-dir=...
      • --profile-directory=Default

    Why: this fixes ChromeDriver version mismatches and makes the browser-based auth/key flows more stable.

    Auth/firebase_messaging/fcmregister.py
    Add these Android identification headers to the Firebase / FCM requests:

    • X-Android-Package: com.google.android.apps.adm
    • X-Android-Cert: 38918a453d07199354f8b19af05ec6562ced5788

    Why: without these headers, FCM registration failed with API_KEY_ANDROID_APP_BLOCKED.

    Auth/secrets.json

    • Remove stale fcm_credentials once, then let the tool regenerate them

    Why: after failed registration attempts, cached credentials may remain in an invalid state.

  5. Complete the first authentication on a machine with a GUI, then copy Auth/secrets.json to the headless server.

    Why: the browser-based login/key retrieval is much easier on a desktop machine, while the headless server can reuse the generated auth data afterward.

After these changes, I was able to:

  • complete authentication successfully
  • retrieve the shared_key
  • run the microservice on a headless Ubuntu server
  • push positions into Traccar successfully

If the tracker appears online but no position data is shown, also check filter.static in Traccar. It can block location updates from slow-moving or stationary trackers, making it look like no data is being received.

Anton Tananaev 8 days ago

We have a new Android app that you can use instead of hosting this service. You can sign in directly in the app, so no need to worry about copying tokens. More info here:

https://www.traccar.org/forums/topic/relay-app-for-google-find-hub-devices/