0

Adafruit_BBIO: SystemError: <built-in function setup> return
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit_BBIO: SystemError: <built-in function setup> return

by PeteLawler on Fri Sep 22, 2017 7:57 am

This has been driving me somewhat crazy this evening, so I'm putting this here as a placeholder to pick up again tomorrow. If anyone in the meantime has any bright ideas... I've tried different kernels, different AdafruitBBIO versions, different overlay combos... Maybe it's just because it's Friday night and I should be off having a life somewhere...

$python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.GPIO as GPIO
>>> GPIO.cleanup()
>>> GPIO.setup('P8_06',GPIO.OUT)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
SystemError: <built-in function setup> returned NULL without setting an error

PeteLawler
 
Posts: 5
Joined: Thu Apr 28, 2016 11:02 pm

Re: Adafruit_BBIO: SystemError: <built-in function setup> re

by PeteLawler on Sun Sep 24, 2017 10:58 pm

I'm starting to think this is a very python3 problem. Sometimes it works for me, but far more often than not it doesn't.

Thing is, I'm fairly certain now that it isn't overlay, or kernel, or bbio version because I can get it happening with python2 when all those things are the same.

Am starting to get rather stuck here and if anyone has any ideas, it'd be super appreciated.

PeteLawler
 
Posts: 5
Joined: Thu Apr 28, 2016 11:02 pm

Re: Adafruit_BBIO: SystemError: <built-in function setup> re

by drewfustini on Fri Sep 29, 2017 9:30 pm

Hi, sorry for the delay, I've been traveling too much recently. I also get an error, though it is it slightly different:

debian@beaglebone:~$ python3
Python 3.4.2 (default, Oct 8 2014, 14:38:51)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.GPIO as GPIO
>>> GPIO.cleanup()
>>> GPIO.setup('P8_06',GPIO.OUT)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
SystemError: error return without exception set
>>>
debian@beaglebone:~$ sudo python3
Python 3.4.2 (default, Oct 8 2014, 14:38:51)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.GPIO as GPIO
>>> GPIO.cleanup()
>>> GPIO.setup('P8_06',GPIO.OUT)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
SystemError: error return without exception set


I'm going to investigate further.

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

Re: Adafruit_BBIO: SystemError: <built-in function setup> re

by PeteLawler on Fri Sep 29, 2017 10:51 pm

drewfustini wrote:Hi, sorry for the delay, I've been traveling too much recently. I also get an error, though it is it slightly different:

debian@beaglebone:~$ python3
Python 3.4.2 (default, Oct 8 2014, 14:38:51)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.GPIO as GPIO
>>> GPIO.cleanup()
>>> GPIO.setup('P8_06',GPIO.OUT)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
SystemError: error return without exception set
>>>
debian@beaglebone:~$ sudo python3
Python 3.4.2 (default, Oct 8 2014, 14:38:51)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.GPIO as GPIO
>>> GPIO.cleanup()
>>> GPIO.setup('P8_06',GPIO.OUT)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
SystemError: error return without exception set


I'm going to investigate further.


No worries, Drew. I apprecaite what you've been doing in the comunity :)

I'm thinking that the difference we see there in the error message is a 3.4/3.5 Python thing. I've not had a chance to get back and do any more digging on this myself yet, unfortunately. I do hope to get a few hours in this coming week I'll let you know if I turn up anything else.

PeteLawler
 
Posts: 5
Joined: Thu Apr 28, 2016 11:02 pm

Re: Adafruit_BBIO: SystemError: <built-in function setup> re

by drewfustini on Sun Oct 01, 2017 1:44 pm

I think the root cause is that p8.06 is used by mmc by default:

debian@beaglebone:~$ config-pin -q p8.06
Cannot read pinmux file: /sys/devices/platform/ocp/ocp*P8_06_pinmux/state


Which image are you using?

The eMMC needs to be disabled and this can vary based on whether u-boot overlays are enabled or not.

However, it seems like the appropriate error is not being conveyed. I think the handling will need to be improved within py_setup_channel in py_gpio.c.

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

Please be positive and constructive with your questions and comments.