0

I am trying to get an LCD screen to display some text while following a tutorial the only differences between the tutorial code and mine is the text message.

I have also checked my wiring and tested the pins on the pi for functionality. I do not understand why i'm getting this error.

my code:

    from time import sleep
    import Adafruit_CharLCD as LCD

    lcd = LCD.Adafruit_CharLCD(rs=23, en=19, d4=13, d5=6, d6=5, d7=11, cols=16, lines=2)
    lcd.clear()

    lcd.message('hi\n guy')
    sleep(3)

my error

Traceback (most recent call last):
  File "lcd3.py", line 4, in <module>
    lcd = LCD.Adafruit_CharLCD(rs=23, en=19, d4=13, d5=6, d6=5, d7=11, cols=16, lines=2)
  File "/home/pi/Adafruit_CharLCD.py", line 143, in __init__
    gpio.setup(pin, GPIO.OUT)
  File "/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO/GPIO.py", line 278, in setup
    pull_up_down=self._pud_mapping[pull_up_down])
SystemError: error return without exception set
user2722968
  • 13,636
  • 2
  • 46
  • 67
drako234
  • 129
  • 1
  • 2
  • 13
  • That line number in GPIO.py is part of the BeagleBone support, not Raspberry Pi - the library is apparently misdetecting your platform. I have no idea how that could happen, but maybe this will give you a hint in tracking down the problem. – jasonharper May 18 '17 at 20:23
  • interesting I'll look into it. – drako234 May 18 '17 at 20:31

2 Answers2

0

This error bubbles up from the CPython-interpreter itself and strongly indicates a bug in whatever C-code is getting called.

This situation arises if a function implemented in C returns to the interpreter with a NULL value, indicating an error. The interpreter expects the function to set up the exception object for the current thread before returning. If the exception object has not been set, the interpreter raises a SystemError as it plays safe and assumes that the C-code hit an error condition but failed (for some reason) to actually provide an exception object.

You are probably hitting an error path in the underlying C-code that the author did not expect. If you can compile it yourself, try debugging code paths that would return NULL to the interpreter and see why that code path had been taken.

user2722968
  • 13,636
  • 2
  • 46
  • 67
0

I get the same problem. I try to reinstall the raspberry pi update software. in a terminal execute:

sudo apt-get autoremove && sudo apt-get -f install && sudo apt-get update && sudo apt-get upgrade -y

(Remove unneeded packages, fix broken installs, update package lists, upgrade installed packages).

Also reinstall Library RPi.GPIO and Adafruit_BBIO library On a Debian-based Linux like Raspbian. in a terminal execute:

sudo apt-get install build-essential python-pip python-dev python-smbus git
git clone https://github.com/adafruit/Adafruit_Python_GPIO.git
cd Adafruit_Python_GPIO
sudo python setup.py install

And rerun the python script, its work for me.

Bayu Tu
  • 1
  • 2