October 27, 2024
Chicago 12, Melborne City, USA
python

Why is Flask not functioning on my raspberry pi?


I am attempting to run a flask program to stream from a camera on my raspberry pi. It wouldn’t work so I tried it with another super simple script to return hello world and still returned as "this site can’t be reached" on my browsers. I’ve tried multiple browsers and I’ve tried to add google to the firewall exemption. here is the code for the hello world script. I am up to date on raspian OS and I am using a raspberry pi 3 b+. The script runs and it tells me what ip to use but it seems inaccessible from any other device.

  GNU nano 7.2                                         stream_test.py                                                   from flask import Flask

app = Flask(__name__)

@app.route('/')
def hello_world():
        return 'Hello World!'

if __name__ == '__main__':
        app.run(debug=True)



I have tried a different device, a different network, the same network, different browsers on each device, rebooting the pi, a different port. It seems to run off the pi, it says

* Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://xxx.xxx.xxx.xxx:5000
Press CTRL+C to quit
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: xxx-xxx-xxx-xxx



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video