Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracefully handle i2c (SMBus) library being installed but i2c not enabled #40

Open
WayneKeenan opened this issue Jun 14, 2017 · 0 comments
Labels

Comments

@WayneKeenan
Copy link
Owner

Traceback (most recent call last):
File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.4/dist-packages/picraftzero/main.py", line 26, in
wheelbase = Wheelbase(left=0, right=1)
File "/usr/local/lib/python3.4/dist-packages/gpiozero/devices.py", line 135, in call
self = super(GPIOMeta, cls).call(*args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/picraftzero/zero.py", line 211, in init
left_motor=PiCraftMotor(left),
File "/usr/local/lib/python3.4/dist-packages/gpiozero/devices.py", line 135, in call
self = super(GPIOMeta, cls).call(*args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/picraftzero/zero.py", line 161, in init
Motor = get_motor_provider()
File "/usr/local/lib/python3.4/dist-packages/picraftzero/providers/init.py", line 44, in get_motor_provider
find_devices_and_import()
File "/usr/local/lib/python3.4/dist-packages/picraftzero/providers/init.py", line 16, in find_devices_and_import
devices = i2c_scan() # TODO: add config option to specify i2c bus
File "/usr/local/lib/python3.4/dist-packages/picraftzero/utils.py", line 197, in i2c_scan
bus = smbus.SMBus(bus_num) # 1 indicates /dev/i2c-1
FileNotFoundError: [Errno 2] No such file or directory

@WayneKeenan WayneKeenan changed the title handle i2c (SMBus) library installed but i2c not enabled Gracefully handle i2c (SMBus) library being installed but i2c not enabled Jun 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant