Page 1 of 1

uwsgi and revpipyload2

Posted: 12 Apr 2021, 15:46
by richard.vezina
Hi,

I wrote a simple Flask app to control the DO output pins which work well when I am using it with the Flask built-in server... Although when I try to deploy my with Nginx + uwsgi well known reverse proxy setup it fails miserably.

When I run my app with the uwsgi with flags from command line with pi user it works and pins get action properly (uwsgi --http-socket 0.0.0.0:5000 -w io_api_app:app). Notice the --uid --gid flags are not used... As soon as I specified the user and group it stop working, for instance : uwsgi --http-socket 0.0.0.0:5000 --uid pi --gid pi -w io_api_app:app or uwsgi --http-socket 0.0.0.0:5000 --uid root --gid root -w io_api_app:app.

With uwsgi.ini file it even worse even when I don't specify the uid and gid, it just won't work... I am very puzzled on what I am doing wrong as my config work, uwsgi accept request and return proper expected response, when I include Nginx in the mix everythings from the app to nginx work properly. The only part that seem to fail is the output pins that don't get powered on or off. I try to change permissions of the Flask .py app file and uwsgi.ini. "pi" user seems to be member of the proper groups as it works as explained in the previous paragraph...

Thanks for any pointer

Richard

Re: uwsgi and revpipyload2

Posted: 12 Apr 2021, 16:10
by richard.vezina
Hi,

I don't know why I didn't try it before : uwsgi --http-socket 0.0.0.0:5000 --uid gpio --gid gpio -w io_api_app:app works... Still not working within the uwsgi.ini file :(

Re: uwsgi and revpipyload2

Posted: 15 Apr 2021, 09:29
by dirk
Hi Richard, why is revpipyload2 is only announced in the subject and not in your post? Please debug your code or post it so that we and the community are able to reporduce or help you.

Re: uwsgi and revpipyload2

Posted: 21 May 2021, 02:38
by richard.vezina
Hi,

I finally get it to work with the buster release you made, I had issue with my flask api, so I migrated it to fastapi/uvicorn/nginx and it works great now, even faster then with flask api app launched by init.rc with the built in flask server :)