Quantcast
Viewing all articles
Browse latest Browse all 5402

General discussion • Unable to use Uart and Bluetooth in Rpi3 with audio output.

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:

Code:

sudo systemctl stop serial-getty@ttyAMA0.servicesudo systemctl disable serial-getty@ttyAMA0.service
in config.txt:

Code:

enable_uart = 1dtoverlay=audremap,pins_12_13dtoverlay=miniuart-bt

in cmdline.txt:

Code:

dwc_otg.lpm_enable=0 console=tty1 
my gps code :

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)
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
audremap
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.

Statistics: Posted by Mbedead — Tue May 14, 2024 1:47 am



Viewing all articles
Browse latest Browse all 5402

Trending Articles