when debugging python which error to look at first?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lezinterracial
    Confirmed User
    • Jul 2012
    • 3117

    #1

    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
    Confirmed User
    • Jul 2012
    • 3117

    #2
    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.
    Live Sex Shows

    Comment

    • lezinterracial
      Confirmed User
      • Jul 2012
      • 3117

      #3
      Nevermind, I got it. Had to enable i2c.
      Live Sex Shows

      Comment

      • baddog
        So Fucking Banned
        • Apr 2001
        • 107089

        #4
        Glad we could help.

        Comment

        Working...