openHAB - GPS Bricklet 3.0

Bemerkung

Die openHAB-Dokumentation ist nur auf Englisch verfügbar.

Warnung

The openHAB bindings are still in beta, but the development was stopped.

This is the description of the openHAB API bindings for the GPS Bricklet 3.0. General information and technical specifications for the GPS Bricklet 3.0 are summarized in its hardware description.

An installation guide for the openHAB API bindings is part of their general description.

Thing

UID:
  • tinkerforge:brickletgpsv3:[UID]
Required firmware version:
  • 2.0.0
Firmware update supported:
  • yes
Channels:
Actions:
Parameters:
  • Fix LED – Type: Choice, Default: Show Fix
  • The fix LED configuration. By default the LED shows if the Bricklet got a GPS fix yet. If a fix is established the LED turns on. If there is no fix then the LED is turned off. You can also turn the LED permanently on/off, show a heartbeat or let it blink in sync with the PPS (pulse per second) output of the GPS module. If the Bricklet is in bootloader mode, the LED is off.
  • Options: Off, On, Show Heartbeat, Show Fix, Show PPS

  • SBAS – Type: boolean, Default: true
  • If SBAS is enabled, the position accuracy increases (if SBAS satellites are in view), but the update rate is limited to 5Hz. With SBAS disabled the update rate is increased to 10Hz.

  • Status Update Interval – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
  • Specifies the update interval for the status in milliseconds. A value of 0 disables automatic updates.

  • Altitude Update Interval – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
  • Specifies the update interval for the altitude and geodial separation in milliseconds. A value of 0 disables automatic updates.

  • Motion Update Interval – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
  • Specifies the update interval for the course and speed in milliseconds. A value of 0 disables automatic updates.

  • Status LED Configuration – Type: Choice, Default: Show Status
  • The status LED configuration. By default the LED shows communication traffic between Brick and Bricklet, it flickers once for every 10 received data packets. You can also turn the LED permanently on/off or show a heartbeat. If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
  • Options: Off, On, Show Heartbeat, Show Status

Channels

Location

The location as determined by the bricklet.

Type:
  • Location
UID:
  • tinkerforge:brickletgpsv3:[UID]:BrickletGPSV3Location
Read only:
  • No
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Fix

The current fix status

Type:
  • Contact
UID:
  • tinkerforge:brickletgpsv3:[UID]:BrickletGPSV3Fix
Read only:
  • No
Satellites In View

The number of satellites that are in view.

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletgpsv3:[UID]:BrickletGPSV3SatellitesInView
Read only:
  • Yes
Altitude

The measured altitude

Type:
  • Number:Length
UID:
  • tinkerforge:brickletgpsv3:[UID]:BrickletGPSV3Altitude
Read only:
  • Yes
Unit:
  • Meter
Geoidal Separation

The geoidal separation corresponding to the current altitude

Type:
  • Number:Length
UID:
  • tinkerforge:brickletgpsv3:[UID]:BrickletGPSV3GeoidalSeparation
Read only:
  • Yes
Unit:
  • Meter
Course

The current course. A course of 0° means the Bricklet is traveling north bound and 90° means it is traveling east bound. Please note that this only returns useful values if an actual movement is present.

Type:
  • Number:Angle
UID:
  • tinkerforge:brickletgpsv3:[UID]:BrickletGPSV3Course
Read only:
  • Yes
Unit:
  • Degree Angle
Range:
  • 0 Degree Angle to 360 Degree Angle (Step 0.01 Degree Angle)
Speed

The current speed. Please note that this only returns useful values if an actual movement is present.

Type:
  • Number:Speed
UID:
  • tinkerforge:brickletgpsv3:[UID]:BrickletGPSV3Speed
Read only:
  • Yes
Unit:
  • Kilometre Per Hour
Date Time

The current date and time.

Type:
  • DateTime
UID:
  • tinkerforge:brickletgpsv3:[UID]:BrickletGPSV3DateTime
Read only:
  • No
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Pulse Per Second

This channel is triggered precisely once per second, see PPS.

The precision of two subsequent pulses will be skewed because of the latency in the USB/RS485/Ethernet connection. But in the long run this will be very precise. For example a count of 3600 pulses will take exactly 1 hour.

Type:
  • Trigger (system.trigger)
UID:
  • tinkerforge:brickletgpsv3:[UID]:BrickletGPSV3PulsePerSecond
Read only:
  • No
Restart

Restarts the GPS Bricklet, the following restart types are available:

  • Hot start (use all available data in the NV store)
  • Warm start (don't use ephemeris at restart)
  • Cold start (don't use time, position, almanacs and ephemeris at restart)
  • Factory reset (clear all system/user configurations at restart)
Type:
  • Commands (String)
UID:
  • tinkerforge:brickletgpsv3:[UID]:BrickletGPSV3Restart
Read only:
  • No
Commands:
  • Hot Start
  • Warm Start
  • Cold Start
  • Factory reset

Actions

Actions can be used in rules by creating an action object. All actions return a Map<String, Object>. Returned values can be accessed by name, sometimes the type deduction needs some hints, as shown below:

val actions = getActions("tinkerforge", "tinkerforge:brickletgpsv3:[UID]")
val hwVersion = actions.brickletGPSV3GetIdentity().get("hardwareVersion") as short[]
logInfo("Example", "Hardware version: " + hwVersion.get(0) + "." + hwVersion.get(1) + "." + hwVersion.get(2))

Basic Actions

brickletGPSV3GetCoordinates()
Return Map:
  • latitude – Type: long, Unit: 1/1000000 °, Range: [0 to 90000000]
  • ns – Type: char, Range: ['N', 'S']
  • longitude – Type: long, Unit: 1/1000000 °, Range: [0 to 180000000]
  • ew – Type: char, Range: ['E', 'W']

Returns the GPS coordinates. Latitude and longitude are given in the DD.dddddd° format, the value 57123468 means 57.123468°. The parameter ns and ew are the cardinal directions for latitude and longitude. Possible values for ns and ew are 'N', 'S', 'E' and 'W' (north, south, east and west).

This data is only valid if there is currently a fix as indicated by Fix.

brickletGPSV3GetStatus()
Return Map:
  • hasFix – Type: boolean
  • satellitesView – Type: int, Range: [0 to 255]

Returns if a fix is currently available as well as the number of satellites that are in view.

There is also a green LED on the Bricklet that indicates the fix status.

brickletGPSV3GetAltitude()
Return Map:
  • altitude – Type: int, Unit: 1 cm, Range: [-231 to 231 - 1]
  • geoidalSeparation – Type: int, Unit: 1 cm, Range: [-231 to 231 - 1]

Returns the current altitude and corresponding geoidal separation.

This data is only valid if there is currently a fix as indicated by Fix.

brickletGPSV3GetMotion()
Return Map:
  • course – Type: long, Unit: 1/100 °, Range: [0 to 36000]
  • speed – Type: long, Unit: 1/100 km/h, Range: [0 to 232 - 1]

Returns the current course and speed. A course of 0° means the Bricklet is traveling north bound and 90° means it is traveling east bound.

Please note that this only returns useful values if an actual movement is present.

This data is only valid if there is currently a fix as indicated by Fix.

brickletGPSV3GetDateTime()
Return Map:
  • date – Type: long, Range: [10100 to 311299]
  • time – Type: long, Range: [0 to 235959999]

Returns the current date and time. The date is given in the format ddmmyy and the time is given in the format hhmmss.sss. For example, 140713 means 14.07.13 as date and 195923568 means 19:59:23.568 as time.

brickletGPSV3GetSatelliteSystemStatus(int satelliteSystem)
Parameters:
  • satelliteSystem – Type: int, Range: See constants
Return Map:
  • satelliteNumbers – Type: int[], Length: variable, Range: [0 to 255]
  • fix – Type: int, Range: See constants
  • pdop – Type: int, Unit: 1/100, Range: [0 to 216 - 1]
  • hdop – Type: int, Unit: 1/100, Range: [0 to 216 - 1]
  • vdop – Type: int, Unit: 1/100, Range: [0 to 216 - 1]

Returns the

  • satellite numbers list (up to 12 items)
  • fix value,
  • PDOP value,
  • HDOP value and
  • VDOP value

for a given satellite system. Currently GPS and GLONASS are supported, Galileo is not yet supported.

The GPS and GLONASS satellites have unique numbers and the satellite list gives the numbers of the satellites that are currently utilized. The number 0 is not a valid satellite number and can be ignored in the list.

The following constants are available for this function:

For satelliteSystem:

  • val SATELLITE_SYSTEM_GPS = 0
  • val SATELLITE_SYSTEM_GLONASS = 1
  • val SATELLITE_SYSTEM_GALILEO = 2

For fix:

  • val FIX_NO_FIX = 1
  • val FIX_2D_FIX = 2
  • val FIX_3D_FIX = 3
brickletGPSV3GetSatelliteStatus(int satelliteSystem, int satelliteNumber)
Parameters:
  • satelliteSystem – Type: int, Range: See constants
  • satelliteNumber – Type: int, Range: [1 to 32]
Return Map:
  • elevation – Type: int, Unit: 1 °, Range: [0 to 90]
  • azimuth – Type: int, Unit: 1 °, Range: [0 to 359]
  • snr – Type: int, Unit: 1 dB, Range: [0 to 99]

Returns the current elevation, azimuth and SNR for a given satellite and satellite system.

The satellite number here always goes from 1 to 32. For GLONASS it corresponds to the satellites 65-96.

Galileo is not yet supported.

The following constants are available for this function:

For satelliteSystem:

  • val SATELLITE_SYSTEM_GPS = 0
  • val SATELLITE_SYSTEM_GLONASS = 1
  • val SATELLITE_SYSTEM_GALILEO = 2

Advanced Actions

brickletGPSV3Restart(int restartType)
Parameters:
  • restartType – Type: int, Range: See constants

Restarts the GPS Bricklet, the following restart types are available:

Value Description
0 Hot start (use all available data in the NV store)
1 Warm start (don't use ephemeris at restart)
2 Cold start (don't use time, position, almanacs and ephemeris at restart)
3 Factory reset (clear all system/user configurations at restart)

The following constants are available for this function:

For restartType:

  • val RESTART_TYPE_HOT_START = 0
  • val RESTART_TYPE_WARM_START = 1
  • val RESTART_TYPE_COLD_START = 2
  • val RESTART_TYPE_FACTORY_RESET = 3
brickletGPSV3GetFixLEDConfig()
Return Map:
  • config – Type: int, Range: See constants, Default: 3

Returns the configuration as set by the thing configuration

The following constants are available for this function:

For config:

  • val FIX_LED_CONFIG_OFF = 0
  • val FIX_LED_CONFIG_ON = 1
  • val FIX_LED_CONFIG_SHOW_HEARTBEAT = 2
  • val FIX_LED_CONFIG_SHOW_FIX = 3
  • val FIX_LED_CONFIG_SHOW_PPS = 4
brickletGPSV3GetSBASConfig()
Return Map:
  • sbasConfig – Type: int, Range: See constants, Default: 0

Returns the SBAS configuration as set by the thing configuration

The following constants are available for this function:

For sbasConfig:

  • val SBAS_ENABLED = 0
  • val SBAS_DISABLED = 1
brickletGPSV3GetChipTemperature()
Return Map:
  • temperature – Type: int, Unit: 1 °C, Range: [-215 to 215 - 1]

Returns the temperature as measured inside the microcontroller. The value returned is not the ambient temperature!

The temperature is only proportional to the real temperature and it has bad accuracy. Practically it is only useful as an indicator for temperature changes.

brickletGPSV3GetStatusLEDConfig()
Return Map:
  • config – Type: int, Range: See constants, Default: 3

Returns the configuration as set by the thing configuration

The following constants are available for this function:

For config:

  • val STATUS_LED_CONFIG_OFF = 0
  • val STATUS_LED_CONFIG_ON = 1
  • val STATUS_LED_CONFIG_SHOW_HEARTBEAT = 2
  • val STATUS_LED_CONFIG_SHOW_STATUS = 3
brickletGPSV3GetSPITFPErrorCount()
Return Map:
  • errorCountAckChecksum – Type: long, Range: [0 to 232 - 1]
  • errorCountMessageChecksum – Type: long, Range: [0 to 232 - 1]
  • errorCountFrame – Type: long, Range: [0 to 232 - 1]
  • errorCountOverflow – Type: long, Range: [0 to 232 - 1]

Returns the error count for the communication between Brick and Bricklet.

The errors are divided into

  • ACK checksum errors,
  • message checksum errors,
  • framing errors and
  • overflow errors.

The errors counts are for errors that occur on the Bricklet side. All Bricks have a similar function that returns the errors on the Brick side.

brickletGPSV3Reset()

Calling this function will reset the Bricklet. All configurations will be lost.

After a reset you have to create new device objects, calling functions on the existing ones will result in undefined behavior!

brickletGPSV3GetIdentity()
Return Map:
  • uid – Type: String, Length: up to 8
  • connectedUid – Type: String, Length: up to 8
  • position – Type: char, Range: ['a' to 'h', 'z']
  • hardwareVersion – Type: short[], Length: 3
    • 0: major – Type: short, Range: [0 to 255]
    • 1: minor – Type: short, Range: [0 to 255]
    • 2: revision – Type: short, Range: [0 to 255]
  • firmwareVersion – Type: short[], Length: 3
    • 0: major – Type: short, Range: [0 to 255]
    • 1: minor – Type: short, Range: [0 to 255]
    • 2: revision – Type: short, Range: [0 to 255]
  • deviceIdentifier – Type: int, Range: [0 to 216 - 1]

Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier.

The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port). A Bricklet connected to an Isolator Bricklet is always at position 'z'.

The device identifier numbers can be found here

Internal Actions

brickletGPSV3ReadUID()
Return Map:
  • uid – Type: long, Range: [0 to 232 - 1]

Returns the current UID as an integer. Encode as Base58 to get the usual string version.