Setup
- Raspberry Pi 4, running Bullseye
- USB Gps receiver
- Camera connected to the ribbon camera port
Problem I am successfully able to read from the Gps receiver, but as soon as I call the start method of Picamera2, the results of my GPS data become highly unreliable.
Sample Code
from picamera2 import Picamera2
import serial,pynmea2
enable_camera = False
if(enable_camera):
picam = Picamera2()
config = picam.create_preview_configuration()
picam.configure(config)
picam.start()
port = '/dev/ttyACM0'
baud = 9600
serialPort = serial.Serial(port, baudrate = baud)
while True:
try:
serial_raw = serialPort.readline()
str = serial_raw.decode().strip()
if str.find('GGA') > 0:
gga_data = pynmea2.parse(str)
print(gga_data)
except Exception as e:
print(e)
Output Sample Output Working
I am trying to capture images and Gps data