GPSd Data icon

GPSd Data

Retrieve GPS data from a running gpsd service

Overview

This node connects to a running gpsd service to retrieve GPS data. It listens for GPS position reports (TPV messages) from the gpsd daemon and collects the latest available GPS information within a specified timeout period. This is useful in scenarios where you want to integrate live GPS data into your workflows, such as tracking device locations, logging movement paths, or triggering actions based on geographic position.

For example, you could use this node to:

  • Fetch the current GPS coordinates of a vehicle or asset.
  • Monitor location changes and update a database or dashboard.
  • Trigger alerts when entering or leaving specific geographic zones.

Properties

Name Meaning
Host The hostname or IP address where the gpsd service is running (default: "localhost").
Port The port number on which the gpsd service is listening (default: 2947).
Options A collection of additional settings:
  Timeout Time in seconds to wait for GPS data before returning (default: 5 seconds).
  Put Result in Field The name of the output JSON field where the GPS data will be stored (default: "gpsd").

Output

The node outputs an array of items, each corresponding to an input item. For each item, it adds a new JSON field (by default named gpsd) containing the latest GPS data retrieved from the gpsd service during the timeout period.

The GPS data structure corresponds to the TPV (Time-Position-Velocity) report from gpsd, which typically includes fields such as latitude, longitude, altitude, speed, track, time, and other GPS-related information.

If no GPS data is received within the timeout, the output field will contain an empty object.

The node does not output any binary data.

Dependencies

  • Requires the node-gpsd npm package to communicate with the gpsd service.
  • The gpsd daemon must be running and accessible at the specified host and port.
  • No special n8n credentials are required, but network access to the gpsd service must be configured properly.

Troubleshooting

  • No GPS data received: If the node returns an empty object, it may mean that no TPV message was received within the timeout period. Try increasing the timeout value or verify that the gpsd service is correctly providing data.
  • Connection errors: Ensure the host and port are correct and that the gpsd service is running and reachable from the n8n instance.
  • Permission issues: The gpsd service might require appropriate permissions or user privileges to provide data.
  • Missing node-gpsd package: If the node fails due to missing dependencies, ensure the environment has the node-gpsd package installed.

Links and References

Discussion