First I'll start with explaining what "Bi-directional serial communications" are.
Bi-directional serial communications are those where each device can receive and send data at the same time. They use special flow control signals that allow Bi-directional operation to happen such as DCD (Carrier Detect), DTR (Data Terminal Ready) and CTS (Clear To Send). There is also Bi-directional serial communications that can happen over one wire, but that is way out of scope for this discussion, so lets ignore that definition.
This is NOT the way a Nextion communicates using RS-232 serial communications, for one thing it doesn't have the needed DCD, DTR, or CTS signals.
A Nextion has 4 wires. One wire for receiving serial data (RxData) and one for transmitting serial data (TxData), ground (GND) and power (+5v). Yes, both data signals "could" operate at exactly the same time, but the software isn't programmed for that situation, so it can never actually happen, which is why it isn't bi-directional, it is actually half-duplex. Messages just get stored in a queue ( called a ringbuffer) until the software checks for something in the queue and then if it sees something in the queue it processes it. I think this is where people confuse what Bi-directional actually is, and don't understand that standard RS-232 communications work in both transmit and receive separately. Think of it like a 2 lane road, traffic moves on one side in one direction, and on the other side in the opposite direction. The traffic on one side of the road has no relation to the other side of the road.
The Nextion has two ways of receiving messages and human input. The first is it is just sitting there listening for messages over the serial bus for it to be told what to do and what to display. The second is it is listening/waiting to receive a human touch input from a mechanical interaction with a persons finger or stylus. In normal operation the only time a Nextion is sending any messages back to MMDVMHost is when it has detected a touch input, the rest of the time it is just sitting there receiving messages from MMDVMHost.
The difference between, /dev/ttyAMA0, /dev/ttyUSB0, /dev/ttyNextionDriver and "modem"
Is the built in serial port on Raspberry Pi board. It is on GPIO pins 8 (TxData), and 10 (RxData). It is used by GPIO connected MMDVM/MMDVM_HS hats to communicate with the RPi. The only time it can be assigned to a Nextion is if you plug a Nextion into pin 8 and 10, 2 (or 4), and 6 and you are using a USB connected MMDVM/MMDVM_HS hat (if you set the software to use /dev/ttyAMA0 and you are using a GPIO connected hat the hat will stop communicating and halt, because you cannot have two different devices operating on one serial port).
Is the device assigned to a USB connected device. For Nextions this requires a USB/TTL (Transistor-Transistor Logic) adapter to convert the USB into serial TTL for the Nextion to communicate. It is basically a converter from USB to serial, and serial back to USB.
Is a pseudo terminal used to transfer information/messages between MMDVMHost and the Nextion Driver for special messages that get displayed on the Nextion. It is required when using the Nextion Driver and the Nextion Driver Installer should automatically configure it for you when you execute the script to install it.
Is a special "keyword" used in the MMDVMHost software to tell the MMDVMHost software that the Nextion is connected to the Nextion port on MMDVM/MMDVM_HS hats. This piggy backs communications by sending messages for the Nextion on the already established MMDVM/MMDVM_HS serial communications over the GPIO. The STM32 microprocessor on the MMDVM/MMDVM_HS hat then forwards the messages to the Nextion through the STM32 and out of the Nextion port on the hat.
Note*, modem it is different than "/dev/modem" so do not use "/dev/modem".
The differences between USB/TTL connected Nextions and "modem" connected Nextions.
THERE IS NO MAJOR DIFFERENCE IN DAILY OPERATION. THEY BOTH FUNCTION EXACTLY THE SAME. Both configurations will display messages and data from MMDVMHost.
USB/TTL adapters are faster by default at 115200 baud, while "modem" connected Nextions operate at 9600 baud by default**. Speed is not critical to operation and messages cannot be missed or lost, because it uses queues. 9600 baud is 9600 symbols per second, and the amount of symbols being passed from MMDVMHost every second is no where near 9600, so speed is never an issue.
Note** = custom MMDVM_HS firmware can use the following baud rates to communicate:
Code: Select all
1200 2400 4800 9600 14400 19200 28800 38400 57600 76800 115200 230400 460800 921600
Here are some examples of how to hook up the two different types
USB/TTL adapter: default baud rate must be set to 115200 in the Nextion prior to operation. "modem" connection on the MMDVM/MMDVM_HS hat. default baud rate must be set to 9600 in the Nextion prior to operation. These diagrams show how in the USB/TTL adapter configuration the messages for a Nextion are sent out of the USB port and displayed on the Nextion. In the "modem" configuration the messages pass through /dev/ttyAMA0 to the STM32 on the MMDVM/MMDVM_HS hat, and then are forwarded out of the STM32 to the Nextion. The serial communications happening over /dev/ttyAMA0 between MMDVMHost and the STM32 are at 115200 baud and have no increased latency with the added messages destined for the Nextion. Also message/data loss is pretty much impossible.
I hope this explains that there really is no operational difference between the two connection types so others will quit regurgitating incorrect information to others.