I was working on an application where i have two tasks and which are interdependent
- Fetch some data from external server.
- Even if the internet gets disconnected can the same webpage call my flask application and call the GPIO?
For now, i am using uwsgi+flask+nginx and in this setup when internet is lost i get lot of errors like
Feb 17 18:05:39 raspberrypi uwsgi: DAMN ! worker 2 (pid: 2051) died :( trying respawn ... Feb 17 18:05:39 raspberrypi uwsgi: Respawned uWSGI worker 2 (new pid: 2284) Upstream prematurely closed connection while reading upstream
And when these errors come, my web application freezes and could not access the underlying flask application. But my application is running on localhost:8080 ip. But i don't know why it freezes when internet is disconnected.
When I disable the internet and host the same system on my mac, it's behaving as expected. I do not understand why it is failing on Raspberry Pi.
Is there anyway i could deploy my flask application even when internet is disconnected i could do the local tasks. By searching online i found out few web-servers
Please help me with this.