danimaciasperea / Roomberry

Roomberry is a surveillance robot based on Roomba and controlled by a Raspberry Pi Zero W with a camera module
https://domoticproject.com/roomberry-surveillance-robot-roomba-raspberry-pi-zero-w-camera
MIT License
27 stars 7 forks source link

methods missing? #6

Closed marcostrullato closed 5 years ago

marcostrullato commented 5 years ago

Hi again Dani,

It looks like some of the methods are missing. With Chrome, using the developers tools, I see RC=500 for the roomberryWrapper.php while asking for lastSnapshot. There are more methods showing the same behaviour: lastRoombaXML, lastCamXML and lastMediaXML.

Am I wrong or the same are not present in the roomberry.py?

Let me paste here some info:

Response header:

POST /PATH/roomberryWrapper.php HTTP/1.1 Host: myhostname Connection: keep-alive Content-Length: 15 Pragma: no-cache Cache-Control: no-cache Origin: http://myhostname User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 Content-type: application/x-www-form-urlencoded Accept: / Referer: http://myhostname/PATH/roomberry.html Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.9,it;q=0.8

Response:

HTTP/1.1 500 Internal Server Error Date: Mon, 14 Jan 2019 20:31:08 GMT Server: Apache/2.4.25 (Raspbian) Content-Length: 0 Connection: close Content-Type: text/html; charset=UTF-8

danimaciasperea commented 5 years ago

Hi Marco,

As you can see in the php code, these 4 methods (as well as getMedia) are only GET requests of files. They don't require code in raspberry.py, the http.server imported in Python will process them. You are getting a 500 error because the file does not exists in your file system, I suppose due to your problem in #5.

What is really strange is that some Apache server is answering the requests. Have you installed Apache in your Raspberry Pi Zero W for any other reason? Raspberry.py is itself a web server so I don't know how will both servers handel at the same time HTTP requests...

Regards,

Daniel

marcostrullato commented 5 years ago

Hi Daniel, I'm going to debug the code to see what's going on in my raspberry... I did some adjustments like running the python component in a virtual environment, and the html/php into an apache2 running as pi. Everything is executed from the home of pi, with all the grants set to it. I'll keep you posted, I'm almost sure it's something funky going on at my side.

(In the meanwhile I opened a pull request for a typo I found out).

Thanks

marcostrullato commented 5 years ago

Hi Daniel, please close this issue, it's 100% related to #5

Thanks