Hello I have this project that requires users to add waypoints onto a world map dashboard which will send coordinates to a small vehicle powered by a Jetson Nano which would then navigate to those coordinates. It will also contain a UI group that will have gauges connected to external sensors to display environmental information.
So far it seems to be working fine, however there are two issues I'm dealing with. The first being that if I switch between the different groups (Sensors and World Map) any of the waypoints I made on the map are removed when I go to the sensor group and back to the world map group.
Here is my flow to test out:
[{"id":"2e76b3c6.13b85c","type":"tab","label":"Default Flow","disabled":false,"info":""},{"id":"fa913f62.527d5","type":"serial in","z":"2e76b3c6.13b85c","name":"Uno","serial":"8a11e895.023138","x":50,"y":620,"wires":[["1b347714.4a2769"]]},{"id":"7c19eb52.800184","type":"ui_gauge","z":"2e76b3c6.13b85c","name":"","group":"248ec348.cf595c","order":2,"width":5,"height":4,"gtype":"gage","title":"Temperature","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":570,"y":200,"wires":[]},{"id":"e09e7acc.4d3cc8","type":"ui_gauge","z":"2e76b3c6.13b85c","name":"","group":"248ec348.cf595c","order":3,"width":5,"height":4,"gtype":"gage","title":"Humidity","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":560,"y":240,"wires":[]},{"id":"fc6c927.7266b7","type":"ui_gauge","z":"2e76b3c6.13b85c","name":"","group":"248ec348.cf595c","order":4,"width":5,"height":4,"gtype":"gage","title":"Oxygen","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":560,"y":280,"wires":[]},{"id":"4a07774b.755e98","type":"ui_gauge","z":"2e76b3c6.13b85c","name":"","group":"248ec348.cf595c","order":5,"width":5,"height":4,"gtype":"gage","title":"CO2","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":550,"y":320,"wires":[]},{"id":"57847025.3455","type":"ui_template","z":"2e76b3c6.13b85c","group":"248ec348.cf595c","name":"Logo / Clock","order":1,"width":0,"height":0,"format":"<script id=\"clockScript1\" type=\"text/javascript\">\n var clockInterval;\n $(function () {\n if (clockInterval) return;\n\n //add logo\n var div1 = $('<div/>');\n var logo = new Image();\n\n logo.src = 'https://www.ucf.edu/brand/files/2016/07/UCF-tab-NoBleed_vert-KG-7406.png'\n logo.height = 45;\n div1[0].style.margin = '10px auto';\n\n div1.append(logo);\n\n //add clock\n var div2 = $('<div/>');\n var p = $('<p/>');\n\n div2.append(p);\n div2[0].style.margin = '5px';\n\n function displayTime() {\n p.text(new Date().toLocaleString());\n }\n \n clockInterval = setInterval(displayTime, 1000);\n\n //add to toolbar when it's available\n var addToToolbarTimer;\n \n function addToToolbar() {\n var toolbar = $('.md-toolbar-tools');\n \n if(!toolbar.length) return;\n \n toolbar.append(div1);\n toolbar.append(div2);\n clearInterval(addToToolbarTimer);\n }\n addToToolbarTimer = setInterval(addToToolbar, 100);\n });\n</script>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","className":"","x":70,"y":460,"wires":[[]]},{"id":"5271f6a0.938c48","type":"ui_gauge","z":"2e76b3c6.13b85c","name":"","group":"248ec348.cf595c","order":6,"width":5,"height":4,"gtype":"gage","title":"Light","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":550,"y":360,"wires":[]},{"id":"2f3b3c56.6e34c4","type":"ui_gauge","z":"2e76b3c6.13b85c","name":"","group":"248ec348.cf595c","order":7,"width":5,"height":4,"gtype":"gage","title":"UV","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":550,"y":400,"wires":[]},{"id":"81778df8.f97ba","type":"ui_gauge","z":"2e76b3c6.13b85c","name":"","group":"248ec348.cf595c","order":8,"width":5,"height":4,"gtype":"gage","title":"Particulate Matter","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":590,"y":440,"wires":[]},{"id":"9304bc7a.fdb0e","type":"ui_gauge","z":"2e76b3c6.13b85c","name":"","group":"248ec348.cf595c","order":9,"width":5,"height":4,"gtype":"gage","title":"VOC","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":550,"y":480,"wires":[]},{"id":"ca12ebb0.f99368","type":"ui_worldmap","z":"2e76b3c6.13b85c","group":"c519da4c.f6bf9","order":9,"width":"0","height":"0","name":"","lat":"","lon":"","zoom":"16","layer":"OSM","cluster":"","maxage":"","usermenu":"show","layers":"hide","panit":"true","panlock":"false","zoomlock":"false","hiderightclick":"false","coords":"dms","showgrid":"false","allowFileDrop":"false","path":"/worldmap","mapname":"","mapurl":"","mapopt":"","mapwms":false,"x":800,"y":840,"wires":[]},{"id":"d9bbf301.8154f","type":"function","z":"2e76b3c6.13b85c","name":"Get Current Location","func":"var current_lat = msg.payload.latitude;\nvar current_lon = msg.payload.longitude;\n\nreturn {\n payload: {\n lat : current_lat,\n lon: current_lon,\n name: \"Vehicle\",\n icon: \"car\",\n iconColor: \"red\"\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":700,"wires":[["ca12ebb0.f99368"]]},{"id":"4b3d60b1.dda66","type":"change","z":"2e76b3c6.13b85c","name":"Latitude","rules":[{"t":"change","p":"payload","pt":"msg","from":"Lat=","fromt":"str","to":"","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"latitude","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":580,"wires":[["cdcb5858.d2ea78"]]},{"id":"1b347714.4a2769","type":"switch","z":"2e76b3c6.13b85c","name":"Lat/Lon","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"Lat","vt":"str"},{"t":"cont","v":"Lon","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":240,"y":620,"wires":[["4b3d60b1.dda66"],["faaf0555.51c6d8"]]},{"id":"faaf0555.51c6d8","type":"change","z":"2e76b3c6.13b85c","name":"Longitude","rules":[{"t":"change","p":"payload","pt":"msg","from":"Lon=","fromt":"str","to":"","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"longitude","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":660,"wires":[["cdcb5858.d2ea78"]]},{"id":"cdcb5858.d2ea78","type":"join","z":"2e76b3c6.13b85c","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":570,"y":620,"wires":[["d9bbf301.8154f"]]},{"id":"6f62eeb0.9ded8","type":"worldmap in","z":"2e76b3c6.13b85c","name":"","path":"/worldmap","events":"all","x":60,"y":860,"wires":[["85fb0dd1.d16e","763f29e4.75ce38"]]},{"id":"2326142.34db5ec","type":"function","z":"2e76b3c6.13b85c","name":"","func":"var menu ='Enter Waypoint</br>'; \nmenu +='<center>'\nmenu += '<input type=\"text\" name=\"name\" onchange=\\'addToForm(this.name,this.value)\\'></input><br/>'\nmenu +='</center>'\nmenu +='<center>'\nmenu +='<button name=\"waypoint\" onclick=\\'feedback(this.name,\"$form\",null,true)\\'>Submit</button>'\nmenu +='</center>'\nmsg.payload = { command: { \"contextmenu\":menu } }\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":980,"wires":[["ca12ebb0.f99368"]]},{"id":"85fb0dd1.d16e","type":"switch","z":"2e76b3c6.13b85c","name":"action: connected?","property":"payload.action","propertyType":"msg","rules":[{"t":"eq","v":"connected","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":290,"y":980,"wires":[["2326142.34db5ec"]]},{"id":"763f29e4.75ce38","type":"switch","z":"2e76b3c6.13b85c","name":"action: feedback?","property":"payload.action","propertyType":"msg","rules":[{"t":"eq","v":"feedback","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":290,"y":900,"wires":[["3752b989.f675c6"]]},{"id":"3752b989.f675c6","type":"function","z":"2e76b3c6.13b85c","name":"Add Waypoint","func":"var latitude = msg.payload.lat;\nvar longitude = msg.payload.lon;\nvar name = msg.payload.value.name;\nreturn {\n payload: {\n lat : latitude,\n lon: longitude,\n name: name\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":480,"y":900,"wires":[["ca12ebb0.f99368","f190f162.08f27","44db7d04.edd1e4"]]},{"id":"f190f162.08f27","type":"ui_template","z":"2e76b3c6.13b85c","group":"c519da4c.f6bf9","name":"Waypoint Notification","order":1,"width":"8","height":"1","format":"<div>Traveling to : {{msg.payload.name}}</div>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":780,"y":980,"wires":[[]]},{"id":"44db7d04.edd1e4","type":"serial out","z":"2e76b3c6.13b85c","name":"Send Waypoint Out","serial":"8a11e895.023138","x":770,"y":1040,"wires":[]},{"id":"cf87b249.a939e","type":"debug","z":"2e76b3c6.13b85c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":350,"y":300,"wires":[]},{"id":"e3875d07.dc839","type":"inject","z":"2e76b3c6.13b85c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":60,"y":120,"wires":[["e5122ebf.4c75d"]]},{"id":"590deaea.c11944","type":"debug","z":"2e76b3c6.13b85c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":210,"y":180,"wires":[]},{"id":"e5122ebf.4c75d","type":"i2c in","z":"2e76b3c6.13b85c","name":"","busno":"1","address":"8","command":"","count":"31","x":70,"y":200,"wires":[["dc8e10c1.46873","590deaea.c11944"]]},{"id":"dc8e10c1.46873","type":"buffer-parser","z":"2e76b3c6.13b85c","name":"I2C Package Parser","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int16le","name":"DistanceFL","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"DistanceRL","offset":2,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"DistanceFR","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"DistanceRR","offset":6,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"Oxygen","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"Lux","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"uint16le","name":"UV","offset":14,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int32le","name":"VOC_Index","offset":18,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"Temp","offset":22,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"Humidity","offset":26,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"bool","name":"Unlocked","offset":27,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":220,"y":240,"wires":[["cf87b249.a939e"]]},{"id":"5e387e43.32158","type":"function","z":"2e76b3c6.13b85c","name":"Deleted","func":"var latitude = msg.payload.lat;\nvar longitude = msg.payload.lon;\nvar name = msg.payload.name;\nreturn {\n payload: {\n lat : latitude,\n lon: longitude,\n name: name,\n deleted: true\n }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":420,"y":800,"wires":[[]]},{"id":"58d7996.db4dc68","type":"function","z":"2e76b3c6.13b85c","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":670,"y":1120,"wires":[[]]},{"id":"8a11e895.023138","type":"serial-port","serialport":"/dev/ttyACM0","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","waitfor":"","dtr":"none","rts":"none","cts":"none","dsr":"none","newline":"\\n","bin":"false","out":"char","addchar":"","responsetimeout":"10000"},{"id":"248ec348.cf595c","type":"ui_group","name":"Sensor Gauges","tab":"f0ad5670.9ce5c8","order":1,"disp":false,"width":20,"collapse":false,"className":""},{"id":"c519da4c.f6bf9","type":"ui_group","name":"World Map","tab":"89d4bd9a.635d3","order":1,"disp":false,"width":"16","collapse":false,"className":""},{"id":"f0ad5670.9ce5c8","type":"ui_tab","name":"UCF Auto Vehicle","icon":"dashboard","disabled":false,"hidden":false},{"id":"89d4bd9a.635d3","type":"ui_tab","name":"World Map","icon":"dashboard","disabled":false,"hidden":false}]
Is there any way to fix this?