Bird
0
0
Raspberry Piprogramming~20 mins

Enabling serial on Raspberry Pi - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Serial Master on Raspberry Pi
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of checking serial port status?

You run the command systemctl status serial-getty@ttyAMA0.service on your Raspberry Pi after enabling serial. What output indicates the serial port is active and running?

Raspberry Pi
systemctl status serial-getty@ttyAMA0.service
AActive: active (running) since ...
BActive: inactive (dead)
CFailed to start serial-getty@ttyAMA0.service: Unit not found.
DActive: activating (start) since ...
Attempts:
2 left
💡 Hint

Look for the word 'active' and 'running' in the status output.

🧠 Conceptual
intermediate
1:30remaining
Which file must be edited to disable serial console on Raspberry Pi?

To enable serial communication without console interference, you need to disable the serial console. Which file do you edit to remove the serial console from the boot parameters?

A/boot/cmdline.txt
B/etc/serial-getty.conf
C/boot/config.txt
D/etc/serial.conf
Attempts:
2 left
💡 Hint

This file contains kernel boot parameters.

Predict Output
advanced
2:00remaining
What is the output of enabling serial via raspi-config?

You run sudo raspi-config and enable serial hardware but disable serial login shell. After reboot, what is the expected output of ls -l /dev/serial0?

Raspberry Pi
ls -l /dev/serial0
Als: cannot access '/dev/serial0': No such file or directory
Bcrw-rw---- 1 root dialout 204, 64 date /dev/serial0
Clrwxrwxrwx 1 root root 7 date /dev/serial0 -> ttyS0
Dlrwxrwxrwx 1 root root 7 date /dev/serial0 -> ttyAMA0
Attempts:
2 left
💡 Hint

Check which device the serial0 symlink points to after enabling serial hardware.

🔧 Debug
advanced
2:30remaining
Why does serial communication fail after enabling serial console?

You enabled serial hardware and serial console on Raspberry Pi. However, your serial communication program receives no data. What is the most likely cause?

AThe serial port is disabled in /boot/config.txt.
BSerial console is using the serial port, blocking other programs.
CThe serial cable is connected to the wrong GPIO pins.
DThe baud rate in the program is set incorrectly.
Attempts:
2 left
💡 Hint

Think about what happens when the serial console is active.

🚀 Application
expert
3:00remaining
How to permanently enable serial port and disable serial console on Raspberry Pi?

Which sequence of steps correctly enables the serial port for communication and disables the serial console permanently on Raspberry Pi?

A1. Add 'enable_uart=1' to /boot/config.txt<br>2. Enable serial console in raspi-config<br>3. Reboot the Pi
B1. Add 'dtoverlay=disable-bt' to /boot/config.txt<br>2. Enable serial console in raspi-config<br>3. Reboot the Pi
C1. Remove 'console=serial0,115200' from /boot/cmdline.txt<br>2. Enable serial hardware in raspi-config<br>3. Reboot the Pi
D1. Remove 'enable_uart=1' from /boot/config.txt<br>2. Disable serial hardware in raspi-config<br>3. Reboot the Pi
Attempts:
2 left
💡 Hint

Disabling serial console means removing it from boot parameters, and enabling hardware means using raspi-config.