Introduction

Node-RED is a programming tool to wire together hardware devices, APIs and online services in new and interesting ways.
Ofrece un editor basado en el navegador que facilita el cableado de los flujos utilizando la amplia gama de nodos de la paleta que pueden desplegarse en su tiempo de ejecución con un solo clic.
As it is quite fascinating to use for open source projects, you are going to learn how to get GPS coordinates from your SIM7600E module and put them in a Google Maps Widget in Node-RED Dashboard.
Related links
Explanation
En este blog, aprenderás cómo obtener las coordenadas GPS con un Widget de Mapa de Node-RED. Continuemos con el post siguiente:
👉 Cómo obtener la localización GPS en el Panel PC Read >>
Instalación y actualización de Node-RED
sudo apt install build-essential git
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
The script above will:
Remove the pre-packaged version of Node-RED and Node.js if present.
Instalará la versión actual de Node.js LTS utilizando el NodeSource. Si detecta que Node.js ya está instalado desde NodeSource, se asegurará de que sea al menos Node 8, pero en caso contrario lo dejará solo.
Install the latest version of Node-RED using npm.
Optionally, install a collection of useful Pi-specific nodes.
Setup Node-RED to run as a service and provide a set of commands to work with the service.
Autoinicio en el arranque
If you want Node-RED to run when the Pi is turned on, or re-booted, you can enable the service to autostart by running the command:
sudo systemctl enable nodered.service
To disable the service, run the command:
sudo systemctl disable nodered.service
To know more about Node-RED installation, check out the following link:
👉 Running on Raspberry Pi Leer >>
GPSD
Go to the Side Tab Menu > Click on Manage Palette > Install > Type "gpsd" > Install the node-red-contrib-gpsd package:
Instalar los nodos del Mapa
Ahora, vas a instalar algunos nodos para el Widget de Mapa.
Go to the Side Tab Menu > Click on Manage Palette > Install > Type "web-worldmap" > Install the node-red-contrib-web-worldmap package:
Obtención de coordenadas GPS

Verás que empezarás a recibir datos inmediatamente, cada segundo. Así que, si quieres controlar ese tiempo, solo tienes que añadir un nodo de retardo entre el nodo GPS del Adafruit Ultimate y el nodo del interruptor, con la configuración que quieras. Por ejemplo, intenta recibir 1 msg cada 5 segundos, y elimina los mensajes intermedios.
Añadir el nodo WorldMap
Once you get all the GPS data, you are going to add two world map nodes so that it displays in the Dashboard correctly:


If you take a look at the node help documentation, the minimum msg.payload from the worldmap nodes, must contain name, lat and lon properties.
E.g. { "name": "John", "lat": 41.45, "lon": 1.53 }
Connect this to the world map node as shown below:
And go to your Dashboard to check your map with your location! Your flow should something be like this:
[{"id":"6e545ede.d4925","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"7a97b4c5.876cfc","type":"gpsd","z":"6e545ede.d4925","name":"Adafruit Ultimate GPS","hostname":"0.0.0.0","port":"2947","tpv":true,"sky":true,"info":false,"device":true,"gst":false,"att":false,"x":140,"y":200,"wires":[["6560f5f6.c0ed8c"]]},{"id":"6560f5f6.c0ed8c","type":"switch","z":"6e545ede.d4925","name":"","property":"payload.class","propertyType":"msg","rules":[{"t":"eq","v":"TPV","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":200,"wires":[["4d22a0bd.63dda"]]},{"id":"2cf3ed7c.bd6ad2","type":"ui_worldmap","z":"6e545ede.d4925","group":"88f77589.0122d8","order":2,"width":"14","height":"14","name":"Worldmap ","lat":"","lon":"","zoom":"","layer":"OSM grey","cluster":"","maxage":"","usermenu":"show","layers":"show","panit":"true","panlock":"false","zoomlock":"true","hiderightclick":"false","coords":"deg","showgrid":"false","allowFileDrop":"false","path":"/mapui","x":710,"y":120,"wires":[]},{"id":"4d22a0bd.63dda","type":"change","z":"6e545ede.d4925","name":"","rules":[{"t":"set","p":"payload.name","pt":"msg","to":"Worldmap","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":200,"wires":[["23b5e03.345882"]]},{"id":"23b5e03.345882","type":"worldmap","z":"6e545ede.d4925","name":"","lat":"","lon":"","zoom":"","layer":"Esri Satellite","cluster":"","maxage":"","usermenu":"show","layers":"show","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"false","coords":"none","showgrid":"false","allowFileDrop":"false","path":"/mapui","x":730,"y":200,"wires":[]},{"id":"88f77589.0122d8","type":"ui_group","name":"","tab":"c4c17961.4519f8","order":1,"disp":true,"width":15,"collapse":false},{"id":"c4c17961.4519f8","type":"ui_tab","name":"Location","icon":"dashboard","disabled":false,"hidden":false}]
Tutorial de Node-RED: Cómo obtener las coordenadas GPS con un widget de mapas