# Gps dashboard for live location

**URL:** <https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193>\
**Category:** General\
**Created:** [13 October 2020 18:13 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193 "2020-10-13T18:13:58Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 08:18 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/22 "2020-10-14T08:18:36Z")

</div>

Thanks @Steve finally got it right.Now to show on map connecting it to a worldmap node.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/2/92393087a17bc08a7f9371a736ccd24095e159c8.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/b/4be660adc8d4db67feaf8ea5a874145c5468a25c.png)  
@steve what all properties need to be set inorder to see it on map pls guide me through?  
i opened a new tab for viewing it -[http://127.0.0.1:1880/worldmap](http://127.0.0.1:1880/worldmap)  
but in that it shows some different location  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/6/46bc478fbc8ca94a87740933e573d23b4f6a8077.png)  
@steve am i doing something wrong because this mesaage is showing along with other messages in debug sidebar  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/4/9486cb6942e8939a8b34e4e14ee297984c99ca29.png)

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 08:40 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/23 "2020-10-14T08:40:40Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/8/88ecea9ed63a27fadcb501ce572e5be5f52e4692.png)  
i have selected as string.should i change it to something else?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [14 October 2020 08:44 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/24 "2020-10-14T08:44:49Z")

</div>

Please show us how you have configured the Change node.

The error tells us you are trying to set a property under `msg.payload.name` - but we can see that `msg.payload.name` is a String type and Strings cannot have properties.

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 08:51 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/25 "2020-10-14T08:51:06Z")

</div>

I am sending u my flow [flows.json](https://discourse.nodered.org/uploads/short-url/hm09ujW5jFPGZeboiObZGnqBCzu.json) (5.1 KB)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [14 October 2020 09:03 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/26 "2020-10-14T09:03:34Z")

</div>

Do you understand what the flow is doing? Take a step back and step through what you have.

When a message arrives at the MQTT node you are splitting the flow into two for some reason. That means you now have _two_ messages to deal with.

The top branch you pass to a Function node which parses `msg.payload` as a JSON string, and then sets `msg.payload` to the `data` property and passes it on.

The next two nodes, base64 and buffer-parser are doing some decoding of that data. I assume that's right as I don't know what the value it receives is.

You then pass it to a change node that sets `msg.payload.name` to the value "apple" and passes it to the worldmap node. Given you've shown that works, then great.

However, you have, for some reason, added a second Function node connected to the MQTT node. That Function node is parsing `msg.payload` and setting `msg.payload` to the value of the `name` property of the received MQTT message. You then pass that to the Change node which tries to set `msg.payload.name` of the string value and you get the error.

The issue is you have split the flow at the very start. Rather than have one message passing through, you have two messages.

I assume your goal is to use the `name` property in the original MQTT message as the `name` property you pass to the worldmap node alongside the values from the `data` property.

If so, then delete that second Function node and change the top Function node to:

```auto
var t=JSON.parse(msg.payload);
msg.name = t.name;
msg.payload=t.data;
return msg;

```

Then modify the Change node to set `msg.payload.name` to the value of `msg.name`.

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 09:10 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/27 "2020-10-14T09:10:36Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/a/8af4b5f76c15979ceb0a6431e757e0b9ef3df3d8.png)  
Now this is the output after modification  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/4/146db0867958ebf308187e5a94e4651da0bf728c.png)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [14 October 2020 09:11 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/28 "2020-10-14T09:11:59Z")

</div>

Look again at the Change node.

It looks like you have it configured to set msg.name. That is wrong. You want it to be setting `msg.payload.name` to the value of `msg.name` - I suspect you have got those two the wrong way around.

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 09:19 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/29 "2020-10-14T09:19:19Z")

</div>

Now i have made corrections pls check

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [14 October 2020 09:22 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/30 "2020-10-14T09:22:16Z")

</div>

Why have you added an extra wire from the Function node to the Change node? That was not something I said to do. Delete that wire.

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 09:23 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/31 "2020-10-14T09:23:08Z")

</div>

yes deleted but output is still the same without name property in it

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/c/ccbd8bb48e27de8ef8c15eb533eef606ae9bddc9.png)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [14 October 2020 09:27 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/32 "2020-10-14T09:27:27Z")

</div>

Please add a Debug node wired to the Buffer Parser node output, and configure the node to "show complete msg object" - then show us the output. Make sure you full expand the message in the debug sidebar so we can see all of it.

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 09:30 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/33 "2020-10-14T09:30:30Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/c/8c8e34925edbed1fb979f619dc030751d0cc599e.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/d/8d9a869e809339d0fdfd814758cfecc49fb4ddef.png)  
here you go

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 October 2020 09:33 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/34 "2020-10-14T09:33:12Z")

</div>

Before we go any further... please look at your original screenshot  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/9/6917cccfcdd0033b9dcd39d890b04bcd60010620.png)  
neither of those values look very reasonable - either 0,0 is in the middle of the ocean off Africa... and lon cannot be greater that 180 so anything with e+28 will be wrong. So you need to fix your conversion or original data.

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 09:36 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/35 "2020-10-14T09:36:46Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/a/8a122ab65f68e9236e05e88b8bccc0c15ec9d7b1.png)  
i have placed gps in the right place.and it is showing the correct coordinates now on mobile app.Now it will not be a problem for us.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 October 2020 09:45 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/36 "2020-10-14T09:45:47Z")

</div>

OK - I can understand the 0,0 if you have no signal (eg indoors) - but the 1.5 e+28 makes no sense.  
Those latest ones are even worse -  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/d/9dbebfeee99af55efb95f97c25297f8526bdd4f8.png)  
Again they will never appear on a map.

So yes -- I think the change node is probably now ok - (if you now move the debug to after the change node to check) and we should have a payload with a lat lon and name... - but until the decoder sends out sensible values they will never plot ok.

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 09:50 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/37 "2020-10-14T09:50:19Z")

</div>

@dceejay i have placed gps on terrace and checked the coordinates it show correct.

 ![WhatsApp Image 2020-10-14 at 3.19.12 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/e/9e4e54d1590b7cefab276c9350295f43fffe6a2d.jpeg)  
but these are latest values in node red which do not match  
lon--2.5547601597923975e-24  
lat--2.3314581873174617e-17

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 October 2020 09:56 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/38 "2020-10-14T09:56:17Z")

</div>

indeed - so the buffer parser is wrong. Was it ever working ?  
I thought that was your other thread ?

---

<div class="post-metadata">

**Author:** ![bachloo.rahul](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bachloo.rahul](https://discourse.nodered.org/u/bachloo.rahul)\
**Post date:** [14 October 2020 10:05 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/39 "2020-10-14T10:05:51Z")

</div>

i don't understand about other thread?so you are saying buffer parser is not working properly but all others including you said to use it.do u have some fix?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [14 October 2020 10:20 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/40 "2020-10-14T10:20:10Z")

</div>

The buffer parser "was" setup and working as follows...

According to the PDF with sample data you could so this...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/0/e0600e9c01230cd1f8dcb10c0170c0c7fb9172b8.png)

which matches this...  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/c/5c23f2ced2d84b472abdad2c52d109d3f1f02cb3.png)

using buffer parser set as per the info you provided...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/a/cabec6da37f892cd37c392ef533c73922025f5e3.png)

[Link to thread](https://discourse.nodered.org/t/creation-of-function-node/34170/10)

### however

The values still need some math as per the PDF  
For example, you can clearly see from the screenshots above, we correctly make the values  
`lat: 5007.4965` and `lon:838.1157` just like in the screenshot of your documentation  
NOTE however that is not the end of the work - you need to apply the maths it states to turn those into usable coordinates.

So, to progress this, you could add a function node AFTER the buffer-parser and perform the necessary maths on `msg.payload.lat` and `msg.payload.lon` to make usable coordinates.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 October 2020 10:21 UTC](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193/41 "2020-10-14T10:21:15Z")

</div>

the buffer parser is a good node - but has to be configured correctly to decode your binary data - from your other thread- - [Creation of Function Node](https://discourse.nodered.org/t/creation-of-function-node/34170)

(edit) \_ Ah Steve arrived... thanks... -- ^^^

PS - maybe don't need a function... just use your new scaling capability to / 100 ?

[Previous page](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193.md?page=1)

[Next page](https://discourse.nodered.org/t/gps-dashboard-for-live-location/34193.md?page=3)
