GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   when debugging python which error to look at first? (https://gfy.com/showthread.php?t=1318037)

lezinterracial 09-26-2019 08:16 PM

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


lezinterracial 09-26-2019 08:18 PM

I think it is that first error on the call to get /api/89/

I get a 500 http return code. I notice I don't have that directory.

lezinterracial 09-26-2019 10:56 PM

Nevermind, I got it. Had to enable i2c.

baddog 09-27-2019 06:54 PM

Glad we could help.


All times are GMT -7. The time now is 07:50 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123