Closed jfmateos closed 5 years ago
The map in dashboard example already does that. (You don't need to view it in a dashboard)
Thank you very much deccejay; it was very easy ;-)
How could I track all points without number limit? I am using your node to track an high altitude balloon.
Besides, I have configured a [Worldmap in] node to redraw all the markers when action=="connected", and when I load the map for the first time the track is ok, but if I press F5 to reload the map, the first and the last point of the track are joined.
Am I doing something wrong?
Not sure why that would happen. Any chance you can share that part of your flow plus data so I can test ?
re limit - well just set it very large... but it does mean there will be that many objects floating about in memory... so if on a limited device it may stop at some point.
(I'll think about how to make an option).
Of course, this is the flow
[{"id":"dbf050d4.6d1b1","type":"tab","label":"GALILEO2","disabled":false,"info":""},{"id":"e55058a7.82fcf8","type":"function","z":"dbf050d4.6d1b1","name":"Dibujar globo","func":"var newObject=new Object();\nnewObject.lat=msg.payload.payload_fields.latitude;\nnewObject.lon=msg.payload.payload_fields.longitude;\nnewObject.height=msg.payload.payload_fields.altitude;\nnewObject.altitude=msg.payload.payload_fields.altitude;\n\nnewObject.layer = \"g4lile0\";\nnewObject.name = msg._msgid;\n//newObject.icon = \"fa-star\";\nnewObject.icon = \"globe\";\n\nnewObject.iconColor = \"green\";\n\nvar newMsg = { payload: newObject };\nreturn newMsg;","outputs":1,"noerr":0,"x":660,"y":1580,"wires":[["39677e0e.5ec79a","8fb12612.2dde18","d1c497b5.d4bbe"]]},{"id":"e88a7848.9b447","type":"json","z":"dbf050d4.6d1b1","name":"","property":"payload","action":"","pretty":true,"x":410,"y":1420,"wires":[["e55058a7.82fcf8","46549f5d.5368c","53534fed.f33428"]]},{"id":"9034ff59.4c8e5","type":"inject","z":"dbf050d4.6d1b1","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"2","x":80,"y":1680,"wires":[["ee1c1822.ffc22"]]},{"id":"46549f5d.5368c","type":"function","z":"dbf050d4.6d1b1","name":"Extraer gateways","func":"return [Object.values(msg.payload.metadata.gateways)];\n","outputs":1,"noerr":0,"x":670,"y":1480,"wires":[["80429727.08fac8"]]},{"id":"80429727.08fac8","type":"function","z":"dbf050d4.6d1b1","name":"Dibujar gateways","func":"var newObject=new Object();\nnewObject.lat=msg.latitude;\nnewObject.lon=msg.longitude;\n\n\nnewObject.layer = \"g4lile0\";\nnewObject.name = msg.gtw_id;\nnewObject.icon = \"https://i.ya-webdesign.com/images/radio-tower-icon-png-11.png\";\nnewObject.iconColor = \"red\";\n\n\nvar newMsg = {payload: newObject };\nreturn newMsg;","outputs":1,"noerr":0,"x":910,"y":1480,"wires":[["8fb12612.2dde18"]]},{"id":"8fb12612.2dde18","type":"worldmap","z":"dbf050d4.6d1b1","name":"G4lile0","lat":"43","lon":"-3","zoom":"","layer":"OSM grey","cluster":"","maxage":"","usermenu":"hide","panit":"false","hiderightclick":"true","coords":"none","path":"worldmap2","x":1360,"y":1480,"wires":[]},{"id":"9ee98fe2.aaaa1","type":"join","z":"dbf050d4.6d1b1","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"payload.name","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1150,"y":1640,"wires":[["62bbc98.c21f4b8"]]},{"id":"62bbc98.c21f4b8","type":"function","z":"dbf050d4.6d1b1","name":"Unir globo con gateways","func":"var gateways = msg.payload.gateways;\nfunction distance(lat1, lon1, lat2, lon2, unit) {\n\tif ((lat1 == lat2) && (lon1 == lon2)) {\n\t\treturn 0;\n\t}\n\telse {\n\t\tvar radlat1 = Math.PI * lat1/180;\n\t\tvar radlat2 = Math.PI * lat2/180;\n\t\tvar theta = lon1-lon2;\n\t\tvar radtheta = Math.PI * theta/180;\n\t\tvar dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n\t\tif (dist > 1) {\n\t\t\tdist = 1;\n\t\t}\n\t\tdist = Math.acos(dist);\n\t\tdist = dist * 180/Math.PI;\n\t\tdist = dist * 60 * 1.1515;\n\t\tif (unit==\"K\") { dist = dist * 1.609344 }\n\t\tif (unit==\"N\") { dist = dist * 0.8684 }\n\t\treturn dist;\n\t}\n}\nvar newMsg= new Array();\nnumeroGateways = gateways.length;\nfor (var i = 0; i < numeroGateways; i++) {\n var newPayload=Object();\n newPayload.payload={\"name\": msg._msgid+i, \"line\": [ [msg.payload.globo.lat, msg.payload.globo.lon], [gateways[i].latitude, gateways[i].longitude] ]};\n if(gateways[i].rssi < -120){\n newPayload.payload.color='blue';\n }else if(gateways[i].rssi < -115){\n newPayload.payload.color='aqua';\n }else if(gateways[i].rssi < -110){\n newPayload.payload.color='lime';\n }else if(gateways[i].rssi < -105){\n newPayload.payload.color='yellow';\n }else if(gateways[i].rssi < -100){\n newPayload.payload.color='orange';\n }else{\n newPayload.payload.color='red';\n }\n var distancia=distance(msg.payload.globo.lat, msg.payload.globo.lon, gateways[i].latitude, gateways[i].longitude,\"K\" );\n newPayload.payload.clickable=true;\n newPayload.payload.popup=\"<b>Distancia:</b> \"+distancia.toFixed(3)+\" Km\";\n \n if(distancia>=(flow.get('maxDistance')||0)){\n //Devuelvo la línea anterior al color normal\n if((flow.get('maxDistance')||0)!=0){\n newMsg.push({\"payload\":{\"weight\":1,\"color\":flow.get('maxDistanceColor'),\"name\": flow.get('maxDistanceName'), \"line\": [ [flow.get('latGlobo'), flow.get('lonGlobo')], [flow.get('latGateway'), flow.get('lonGateway')] ]}});\n }\n flow.set('maxDistance',distancia);\n flow.set('latGlobo',msg.payload.globo.lat);\n flow.set('lonGlobo',msg.payload.globo.lon);\n flow.set('latGateway',gateways[i].latitude);\n flow.set('lonGateway',gateways[i].longitude);\n flow.set('maxDistanceName',msg._msgid+i);\n flow.set('maxDistanceColor',newPayload.payload.color);\n newPayload.payload.weight=15;\n }\n \n newMsg.push(newPayload); \n}\nreturn [newMsg];\n","outputs":1,"noerr":0,"x":1170,"y":1740,"wires":[["8fb12612.2dde18"]]},{"id":"53534fed.f33428","type":"change","z":"dbf050d4.6d1b1","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.metadata.gateways","tot":"msg"},{"t":"set","p":"payload.name","pt":"msg","to":"gateways","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":1640,"wires":[["9ee98fe2.aaaa1"]]},{"id":"39677e0e.5ec79a","type":"change","z":"dbf050d4.6d1b1","name":"","rules":[{"t":"set","p":"payload.name","pt":"msg","to":"globo","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":960,"y":1600,"wires":[["9ee98fe2.aaaa1"]]},{"id":"f061b951.919e58","type":"split","z":"dbf050d4.6d1b1","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":330,"y":1620,"wires":[["afec1a1e.2bfae8"]]},{"id":"afec1a1e.2bfae8","type":"json","z":"dbf050d4.6d1b1","name":"","property":"payload","action":"","pretty":false,"x":400,"y":1560,"wires":[["e88a7848.9b447"]]},{"id":"733bafea.66358","type":"worldmap-tracks","z":"dbf050d4.6d1b1","name":"track_g4lile0","depth":"100","layer":"combined","x":1230,"y":1560,"wires":[["8fb12612.2dde18"]]},{"id":"d1c497b5.d4bbe","type":"change","z":"dbf050d4.6d1b1","name":"","rules":[{"t":"set","p":"payload.name","pt":"msg","to":"globoTrack","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":1560,"wires":[["733bafea.66358"]]},{"id":"947649ab.eb5a78","type":"worldmap in","z":"dbf050d4.6d1b1","name":"","path":"/worldmap2","x":90,"y":1500,"wires":[["311bfe4b.9c2702"]]},{"id":"ee1c1822.ffc22","type":"change","z":"dbf050d4.6d1b1","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":2,\"payload_raw\":\"AmZglf/L+TsAAP8=\",\"payload_fields\":{\"altitude\":0,\"hdop\":25.5,\"latitude\":40.263829,\"longitude\":-3.409605},\"metadata\":{\"time\":\"2019-07-07T19:42:58.608655217Z\",\"frequency\":868.5,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":1052252771,\"time\":\"\",\"channel\":2,\"rssi\":-114,\"snr\":-3.2,\"rf_chain\":1,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"},{\"gtw_id\":\"eui-b827ebfffecb8bb0\",\"timestamp\":2964475483,\"time\":\"2019-07-07T19:42:58.591177Z\",\"channel\":2,\"rssi\":-109,\"snr\":3.8,\"rf_chain\":1,\"latitude\":40.3858,\"longitude\":-3.64134,\"altitude\":694}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":0,\"payload_raw\":\"AmfXp//Jn5sAAP8=\",\"payload_fields\":{\"altitude\":0,\"hdop\":25.5,\"latitude\":40.359847,\"longitude\":-3.563621},\"metadata\":{\"time\":\"2019-07-07T19:54:51.601391247Z\",\"frequency\":867.7,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffecb8bb0\",\"timestamp\":3677463404,\"time\":\"2019-07-07T19:54:51.580188Z\",\"channel\":6,\"rssi\":-114,\"snr\":0.2,\"rf_chain\":0,\"latitude\":40.3858,\"longitude\":-3.64134,\"altitude\":694}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":1,\"payload_raw\":\"Amfet//JhzsCZQk=\",\"payload_fields\":{\"altitude\":613,\"hdop\":0.9,\"latitude\":40.361655,\"longitude\":-3.569861},\"metadata\":{\"time\":\"2019-07-07T19:55:14.681555728Z\",\"frequency\":867.9,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffecb8bb0\",\"timestamp\":3700552252,\"time\":\"2019-07-07T19:55:14.662966Z\",\"channel\":7,\"rssi\":-115,\"snr\":-7.5,\"rf_chain\":0,\"latitude\":40.3858,\"longitude\":-3.64134,\"altitude\":694}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":1,\"is_retry\":true,\"payload_raw\":\"AmgC5//JNAYCig4=\",\"payload_fields\":{\"altitude\":650,\"hdop\":1.4,\"latitude\":40.370919,\"longitude\":-3.591162},\"metadata\":{\"time\":\"2019-07-07T19:56:51.739783866Z\",\"frequency\":868.1,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-d8a01dffff42d644\",\"timestamp\":3968356601,\"time\":\"\",\"channel\":0,\"rssi\":-113,\"snr\":-3,\"rf_chain\":0,\"latitude\":40.38,\"longitude\":-3.604,\"altitude\":710}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":2,\"payload_raw\":\"AmgMgf/JIA4AAP8=\",\"payload_fields\":{\"altitude\":0,\"hdop\":25.5,\"latitude\":40.373377,\"longitude\":-3.596274},\"metadata\":{\"time\":\"2019-07-07T19:57:15.597210862Z\",\"frequency\":868.3,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffecb8bb0\",\"timestamp\":3821459731,\"time\":\"2019-07-07T19:57:15.577219Z\",\"channel\":1,\"rssi\":-102,\"snr\":-7.8,\"rf_chain\":1,\"latitude\":40.3858,\"longitude\":-3.64134,\"altitude\":694}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":3,\"payload_raw\":\"AmfVl//I2pQCbQ0=\",\"payload_fields\":{\"altitude\":621,\"hdop\":1.3,\"latitude\":40.359319,\"longitude\":-3.61406},\"metadata\":{\"time\":\"2019-07-07T19:59:14.699005364Z\",\"frequency\":867.1,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffecb8bb0\",\"timestamp\":3940560683,\"time\":\"2019-07-07T19:59:14.67944Z\",\"channel\":3,\"rssi\":-115,\"snr\":0.2,\"rf_chain\":0,\"latitude\":40.3858,\"longitude\":-3.64134,\"altitude\":694}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":1,\"payload_raw\":\"AmeYUv/IOrwCTQg=\",\"payload_fields\":{\"altitude\":589,\"hdop\":0.8,\"latitude\":40.343634,\"longitude\":-3.65498},\"metadata\":{\"time\":\"2019-07-07T20:01:37.69345194Z\",\"frequency\":868.1,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffecb8bb0\",\"timestamp\":4083559235,\"time\":\"2019-07-07T20:01:37.674523Z\",\"channel\":0,\"rssi\":-114,\"snr\":0.5,\"rf_chain\":1,\"latitude\":40.3858,\"longitude\":-3.64134,\"altitude\":694}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":3,\"payload_raw\":\"Amd5t//ICMsCOw0=\",\"payload_fields\":{\"altitude\":571,\"hdop\":1.3,\"latitude\":40.335799,\"longitude\":-3.667765},\"metadata\":{\"time\":\"2019-07-07T20:02:24.684976779Z\",\"frequency\":868.5,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffecb8bb0\",\"timestamp\":4130546131,\"time\":\"2019-07-07T20:02:24.664203Z\",\"channel\":2,\"rssi\":-113,\"snr\":3,\"rf_chain\":1,\"latitude\":40.3858,\"longitude\":-3.64134,\"altitude\":694}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":3,\"is_retry\":true,\"payload_raw\":\"Amdx/v/HHGoCbwg=\",\"payload_fields\":{\"altitude\":623,\"hdop\":0.8,\"latitude\":40.333822,\"longitude\":-3.728278},\"metadata\":{\"time\":\"2019-07-07T20:05:34.722610442Z\",\"frequency\":867.1,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe8d9794\",\"timestamp\":3637753819,\"time\":\"2019-07-07T20:05:34.677517Z\",\"channel\":3,\"rssi\":-109,\"snr\":3.5,\"rf_chain\":0,\"latitude\":40.37384,\"longitude\":-3.7321}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":0,\"payload_raw\":\"AmeLyv/HHyIAAP8=\",\"payload_fields\":{\"altitude\":0,\"hdop\":25.5,\"latitude\":40.340426,\"longitude\":-3.727582},\"metadata\":{\"time\":\"2019-07-07T20:05:59.594698121Z\",\"frequency\":867.1,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe8d9794\",\"timestamp\":3662650795,\"time\":\"2019-07-07T20:05:59.574419Z\",\"channel\":3,\"rssi\":-107,\"snr\":7.2,\"rf_chain\":0,\"latitude\":40.37384,\"longitude\":-3.7321},{\"gtw_id\":\"eui-b827ebfffecb8bb0\",\"timestamp\":50493123,\"time\":\"2019-07-07T20:05:59.574348Z\",\"channel\":3,\"rssi\":-101,\"snr\":7.8,\"rf_chain\":0,\"latitude\":40.3858,\"longitude\":-3.64134,\"altitude\":694}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":1,\"payload_raw\":\"Amef3P/HD7ECcAg=\",\"payload_fields\":{\"altitude\":624,\"hdop\":0.8,\"latitude\":40.345564,\"longitude\":-3.731535},\"metadata\":{\"time\":\"2019-07-07T20:06:22.680953804Z\",\"frequency\":867.3,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe8d9794\",\"timestamp\":3685736603,\"time\":\"2019-07-07T20:06:22.657913Z\",\"channel\":4,\"rssi\":-105,\"snr\":5.2,\"rf_chain\":0,\"latitude\":40.37384,\"longitude\":-3.7321}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":1,\"is_retry\":true,\"payload_raw\":\"Amigb//FsHUC2gk=\",\"payload_fields\":{\"altitude\":730,\"hdop\":0.9,\"latitude\":40.411247,\"longitude\":-3.821451},\"metadata\":{\"time\":\"2019-07-07T20:14:12.733133053Z\",\"frequency\":868.3,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":2926365315,\"time\":\"\",\"channel\":1,\"rssi\":-110,\"snr\":2.2,\"rf_chain\":1,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":1,\"is_retry\":true,\"payload_raw\":\"AmlJnv/E1/QC4gk=\",\"payload_fields\":{\"altitude\":738,\"hdop\":0.9,\"latitude\":40.454558,\"longitude\":-3.876876},\"metadata\":{\"time\":\"2019-07-07T20:18:57.744323117Z\",\"frequency\":867.3,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":3211380883,\"time\":\"\",\"channel\":4,\"rssi\":-117,\"snr\":-3,\"rf_chain\":0,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":2,\"payload_raw\":\"AmldpP/ExkUAAP8=\",\"payload_fields\":{\"altitude\":0,\"hdop\":25.5,\"latitude\":40.459684,\"longitude\":-3.881403},\"metadata\":{\"time\":\"2019-07-07T20:19:21.596824664Z\",\"frequency\":867.5,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":3235234444,\"time\":\"\",\"channel\":5,\"rssi\":-102,\"snr\":1.8,\"rf_chain\":0,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":3,\"payload_raw\":\"Amlx6//EuKIC0Ao=\",\"payload_fields\":{\"altitude\":720,\"hdop\":1,\"latitude\":40.464875,\"longitude\":-3.884894},\"metadata\":{\"time\":\"2019-07-07T20:19:44.679496674Z\",\"frequency\":867.7,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":3258318092,\"time\":\"\",\"channel\":6,\"rssi\":-117,\"snr\":6,\"rf_chain\":0,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":1,\"payload_raw\":\"AmmVnv/Ek1ECuQk=\",\"payload_fields\":{\"altitude\":697,\"hdop\":0.9,\"latitude\":40.474014,\"longitude\":-3.894447},\"metadata\":{\"time\":\"2019-07-07T20:20:32.73383202Z\",\"frequency\":868.3,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":3306368259,\"time\":\"\",\"channel\":1,\"rssi\":-108,\"snr\":-3.2,\"rf_chain\":1,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":2,\"payload_raw\":\"Ammsbf/EjT0AAP8=\",\"payload_fields\":{\"altitude\":0,\"hdop\":25.5,\"latitude\":40.479853,\"longitude\":-3.896003},\"metadata\":{\"time\":\"2019-07-07T20:20:56.616342437Z\",\"frequency\":868.5,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":3330236675,\"time\":\"\",\"channel\":2,\"rssi\":-97,\"snr\":7,\"rf_chain\":1,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":3,\"payload_raw\":\"AmnD2P/Ej5ECrAg=\",\"payload_fields\":{\"altitude\":684,\"hdop\":0.8,\"latitude\":40.485848,\"longitude\":-3.895407},\"metadata\":{\"time\":\"2019-07-07T20:21:19.765606181Z\",\"frequency\":867.1,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":3353396867,\"time\":\"\",\"channel\":3,\"rssi\":-113,\"snr\":0,\"rf_chain\":0,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":1,\"payload_raw\":\"Amn0lf/EkVYCvAg=\",\"payload_fields\":{\"altitude\":700,\"hdop\":0.8,\"latitude\":40.498325,\"longitude\":-3.894954},\"metadata\":{\"time\":\"2019-07-07T20:22:07.729321818Z\",\"frequency\":867.5,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":3401370564,\"time\":\"\",\"channel\":5,\"rssi\":-110,\"snr\":-3.5,\"rf_chain\":0,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":0,\"payload_raw\":\"AmoU+//EhAcAAOc=\",\"payload_fields\":{\"altitude\":0,\"hdop\":23.1,\"latitude\":40.506619,\"longitude\":-3.898361},\"metadata\":{\"time\":\"2019-07-07T20:22:42.330906505Z\",\"frequency\":868.1,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":3435965707,\"time\":\"\",\"channel\":0,\"rssi\":-99,\"snr\":3.8,\"rf_chain\":1,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":0,\"is_retry\":true,\"payload_raw\":\"AmpirP/Esp0AAP8=\",\"payload_fields\":{\"altitude\":0,\"hdop\":25.5,\"latitude\":40.526508,\"longitude\":-3.886435},\"metadata\":{\"time\":\"2019-07-07T20:24:17.593623737Z\",\"frequency\":867.1,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":3531230419,\"time\":\"\",\"channel\":3,\"rssi\":-112,\"snr\":7,\"rf_chain\":0,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":1,\"payload_raw\":\"Amp34f/ErvwC2Qo=\",\"payload_fields\":{\"altitude\":729,\"hdop\":1,\"latitude\":40.531937,\"longitude\":-3.887364},\"metadata\":{\"time\":\"2019-07-07T20:24:40.722485701Z\",\"frequency\":867.3,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":3554361187,\"time\":\"\",\"channel\":4,\"rssi\":-114,\"snr\":5.2,\"rf_chain\":0,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":2,\"payload_raw\":\"AmqOKv/EpBYAAP8=\",\"payload_fields\":{\"altitude\":0,\"hdop\":25.5,\"latitude\":40.537642,\"longitude\":-3.890154},\"metadata\":{\"time\":\"2019-07-07T20:25:04.597348326Z\",\"frequency\":867.5,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":3578239068,\"time\":\"\",\"channel\":5,\"rssi\":-99,\"snr\":5,\"rf_chain\":0,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":3,\"payload_raw\":\"Amqms//EljcC6Qw=\",\"payload_fields\":{\"altitude\":745,\"hdop\":1.2,\"latitude\":40.543923,\"longitude\":-3.893705},\"metadata\":{\"time\":\"2019-07-07T20:25:27.672315543Z\",\"frequency\":867.7,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":3601311476,\"time\":\"\",\"channel\":6,\"rssi\":-101,\"snr\":8,\"rf_chain\":0,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":1,\"payload_raw\":\"Amraef/EfH0DBAk=\",\"payload_fields\":{\"altitude\":772,\"hdop\":0.9,\"latitude\":40.557177,\"longitude\":-3.900291},\"metadata\":{\"time\":\"2019-07-07T20:26:15.736059281Z\",\"frequency\":868.3,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":3649377483,\"time\":\"\",\"channel\":1,\"rssi\":-80,\"snr\":7.8,\"rf_chain\":1,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":2,\"payload_raw\":\"Amrwff/Eau8AAP8=\",\"payload_fields\":{\"altitude\":0,\"hdop\":25.5,\"latitude\":40.562813,\"longitude\":-3.904785},\"metadata\":{\"time\":\"2019-07-07T20:26:39.616993199Z\",\"frequency\":868.5,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":3673256931,\"time\":\"\",\"channel\":2,\"rssi\":-107,\"snr\":4.2,\"rf_chain\":1,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"}]}}, {\"app_id\":\"hab_2019\",\"dev_id\":\"hab2019\",\"hardware_serial\":\"009E5AF21CCD79C1\",\"port\":1,\"counter\":3,\"payload_raw\":\"Amr+Pv/ET2EDJw0=\",\"payload_fields\":{\"altitude\":807,\"hdop\":1.3,\"latitude\":40.566334,\"longitude\":-3.911839},\"metadata\":{\"time\":\"2019-07-07T20:27:02.702288006Z\",\"frequency\":867.1,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":61696000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-b827ebfffe9238fd\",\"timestamp\":3696341595,\"time\":\"\",\"channel\":3,\"rssi\":-114,\"snr\":5.5,\"rf_chain\":0,\"latitude\":40.56516,\"longitude\":-3.9209414,\"altitude\":880,\"location_source\":\"registry\"}]}}]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":1680,"wires":[["f061b951.919e58"]]},{"id":"311bfe4b.9c2702","type":"function","z":"dbf050d4.6d1b1","name":"","func":"if (msg.payload.action==\"connected\"){\n return msg;\n}\n","outputs":1,"noerr":0,"x":230,"y":1500,"wires":[["541f1bb5.5024f4"]]},{"id":"541f1bb5.5024f4","type":"change","z":"dbf050d4.6d1b1","name":"","rules":[{"t":"delete","p":"maxDistance","pt":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":150,"y":1560,"wires":[["ee1c1822.ffc22"]]}]
Ah - right the tracks array does not get flushed automatically on a rfresh so you are redrawing the set of points from where you left off - so it draws back to start and then loops forwards again. So you need to use the connect to also delete the existing track - sort of like this
Please, could you paste de json code of your modified flow?
Never mind... I've got it Thank you very very much
Please, could you include an example for the tracks node? Kind regards from Madrid.