Please note: Friday June 18 is a holiday celebrating Juneteenth, please allow extra time for your order to arrive and plan accordingly.
0

Trouble with 2.2" TFT LCD Display
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trouble with 2.2" TFT LCD Display

by Dylan_Cullen on Thu Mar 01, 2018 9:58 am

Hello,
I am currently attempting to run a 2.2” TFT LCD display (https://www.adafruit.com/product/1480) on a BeagleBone Green Wireless. I am following an Adafruit tutorial (found here https://learn.adafruit.com/user-space-spi-tft-python-library-ili9341-2-8 ). Though the tutorial is not specifically made for this configuration, Matthew McMillian has accomplished this and has his experience (http://matthewcmcmillan.blogspot.com/2014/09/experimenting-with-beaglebone-black-and-tft.html?_sm_au_=iVVDWZnWZkbrkNGJ) linked to in the Adafruit tutorial. After retrieving the Adafruit ILI9341 library the setup.py install script was run using the following command:
Code: Select all | TOGGLE FULL SIZE
sudo python setup.py install

Once this script is executed I attempt to run the example image.py and it fails. Here is the output I receive from this:
Code: Select all | TOGGLE FULL SIZE
admini@beaglebone:~/Adafruit_Python_ILI9341-master$ sudo python examples/image.py
Traceback (most recent call last):
  File "examples/image.py", line 41, in <module>
    disp = TFT.ILI9341(DC, rst=RST, spi=SPI.SpiDev(SPI_PORT, SPI_DEVICE, max_speed_hz=64000000))
  File "build/bdist.linux-armv7l/egg/Adafruit_ILI9341/ILI9341.py", line 137, in __init__
  File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/GPIO.py", line 278, in setup
ValueError: Set gpio direction failed, missing file or invalid permissions.

Upon receiving this error, and after searching through several forum posts, I have been unable to find a solution to this error. Below are some commands run on my BeagleBone to provide further information:
Code: Select all | TOGGLE FULL SIZE
cat /etc/issue
Debian GNU/Linux 9 \n \l

BeagleBoard.org Debian Image 2017-08-31

Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

Default username:password is [debian:temppwd]
cat /etc/dogtag
BeagleBoard.org Debian Image 2017-08-31
uname –a
Linux beaglebone 4.9.45-ti-r57 #1 SMP PREEMPT Fri Aug 25 22:58:38 UTC 2017 armv71 GNU/Linux

Additionally, I have included the following line to /boot/uEnv
Code: Select all | TOGGLE FULL SIZE
Optargs=capemgr.enable_partno=BB-SPIDEVO

To ensure access to the SPI pins, the following command was run
Code: Select all | TOGGLE FULL SIZE
ls -la /dev/spi*
crw-rw---- 1 root spi 153, 1 Feb 27 17:00 /dev/spidev1.0
crw-rw---- 1 root spi 153, 1 Feb 27 17:00 /dev/spidev1.1
crw-rw---- 1 root spi 153, 1 Feb 27 17:00 /dev/spidev2.0
crw-rw---- 1 root spi 153, 1 Feb 27 17:00 /dev/spidev2.1

Any information on this error would be greatly appreciated.

Dylan_Cullen
 
Posts: 2
Joined: Wed Feb 28, 2018 3:44 pm

Re: Trouble with 2.2" TFT LCD Display

by drewfustini on Mon Mar 05, 2018 4:50 am

Please paste the output of these commands:
Code: Select all | TOGGLE FULL SIZE
sudo /opt/scripts/tools/version.sh

cat /boot/uEnv.txt

drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: Trouble with 2.2" TFT LCD Display

by Dylan_Cullen on Thu Mar 08, 2018 11:22 am

I greatly appreciate the reply. Fortunately I spoke with my colleague about the issue I was encountering and he directed me to the following link:
https://vadl.github.io/beagleboneblack/2016/07/29/setting-up-bbb-gpio
Using this source I was able to determine my error. Essentially it was required to call each GPIO pin individually in order to properly use them. The series of commands used, found from the above link, are as follows:
Code: Select all | TOGGLE FULL SIZE
sudo su
cd /sys/class/gpio
echo 27 >  export
cd gpio27
echo out > direction

This series of commands properly configured the required GPIO pins.

Dylan_Cullen
 
Posts: 2
Joined: Wed Feb 28, 2018 3:44 pm

Please be positive and constructive with your questions and comments.