Jul-16-2024, 03:48 PM
I have a Python program in which I am trying to write to two different serial displays
I define port1 and port2 as shown below:
The output for port1 is on GPIO14 (pin 8)
I cannot find a devicename to use for port2 that does not give an error.
The Raspberry Pi file config.txt has an entry as follows:
[all]
enable_uart=1
I believe that I have to enable a uart for my second display.
I added the following under the [all] section:
dtoverlay=uart2
enable_uart=2
the Raspberry Pi documentation states uart2 TX is GPIO0 (pin27) and RX is GPIO1 (pin 28)
I can write to the display on GPIO14 using the port1 definition with no issue.
My issue is what do I use for the devicename in the port2 statement and is what I did to enable uart2 correct? I am using a Raspberry Pi 4B and Raspberry Pi OS version Bookworm.
I define port1 and port2 as shown below:
1 2 |
port1 = serial.Serial( "/dev/serial0" ,baudrate = 9600 ,timeout = 3.0 ) port2 = serial.Serial( "/dev/devicename" ,baudrate = 9600 ,timeout = 3.0 ) |
I cannot find a devicename to use for port2 that does not give an error.
The Raspberry Pi file config.txt has an entry as follows:
[all]
enable_uart=1
I believe that I have to enable a uart for my second display.
I added the following under the [all] section:
dtoverlay=uart2
enable_uart=2
the Raspberry Pi documentation states uart2 TX is GPIO0 (pin27) and RX is GPIO1 (pin 28)
I can write to the display on GPIO14 using the port1 definition with no issue.
My issue is what do I use for the devicename in the port2 statement and is what I did to enable uart2 correct? I am using a Raspberry Pi 4B and Raspberry Pi OS version Bookworm.