The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Tinkerforge::BrickletGPSV2 - Determine position, velocity and altitude using GPS

CONSTANTS

DEVICE_IDENTIFIER

This constant is used to identify a GPS Bricklet 2.0.

The get_identity() subroutine and the CALLBACK_ENUMERATE callback of the IP Connection have a device_identifier parameter to specify the Brick's or Bricklet's type.

DEVICE_DISPLAY_NAME

This constant represents the display name of a GPS Bricklet 2.0.

CALLBACK_PULSE_PER_SECOND

This constant is used with the register_callback() subroutine to specify the CALLBACK_PULSE_PER_SECOND callback.

CALLBACK_COORDINATES

This constant is used with the register_callback() subroutine to specify the CALLBACK_COORDINATES callback.

CALLBACK_STATUS

This constant is used with the register_callback() subroutine to specify the CALLBACK_STATUS callback.

CALLBACK_ALTITUDE

This constant is used with the register_callback() subroutine to specify the CALLBACK_ALTITUDE callback.

CALLBACK_MOTION

This constant is used with the register_callback() subroutine to specify the CALLBACK_MOTION callback.

CALLBACK_DATE_TIME

This constant is used with the register_callback() subroutine to specify the CALLBACK_DATE_TIME callback.

FUNCTION_GET_COORDINATES

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_STATUS

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_ALTITUDE

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_MOTION

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_DATE_TIME

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_RESTART

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_SATELLITE_SYSTEM_STATUS_LOW_LEVEL

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_SATELLITE_STATUS

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_FIX_LED_CONFIG

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_FIX_LED_CONFIG

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_COORDINATES_CALLBACK_PERIOD

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_COORDINATES_CALLBACK_PERIOD

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_STATUS_CALLBACK_PERIOD

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_STATUS_CALLBACK_PERIOD

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_ALTITUDE_CALLBACK_PERIOD

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_ALTITUDE_CALLBACK_PERIOD

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_MOTION_CALLBACK_PERIOD

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_MOTION_CALLBACK_PERIOD

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_DATE_TIME_CALLBACK_PERIOD

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_DATE_TIME_CALLBACK_PERIOD

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_SBAS_CONFIG

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_SBAS_CONFIG

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_SPITFP_ERROR_COUNT

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_BOOTLOADER_MODE

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_BOOTLOADER_MODE

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_WRITE_FIRMWARE_POINTER

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_WRITE_FIRMWARE

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_STATUS_LED_CONFIG

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_STATUS_LED_CONFIG

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_CHIP_TEMPERATURE

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_RESET

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_WRITE_UID

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_READ_UID

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_IDENTITY

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTIONS

new()

Creates an object with the unique device ID *uid* and adds it to the IP Connection *ipcon*.

get_coordinates()

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 :func:`Get Status`.

get_status()

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

There is also a :ref:`green LED <gps_v2_bricklet_fix_led>` on the Bricklet that indicates the fix status.

get_altitude()

Returns the current altitude and corresponding geoidal separation.

Both values are given in cm.

This data is only valid if there is currently a fix as indicated by :func:`Get Status`.

get_motion()

Returns the current course and speed. Course is given in hundredths degree and speed is given in hundredths km/h. 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 :func:`Get Status`.

get_date_time()

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.05.13 as date and 195923568 means 19:59:23.568 as time.

restart()

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

.. csv-table:: :header: "Value", "Description" :widths: 10, 100

 "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)"
get_satellite_system_status_low_level()

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.

get_satellite_status()

Returns the current

* elevation (0° - 90°), * azimuth (0° - 359°) and * SNR (0dB - 99dB)

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.

set_fix_led_config()

Sets 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.

get_fix_led_config()

Returns the configuration as set by :func:`Set Fix LED Config`

set_coordinates_callback_period()

Sets the period in ms with which the :cb:`Coordinates` callback is triggered periodically. A value of 0 turns the callback off.

The :cb:`Coordinates` callback is only triggered if the coordinates changed since the last triggering.

The default value is 0.

get_coordinates_callback_period()

Returns the period as set by :func:`Set Coordinates Callback Period`.

set_status_callback_period()

Sets the period in ms with which the :cb:`Status` callback is triggered periodically. A value of 0 turns the callback off.

The :cb:`Status` callback is only triggered if the status changed since the last triggering.

The default value is 0.

get_status_callback_period()

Returns the period as set by :func:`Set Status Callback Period`.

set_altitude_callback_period()

Sets the period in ms with which the :cb:`Altitude` callback is triggered periodically. A value of 0 turns the callback off.

The :cb:`Altitude` callback is only triggered if the altitude changed since the last triggering.

The default value is 0.

get_altitude_callback_period()

Returns the period as set by :func:`Set Altitude Callback Period`.

set_motion_callback_period()

Sets the period in ms with which the :cb:`Motion` callback is triggered periodically. A value of 0 turns the callback off.

The :cb:`Motion` callback is only triggered if the motion changed since the last triggering.

The default value is 0.

get_motion_callback_period()

Returns the period as set by :func:`Set Motion Callback Period`.

set_date_time_callback_period()

Sets the period in ms with which the :cb:`Date Time` callback is triggered periodically. A value of 0 turns the callback off.

The :cb:`Date Time` callback is only triggered if the date or time changed since the last triggering.

The default value is 0.

get_date_time_callback_period()

Returns the period as set by :func:`Set Date Time Callback Period`.

set_sbas_config()

If `SBAS <https://en.wikipedia.org/wiki/GNSS_augmentation#Satellite-based_augmentation_system>`__ 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.

By default SBAS is enabled and the update rate is 5Hz.

.. versionadded:: 2.0.2$nbsp;(Plugin)

get_sbas_config()

Returns the SBAS configuration as set by :func:`Set SBAS Config`

.. versionadded:: 2.0.2$nbsp;(Plugin)

get_spitfp_error_count()

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

The errors are divided into

* ack checksum errors, * message checksum errors, * frameing 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.

set_bootloader_mode()

Sets the bootloader mode and returns the status after the requested mode change was instigated.

You can change from bootloader mode to firmware mode and vice versa. A change from bootloader mode to firmware mode will only take place if the entry function, device identifier und crc are present and correct.

This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.

get_bootloader_mode()

Returns the current bootloader mode, see :func:`Set Bootloader Mode`.

set_write_firmware_pointer()

Sets the firmware pointer for :func:`Write Firmware`. The pointer has to be increased by chunks of size 64. The data is written to flash every 4 chunks (which equals to one page of size 256).

This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.

write_firmware()

Writes 64 Bytes of firmware at the position as written by :func:`Set Write Firmware Pointer` before. The firmware is written to flash every 4 chunks.

You can only write firmware in bootloader mode.

This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.

set_status_led_config()

Sets 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.

get_status_led_config()

Returns the configuration as set by :func:`Set Status LED Config`

get_chip_temperature()

Returns the temperature in °C 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.

reset()

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!

write_uid()

Writes a new UID into flash. If you want to set a new UID you have to decode the Base58 encoded UID string into an integer first.

We recommend that you use Brick Viewer to change the UID.

read_uid()

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

get_identity()

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' or 'd'.

The device identifier numbers can be found :ref:`here <device_identifier>`. |device_identifier_constant|

get_satellite_system_status()

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.