Previously used Rpi zero 2 W:
Serial 0- ttyAMA0
Serial 1 - ttyS0
I had to use the UART(for reading coordinates in gps) and meanwhile connect bluetooth and output the audio.
things I did:in config.txt:
in cmdline.txt:my gps code :every thing worked fine. The gps data was coming, the bluetooth getting connected to phone and audio was ok.
In Raspberry pi 3b+
however the above doesnot work. I have removed the
Serial 0- ttyAMA0
Serial 1 - ttyS0
I had to use the UART(for reading coordinates in gps) and meanwhile connect bluetooth and output the audio.
things I did:
Code:
sudo systemctl stop serial-getty@ttyAMA0.servicesudo systemctl disable serial-getty@ttyAMA0.service
Code:
enable_uart = 1dtoverlay=audremap,pins_12_13dtoverlay=miniuart-bt
in cmdline.txt:
Code:
dwc_otg.lpm_enable=0 console=tty1
Code:
import serialimport timeimport stringimport pynmea2while True:port="/dev/ttyAMA0"ser=serial.Serial(port, baudrate=9600, timeout=0.5)dataout = pynmea2.NMEAStreamReader()newdata=ser.readline()if newdata[0:6] == "$GPRMC":newmsg=pynmea2.parse(newdata)lat=newmsg.latitudelng=newmsg.longitudegps = "Latitude=" + str(lat) + "and Longitude=" + str(lng)print(gps)
In Raspberry pi 3b+
however the above doesnot work. I have removed the
and then connected to the bluetooth. RPI3 has its own audio jack. so after connecting to the jack nothing was audible and the Bluetooth Icon on the tool bar disappeared.audremap
Statistics: Posted by Mbedead — Tue May 14, 2024 1:47 am