0

Problem getting 1115 display to function
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Problem getting 1115 display to function

by byers1200 on Fri Feb 15, 2019 7:00 pm

I am having trouble getting an Adafruit 1115 display to work correctly. That is a nifty monochrome 2x16 display that uses an I2C approach to reduce pin count, and it almost works.

The program looks like
import board
import busio
import adafruit_character_lcd.character_lcd_rgb_i2c as character_lcd
lcd_columns = 16
lcd_rows = 2
i2c = busio.I2C(board.SCL, board.SDA)
lcd = character_lcd.Character_LCD_RGB_I2C(i2c, lcd_columns, lcd_rows)
lcd.message = "Hello"

I downloaded the modules from Adafruit (or GitHub) as described in "Python Usage" for the 1115, and everything seemed like it downloaded properly. But when I try to run the this software from Raspbian’s Terminal, it complains about not being able to find the import modules. The display DOES work if using the same lines in Thonny IDE, but I need the program to run on its own.

byers1200
 
Posts: 4
Joined: Fri Feb 15, 2019 6:29 pm

Re: Problem getting 1115 display to function

by adafruit_support_carter on Fri Feb 15, 2019 7:07 pm

Did you go through the blinka install process?
https://learn.adafruit.com/circuitpytho ... spberry-pi

adafruit_support_carter
 
Posts: 9701
Joined: Tue Nov 29, 2016 2:45 pm

Re: Problem getting 1115 display to function

by byers1200 on Sat Feb 16, 2019 1:31 am

I think I did it correctly. All the modules the program asks for are present in the folder /usr/local/lib/python3.5/dist-packages . Running the program in Thonny IDE, the program will find them okay, but just running the program in Terminal it will not. If I copy the modules over to /home/pi which is the folder that the program is in, then it will find the modules at last but give me a new error message which looks like:

Traceback (most recent call last):
File "/home/pi/display2.py", line 1, in <module>
import board
File "/home/pi/board.py", line 32, in <module>
from adafruit_blinka.agnostic import board_id, detector
File "/home/pi/adafruit_blinka/agnostic/__init__.py", line 21, in <module>
implementation = sys.implementation.name
AttributeError: 'module' object has no attribute 'implementation'

and I have no idea what this is trying to say!

byers1200
 
Posts: 4
Joined: Fri Feb 15, 2019 6:29 pm

Re: Problem getting 1115 display to function

by adafruit_support_carter on Mon Feb 18, 2019 3:52 pm

Make sure you are running Python 3.

adafruit_support_carter
 
Posts: 9701
Joined: Tue Nov 29, 2016 2:45 pm

Re: Problem getting 1115 display to function

by byers1200 on Tue Feb 19, 2019 1:00 pm

Its Python 3.5. Its a fairly clean installation. A new Pi was purchased and set up for this application. Raspbian was installed and then two units from Adafruit were put on. The first was this 1115 display, which does run under Thonny, but not as a separate program using Terminal. Then a Real Time Clock was installed according to the Adafruit directions and it runs fine. The rest of the application is being developed but its a headless application and its a bummer not having the display working unless running everything using Thonny IDE.

byers1200
 
Posts: 4
Joined: Fri Feb 15, 2019 6:29 pm

Re: Problem getting 1115 display to function

by adafruit_support_carter on Tue Feb 19, 2019 1:23 pm

How have you verified the Python version when running from Terminal?

adafruit_support_carter
 
Posts: 9701
Joined: Tue Nov 29, 2016 2:45 pm

Re: Problem getting 1115 display to function

by byers1200 on Thu Feb 21, 2019 2:17 pm

That fixed it! I thought I was running 3.5 but when in Terminal I typed "python" and it came back "Python 2.7.13". So to run the display program in Terminal the command line was changed to "sudo python3 display2.py" and now everything works just fine. The 1115 Display looks great. Thank you very much for your help. I was at a complete loss what the problem was.

byers1200
 
Posts: 4
Joined: Fri Feb 15, 2019 6:29 pm

Re: Problem getting 1115 display to function

by adafruit_support_carter on Thu Feb 21, 2019 3:41 pm

Woot! Yah, the Python 2 v 3 thing is a mess. Glad you figured it out and that got it working.

adafruit_support_carter
 
Posts: 9701
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.