GPS shield disrupts my Serial port communication.

I am working on a project where, on an Arduino Uno. I use a sensor to capture some data and a LoRa/GPS shield to attach some location/time info to it and send it back to a server.

The materials I use are:

  • An arduino Uno R3
  • A serial sensor that operates on demand at 38400 bauds and 8n2 mode. During testing and because of the pandemic I have not been able to use the physical sensor, but it's emulated by the USB connection and a python script.
  • This Lora/GPS shield

The emulated sensor worked perfectly and all the data transmitted was received correctly.
I decided to use the hardware serial on the UNO for the sensor because SoftwareSerial.h did not allow for 8n2 serial mode.

However, once I imported the TinyGPS library into my project and called functions gps.get_position(), I started noticing that some of the data from the "sensor" failed to arrive or got corrupted.
I am not sure whether this is because of the GPS creating interferences when active or the TinyGPS library creating some timing issues that results in faulty readings of the serial port data.

I wanted to try to dedicate the hardware serial to the gps and use the softserial for the sensor to see if that fixed the issue, but I don't know if there is a way to make a 8n2 software serial.

Has anything similar happened to any of you?

I wanted to try to dedicate the hardware serial to the gps and use the softserial for the sensor to see if that fixed the issue, but I don't know if there is a way to make a 8n2 software serial.

I'm not aware that the shield you're using is able to provide that possibility.

However, once I imported the TinyGPS library into my project and called functions gps.get_position(), I started noticing that some of the data from the "sensor" failed to arrive or got corrupted.

get_position() only does some calculations on data provided to the library by other calls (e.g. encode()). As you failed to post your code we're not able to help you to find the error in your code.