Python errors from Adafruit_Python_ILI9341

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
RonVA
 
Posts: 15
Joined: Mon Dec 01, 2014 11:35 pm

Python errors from Adafruit_Python_ILI9341

Post by RonVA »

I have a 2.8" TFT LCD ILI9341 and am getting Python error messages in some cases. The image.py example works perfectly (and looks great!) but the shapes example produce this Python message:

Code: Select all

File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/SPI.py", line 42, in __init__
IOError: [Errno 2] No such file or directory
The /build/bdist.linux-armv7l directory under /Adafruit_Python_ILI9341 is, in fact, empty.

I installed the ILI9341 Python library using the following:

Code: Select all

git clone https://github.com/adafruit/Adafruit_Python_ILI9341.git
cd Adafruit_Python_ILI9341
sudo python setup.py install
I'm using a BBB Rev C, Debian kernel 3.8.13-bone47.

Something is installed wrong or not installed. I would greatly appreciate any help. Thanks.

User avatar
tdicola
 
Posts: 1074
Joined: Thu Oct 17, 2013 9:11 pm

Re: Python errors from Adafruit_Python_ILI9341

Post by tdicola »

Thanks for checking out the ILI9341 display library! It sounds like something might be changing the device tree and removing the SPI device perhaps. When you see that error occur, can you run a command like this to check if there are any SPI devices available?

Code: Select all

ls /dev/spi*
There should be a couple devices listed, like /dev/spidev1.0, /dev/spidev1.1. If you don't see any spidev devices listed then that does seem to be the issue, that something is changing the device tree to remove the SPI device.

One thing to try to force the SPI overlay to always be loaded at boot is to edit your boot config to load the overlay. Check out the instructions at the very end of this page: https://learn.adafruit.com/user-space-s ... 2-8/wiring You'll want to connect to the BBB and run these commands to make the boot config editable:

Code: Select all

mkdir /mnt/boot
mount /dev/mmcblk0p1 /mnt/boot
Then use the nano text editor to open the config and add a new line at the bottom with the device tree overlay config:

Code: Select all

nano /mnt/boot/uEnv.txt
The line to add to the file is this one:

Code: Select all

capemgr.enable_partno=BB-SPIDEV0
Then save the file (Ctrl-O) and quit (Ctrl-X) and reboot the Beaglebone Black. Let's see if forcing the SPI device tree overlay helps keep it stable, thanks!

User avatar
RonVA
 
Posts: 15
Joined: Mon Dec 01, 2014 11:35 pm

Re: Python errors from Adafruit_Python_ILI9341

Post by RonVA »

Doh! User error. I was so enthusiastic about getting the image to display so easily that I fired up the other two examples without changing the pin definitions to fit the Beaglebone.

(I don't take responsibility for the extremely misleading error message though.)

I had already made the change to uEnv.txt and the spidev overlays are loading reliably.

Thanks a lot for the reply, Tony, and for the extremely useful library.

Locked
Please be positive and constructive with your questions and comments.

Return to “Beagle Bone & Adafruit Beagle Bone products”