mholgatem / ThermOS

Another Raspberry Pi Thermostat
https://mholgatem.github.io/ThermOS/
MIT License
77 stars 17 forks source link

nginx again?? #17

Closed MrWoodle closed 6 years ago

MrWoodle commented 6 years ago

I really tried to look everywhere for solution before bothering you but :( ...

When following all steps and getting to the last step and drums were rolling.... browse to my pi's IP address.... I get:

502 Bad Gateway nginx/1.10.3

I was so excited to see it too...lol

Tried some random googled fixes but none worked. Saw a solution you posted to a kind of similar problem but it didn't change anything for me. Could it be the newest version of raspbian causing this??? maybe???

Sincerely sorry to bother you but I hope to get this working soon. Thanks -Wes

MrWoodle commented 6 years ago

pi@raspberrypi:~ $ cd ThermOS pi@raspberrypi:~/ThermOS $ sudo python thermostat_web.py Traceback (most recent call last): File "thermostat_web.py", line 824, in app.run("0.0.0.0", port=80, debug=True) File "/usr/lib/python2.7/dist-packages/flask/app.py", line 841, in run run_simple(host, port, self, *options) File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 691, in run_simple s.bind((hostname, port)) File "/usr/lib/python2.7/socket.py", line 228, in meth return getattr(self._sock,name)(args) socket.error: [Errno 98] Address already in use pi@raspberrypi:~/ThermOS $

mholgatem commented 6 years ago

it could be a lot of things, lets start trouble shooting this.

First off try this

sudo nginx -s stop
cd ~/ThermOS
sudo python thermostat_web.py

While that runs, try going to the web address. Let me know if it loads. If it doesn't load, go back to your pi and copy and paste any errors that have been printed by the thermostat_web.py application.

mholgatem commented 6 years ago

fyi, starting saturday, I will be unavailable for a week.

MrWoodle commented 6 years ago

The console paste that i posted is the result of me doing that. I just didn't copy where we stopped nginx.

MrWoodle commented 6 years ago

I do appreciate your attention and I hope your absence is for a glorious vacation :)

mholgatem commented 6 years ago

ok, so if you stopped nginx before running what you posted above, then there is something else that is grabbing the port first. do you have anything else that you can think of that might be grabbing port 80?

You can also try editing /home/pi/thermostat_web.py Scroll down to the very last line and change app.run("0.0.0.0", port=80, debug=True) to app.run("0.0.0.0", port=8080, debug=True)

run thermostat_web.py and navigate to ip.of.your.pi:8080 in your browser. See if that works for you.

MrWoodle commented 6 years ago

Apparently I didn't stop it., So it was nginx grabbing the port. I am thinking I should do the following:

sudo update-rc.d nginx disable

That should stop it from running and I hope that it would not cause any trouble with your app. Right??

Thanks. Hope you had a good vacation.

-Wes

MrWoodle commented 6 years ago

I also have a few other questions about usage...not related to this problem. Should I start another thread or just email you?

mholgatem commented 6 years ago

Just email me

On Wed, Jun 20, 2018, 6:27 PM MrWoodle notifications@github.com wrote:

I also have a few other questions about usage...not related to this problem. Should I start another thread or just email you?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mholgatem/ThermOS/issues/17#issuecomment-398947385, or mute the thread https://github.com/notifications/unsubscribe-auth/AGIo2bzCpYL2Bt8t-8iFAOIMhYVC-as3ks5t-vZrgaJpZM4Uo6EN .

MrWoodle commented 6 years ago

the solution was to disable nginx ... moving the port would have solved this too. Closing this. I sent you an email. -Wes