Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

502 error #8

Open
jameshope87 opened this issue Nov 26, 2018 · 16 comments
Open

502 error #8

jameshope87 opened this issue Nov 26, 2018 · 16 comments

Comments

@jameshope87
Copy link

jameshope87 commented Nov 26, 2018

Hello,

After following your guide, I have rebooted my raspberry pi and tried to access the browser through the IP address.

It asks me for the username and password, but then showed a 502 error. Bad gateway.

I have noticed that the pm2 server is not running. Running the command below fixes it:

sudo pm2 start server/app.js --name="fruitnanny"

is there a way to make this run automatically on boot?

@ivadim
Copy link
Owner

ivadim commented Dec 3, 2018

Hi @jameshope87,
Yes pm2 is bit tricky. During setup it should be added to autostart but somehow different people report that it doesn't work. I assume it's related to version of the pm2.

I didn't check it out for a while but maybe this documentation can be helpful: https://pm2.io/doc/en/runtime/guide/startup-hook/?utm_source=pm2&utm_medium=website&utm_campaign=rebranding#update-startup-hook

@jeremyfritzen
Copy link
Contributor

Hi!
I didn't see pm2 in your tutorial.
Is it mandatory for fruitnanny?

@jeremyfritzen
Copy link
Contributor

After several errors, I finally managed to install pm2 with my nodejs version (10.15.2).
Even if the pm2 command you gave seems to work, the application still doesn't work: I still have a Bad Gateway error on my browser...

Could you guys help me?
Plus, I think the tutorial is out of date since a lot of other things changed (as "cfg" format for example) and maybe I did something wrong...

@ivadim
Copy link
Owner

ivadim commented Nov 19, 2019

Hey @jeremyfritzen
Could you please try "simplified" installation instruction: https://github.com/ivadim/fruitnanny/blob/master/INSTALLATION.md

It uses docker to bring all dependencies and was tested by me and @phardy

@jeremyfritzen
Copy link
Contributor

Hi!
Thank you, it seems simpler for me :)
Just one question: why not putting everything in the docker container (nginx, certificates and fruitnanny files)?

I'm a little bit new on docker so maybe I missed something.

Anyway, I will give it a try tonight!
Thank you for your help

@ivadim
Copy link
Owner

ivadim commented Nov 21, 2019

I decided to setup multiple docker containers because docker is designed to be single threaded (you can overcome this but it's not recommended). So, it's logically divided to audio and video streams, nginx server and nodejs application. Except certificates and htpasswd files, everything inside. Certs and passwords must belong to the running instance :)
btw, have you managed to test a new setup?

@jeremyfritzen
Copy link
Contributor

Thank you!
The installation seems to have worked properly.
I can see the video but I can't heard anything :/

@jeremyfritzen
Copy link
Contributor

@ivadim is Theresa any config file to indicate which record device to use (as in a standard uv4l installation)?
Thank you so much!

@jeremyfritzen
Copy link
Contributor

I tried to install it again. Everything works like a charm!
Thank you so much :)

Just for your information, I'm going to work on some new features:

  • noise detection with notification, based on a simple script (probably in python) and this kind of sensor
  • motion detection based on a motion sensor (probably more reliable than picture-based motion detection)

Thanks again for your work!

@alogoc
Copy link

alogoc commented Dec 28, 2019

@jeremyfritzen which raspbian kernel version and docker version did you use?
All containers are unable to start in my case...and I can't get any logs either, even with --debug enabled on docker daemon. level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete" is the only thing I get.

@jeremyfritzen
Copy link
Contributor

I used raspbian buster lite OS and just carefully followed the instructions.
Which error did you get when trying to start the containers?

Just FYI: I forked the project from ivadim on my github and added a function to notify parents when the temperature is outside a range. I packed it in a dedicated container to try to follow the original philosophy of ivadim.

@alogoc
Copy link

alogoc commented Dec 29, 2019

My problem is exactly the same with #23, I am trying to do this on raspberry pi zero and apparently all images are built with armv7 support and rpi zero supports only arm6.

@jeremyfritzen
Copy link
Contributor

Indeed, the issue seems to be related to the Rpi zero.
I made my installation on a Raspberry Pi 2.

2 things come to mind:
1. Did you check that you have well plugged everything?
I'm asking this because I noticed that if I don't plug a microphone, the gstreamer-audio container enters in a restarting-loop (normal behavior because the script returns an error, making the container reboots, as requested in the docker-compose.yml file).
2. Did you try to change the image on the docker files?
You could try to specify a different image (a rpi-zero specific one) on each docker files and to rebuild each image manually?

Please keep us updated

@ivadim
Copy link
Owner

ivadim commented Jan 7, 2020

I've updated images to be compatible with armv6 (raspberry pi 1/2 and raspberry pi zero).
Could you please try to update images?

@guythnick
Copy link

I was able to get this running on a pi zero following the install document. The only thing not working is the audio which I created an issue - #28 for.

@alogoc
Copy link

alogoc commented Jan 13, 2020

Can also confirm it works on PI zero, apart from the audio service - same problem with #28.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants