This is the description of the Modbus protocol for the GPS Bricklet. General information and technical specifications for the GPS Bricklet are summarized in its hardware description.
A general description of the Modbus protocol structure can be found here.
Function ID: | 1 |
---|---|
Request: | empty payload |
Response: |
|
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).
PDOP, HDOP and VDOP are the dilution of precision (DOP) values. They specify the additional multiplicative effect of GPS satellite geometry on GPS precision. See here for more information. The values are give in hundredths.
EPE is the "Estimated Position Error". The EPE is given in cm. This is not the absolute maximum error, it is the error with a specific confidence. See here for more information.
This data is only valid if there is currently a fix as indicated by get_status.
Function ID: | 2 |
---|---|
Request: | empty payload |
Response: |
|
Returns the current fix status, the number of satellites that are in view and the number of satellites that are currently used.
Possible fix status values can be:
Value | Description |
---|---|
1 | No Fix, get_coordinates and get_altitude return invalid data |
2 | 2D Fix, only get_coordinates returns valid data |
3 | 3D Fix, get_coordinates and get_altitude return valid data |
There is also a blue LED on the Bricklet that indicates the fix status.
Function ID: | 3 |
---|---|
Request: | empty payload |
Response: |
|
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 get_status.
Function ID: | 4 |
---|---|
Request: | empty payload |
Response: |
|
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 get_status.
Function ID: | 5 |
---|---|
Request: | empty payload |
Response: |
|
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.
Function ID: | 6 |
---|---|
Request: |
|
Response: | no response |
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) |
Function ID: | 255 |
---|---|
Request: | empty payload |
Response: |
|
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 here.
Function ID: | 7 |
---|---|
Request: |
|
Response: | no response |
Sets the period in ms with which the CALLBACK_COORDINATES callback is triggered periodically. A value of 0 turns the callback off.
CALLBACK_COORDINATES is only triggered if the coordinates changed since the last triggering.
The default value is 0.
Function ID: | 8 |
---|---|
Request: | empty payload |
Response: |
|
Returns the period as set by set_coordinates_callback_period.
Function ID: | 9 |
---|---|
Request: |
|
Response: | no response |
Sets the period in ms with which the CALLBACK_STATUS callback is triggered periodically. A value of 0 turns the callback off.
CALLBACK_STATUS is only triggered if the status changed since the last triggering.
The default value is 0.
Function ID: | 10 |
---|---|
Request: | empty payload |
Response: |
|
Returns the period as set by set_status_callback_period.
Function ID: | 11 |
---|---|
Request: |
|
Response: | no response |
Sets the period in ms with which the CALLBACK_ALTITUDE callback is triggered periodically. A value of 0 turns the callback off.
CALLBACK_ALTITUDE is only triggered if the altitude changed since the last triggering.
The default value is 0.
Function ID: | 12 |
---|---|
Request: | empty payload |
Response: |
|
Returns the period as set by set_altitude_callback_period.
Function ID: | 13 |
---|---|
Request: |
|
Response: | no response |
Sets the period in ms with which the CALLBACK_MOTION callback is triggered periodically. A value of 0 turns the callback off.
CALLBACK_MOTION is only triggered if the motion changed since the last triggering.
The default value is 0.
Function ID: | 14 |
---|---|
Request: | empty payload |
Response: |
|
Returns the period as set by set_motion_callback_period.
Function ID: | 15 |
---|---|
Request: |
|
Response: | no response |
Sets the period in ms with which the CALLBACK_DATE_TIME callback is triggered periodically. A value of 0 turns the callback off.
CALLBACK_DATE_TIME is only triggered if the date or time changed since the last triggering.
The default value is 0.
Function ID: | 16 |
---|---|
Request: | empty payload |
Response: |
|
Returns the period as set by set_date_time_callback_period.
Function ID: | 17 |
---|---|
Response: |
|
This callback is triggered periodically with the period that is set by set_coordinates_callback_period. The parameters are the same as for get_coordinates.
CALLBACK_COORDINATES is only triggered if the coordinates changed since the last triggering and if there is currently a fix as indicated by get_status.
Function ID: | 18 |
---|---|
Response: |
|
This callback is triggered periodically with the period that is set by set_status_callback_period. The parameters are the same as for get_status.
CALLBACK_STATUS is only triggered if the status changed since the last triggering.
Function ID: | 19 |
---|---|
Response: |
|
This callback is triggered periodically with the period that is set by set_altitude_callback_period. The parameters are the same as for get_altitude.
CALLBACK_ALTITUDE is only triggered if the altitude changed since the last triggering and if there is currently a fix as indicated by get_status.
Function ID: | 20 |
---|---|
Response: |
|
This callback is triggered periodically with the period that is set by set_motion_callback_period. The parameters are the same as for get_motion.
CALLBACK_MOTION is only triggered if the motion changed since the last triggering and if there is currently a fix as indicated by get_status.
Function ID: | 21 |
---|---|
Response: |
|
This callback is triggered periodically with the period that is set by set_date_time_callback_period. The parameters are the same as for get_date_time.
CALLBACK_DATE_TIME is only triggered if the date or time changed since the last triggering.