Cómo obtener la ubicación GPS en Panel PC
Uso del módulo SIM7600E y el control de la PC del panel TouchBerry Pi de 10 "
19 mayo, 2021 por
Cómo obtener la ubicación GPS en Panel PC
Boot & Work Corp. S.L., Fernandez Queralt Martinez

INTRODUCTION

The SIM800L module is the integrated module for the use of GPRS/GSM in Industrial Shields PLC.

El SIM7600E es una solución de módulo multibanda LTE-TDD / LTE-FDD / HSPA + y GSM / GPRS / EDGE para transferencia de datos de enlace descendente. Tiene una gran capacidad de extensión con interfaces ricas que incluyen UART, USB2.0, I2C, GPIO, etc. El módulo proporciona mucha flexibilidad y facilidad de integración para la aplicación del cliente.

So, let's see how to test our Touchberry Pi 10 with GPS and GPRS modules for industrial monitoring!

    Requirements

                Explanation

                In this post, you will learn how to get GPS location on your Raspberry Pi based Industrial Panel PC monitoring. By doing this, you will learn how to:

                1. Communicate with your GPS and GPRS modules using AT commands.

                2. Get location from GPS coordinates.

                So, let's start!

                First of all, ensure that the hardware is right connected like so:

                Hardware correctamente conectado para obtener la ubicación GPS en Panel PC








                1. Once the hardware is ready, let's check that we communicate to the GPS/GPRS modules through the Serial Port.

                So, open up a terminal window in your TouchBerry Pi 10, and go to raspi-config:

                sudo raspi-config

                Then, go to the Interface Options > Serial port and disable the login shell and enable the serial interface.


                2. Now, let's check that your device can recognize the USB ports. 

                By running the following command:

                ls /dev/ttyUSB*

                you should see the following:

                /dev/ttyUSB0  /dev/ttyUSB1  /dev/ttyUSB2  /dev/ttyUSB3  /dev/ttyUSB4  


                3. Install the screen tool to be able to read the data through the Serial Port:

                sudo apt-get update
                sudo apt-get install screen


                4. Now, open the /dev/ttyUSB2 at 115200 as baudrate, and let's start using the AT commands to communicate with our modules: 

                screen /dev/ttyUSB2 115200


                5. Run the following commands:

                AT               <--- Send to get module connection
                OK               <--- Receive
                AT+CGPS=1,1     <--- Send to enable GPS
                OK               <---- Receive
                AT+CGPSINFO: (Your GPS coordinates should appear here)

                 

                Click on the link below to know more about AT commands:

                Read >>


                6. Open the /dev/ttyUSB1 port to get the GPS data:

                screen /dev/ttyUSB1 115200


                GPS Daemon

                Another way of getting GPS data is by installing GPS Daemon.

                1. So, let's install a GPS Daemon so that it understands the serial data that our GPS module is providing via Serial Port.

                sudo apt-get update
                sudo apt-get install gpsd gpsd-clients


                2. Now, run gps data service in background:

                sudo gpsd /dev/ttyUSB1 -F /var/run/gpsd.sock


                3. Finally, run the command below to get GPS data through a monitor that watches packets and displays them along with diagnostic information.

                gpsmon


                If you get any error, try the following:

                1. Kill the gpsd processes:

                sudo killall gpsd


                2. Restart the gpsd socket and service

                sudo systemctl restart gpsd.socket gpsd.service


                3.  Run gpsd data service in background.

                sudo gpsd /dev/ttyUSB1 -F /var/run/gpsd.sock


                So, if you did it right, you should see all GPS data coming to the Serial Port of your Industrial Panel PC for industrial automation! :)

                Check out the following link to learn how to get GPS coordinates with a Google Maps Widget,  using Node-RED

                Cómo obtener la ubicación GPS en Panel PC
                Boot & Work Corp. S.L., Fernandez Queralt Martinez
                19 mayo, 2021
                Compartir
                Archivar

                ¿Buscas tu controlador lógico programable ideal?

                Echa un vistazo a esta comparativa de producto de varios controladores industriales basados en Arduino.

                Comparamos entradas, salidas, comunicaciones y otras especificaciones con las de los equipos de otras marcas destacadas.


                Comparación PLC industrial >>>

                ¿Quieres más información?

                ¡Rellena el formulario!

                ¡Cuéntame más!