After executing the dmesg command, an error message appears in the printed log indicating that GPIO9 is occupied, as shown in the figure below. What should I do?

gpio9

Solution:​

  1. Execute the following command in the command window to open the config.txt file.
sudo nano /boot/firmware/config.txt
  1. Find the parameter dtparam=spi=on in the config.txt file and add a # symbol in front of it (as shown in the figure below) to disable the SPI interface.
gpio9
  1. Press Ctrl+S to save the changes to the file, and then press Ctrl+X to exit the file editing mode.

  2. Execute the following command to restart the device and make the configuration take effect.

sudo reboot