# How to update device GPS state via MQTT?

**URL:** <https://forums.losant.com/t/how-to-update-device-gps-state-via-mqtt/982>\
**Category:** Help\
**Created:** [June 19, 2018, 9:09pm UTC](https://forums.losant.com/t/how-to-update-device-gps-state-via-mqtt/982 "2018-06-19T21:09:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/tom/32/484_2.png) [@tom](https://forums.losant.com/u/tom)\
**Post date:** [June 19, 2018, 9:09pm UTC](https://forums.losant.com/t/how-to-update-device-gps-state-via-mqtt/982/1 "2018-06-19T21:09:19Z")

</div>

Hi

I created a property type GPS String named GPS

then I send a payload to topic deviceId/state via MQTT

that looks like this

{“data”:{“GPS”:"$GNGGA,203315.00,3243.91473,N,03510.22142,E,1,12,0.84,172.0,M,18.6,M,\*4E\r\n"}}

and I get a this error, A provided attribute is not defined on the device, or the data type is incorrect.

![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/1X/0427e13b1ab1c592266a653bd85fb6650d2b1305.png)

when I send the payload to a string type property it works.

What am I missing here?

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [June 19, 2018, 9:36pm UTC](https://forums.losant.com/t/how-to-update-device-gps-state-via-mqtt/982/2 "2018-06-19T21:36:19Z")

</div>

Based on the screenshot, it looks like you’re attempting to send data to the attributed named `GNGGA` instead of the attributed named `GPS`. I’d recommend double checking the MQTT client code to ensure the attribute name is correctly set.

---

<div class="post-metadata">

**Author:** ![tom](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/tom/32/484_2.png) [@tom](https://forums.losant.com/u/tom)\
**Post date:** [June 20, 2018, 2:49am UTC](https://forums.losant.com/t/how-to-update-device-gps-state-via-mqtt/982/3 "2018-06-20T02:49:55Z")

</div>

Hi Brandon

Posted this late last night without the most updated screenshot.

I do have a variable called GPS STRING type variable: GNGGA

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/1X/9b8953d1665ef3aeda1354bc0f382000c224c029.png)

and I am getting the error still,

![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/1X/8a3fa9222031451cf4b657d5e8dd1a3b6f24817b.png)

and this is the object i am sending via mqtt:

{“data”:{“GNGGA”:"$GNGGA,020108.00,3243.91172,N,03510.21778,E,1,10,1.11,172.2,M,18.6,M,\*46\r\n"}}

any idea?

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [June 20, 2018, 1:54pm UTC](https://forums.losant.com/t/how-to-update-device-gps-state-via-mqtt/982/4 "2018-06-20T13:54:50Z")

</div>

We currently support [GPS strings](https://docs.losant.com/devices/state/) in `$GPGLL` and `$GPGGA` formats. We don’t support the `$GNGGA` format. You’ll have to convert your GPS data one of those formats.
