By the end of this section, you will gain experience in the following topics:
  • Establishing a serial port connection between the developer’s computer and the Gemstone board using a USB TTL cable.
  • Communicating between both computers via a terminal.
  • Preliminary preparation for the t3gemstone/examples/serial project.
A serial port is a communication channel that enables data transmission between devices such as computers and microcontrollers. This communication typically occurs via the UART (Universal Asynchronous Receiver-Transmitter) protocol and is ideal for low-speed data transmission. For example, serial ports are often preferred when communicating with external modules like GPS or Radio Transmitters.
1

SSH/VNC Connection

Connect to the development board using one of the methods: SSH or VNC.
2

Shell

Create Bash Shell scripts.
3

TTL and Terminal

Connect the developer’s computer and the Gemstone board using a TTL cable and perform data exchange via the Tabby.sh terminal.

1. Creating a Shell Script

Create a script file for opening the serial port and sending data.
touch serial-test.sh

2. Using a Text Editor

Open the serial-test.sh file using the nano text editor from the terminal interface.
nano serial-test.sh
After copying the following code, paste it into the serial-test.sh file.
#!/bin/bash

SERIAL_PORT="/dev/ttyS3"
BAUD_RATE="115200"

stty -F /dev/ttyS3 115200 -crtscts

while true; do
    echo "Teknofest" > $SERIAL_PORT
    sleep 1
done
Press CTRL+X, then press Y to save and exit the nano editor.

3. Running the Shell Script

Make the serial-test.sh file executable using the chmod command and start it.
chmod +x serial-test.sh
./serial-test.sh

4. Communication