View Single Post
Old 09-26-2019, 08:16 PM  
lezinterracial
Confirmed User
 
Industry Role:
Join Date: Jul 2012
Posts: 3,068
when debugging python which error to look at first?

when debugging python which error to look at first?

Got this cool pan-tilt hat for my Raspberry-Pi by pimoroni. Comes with some web interface code written in flask. The service starts up, but when I click a direction.

Code:
pi@raspberrypi:~/pantilt-hat/examples/pantiltweb $ sudo python3 pantiltweb.py
 * Running on http://0.0.0.0:9595/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger pin code: 333-049-063
127.0.0.1 - - [27/Sep/2019 03:09:43] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [27/Sep/2019 03:09:44] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [27/Sep/2019 03:09:49] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [27/Sep/2019 03:10:19] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [27/Sep/2019 03:10:27] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [27/Sep/2019 03:10:32] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [27/Sep/2019 03:10:37] "GET /api/pan/89 HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1997, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3/dist-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3/dist-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/pi/pantilt-hat/examples/pantiltweb/pantiltweb.py", line 25, in api
    pantilthat.pan(angle)
  File "/usr/lib/python3/dist-packages/pantilthat/pantilt.py", line 466, in servo_one
    self.setup()
  File "/usr/lib/python3/dist-packages/pantilthat/pantilt.py", line 72, in setup
    self._i2c = SMBus(1)
FileNotFoundError: [Errno 2] No such file or directory
__________________
Live Sex Shows
lezinterracial is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote