Raspberry Pi SPI and I2C Tutorial
If you've gone through raspi-config and enabled the SPI/I2c from 'Advanced Options', yet the devices are not in the device tree, don't lose hope. There are two files that should be examined. We found that somtimes the raspi-config utility doesn't solve the problem, depending on what version of Pi, where raspbian was sourced from, and when the last update has occurred.
Sometimes the raspi-config tool will incorrectly edit /boot/config.txt while selecting the advanced settings. What happens is an erroneous control-char is placed in the file.
Fix the line breaking in the file so it looks something like this:
If they are not present, add the following to the end of
Reboot the System
After checking the files, reboot by issuing
sudo reboot or
sudo shutdown -r now.