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

Installing Roomberry - 2nd PI as a wabserver #11

Closed Tokn59 closed 5 years ago

Tokn59 commented 5 years ago

Hello, not really an issue (yet) but apart from installing the Apache 2 and PHP on a second PI, what configuration needs to be done here to have the two devices "talk" to eachother ? Any documentation on this ?

Thanks !

Btw .. GREAT project !!!!

danimaciasperea commented 5 years ago

You can find everything, including basic configuration of Raspberry, Apache, Services, net configuration, etc. in my blog or in internet using google ;)

Tokn59 commented 5 years ago

Challenge accepted ! 😊

From: Daniel MacĂ­as notifications@github.com Sent: 18 January 2019 12:26 To: danimaciasperea/Roomberry Roomberry@noreply.github.com Cc: Tokn59 tony.knors@live.com; Author author@noreply.github.com Subject: Re: [danimaciasperea/Roomberry] Installing Roomberry - 2nd PI as a wabserver (#11)

You can find everything, including basic configuration of Raspberry, Apache, Services, net configuration, etc. in my blog domoticproject.com or in internet using google ;)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/danimaciasperea/Roomberry/issues/11#issuecomment-455515152, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIyc_1q4bF8yEqTH1DgR8gxdiEEYUHLEks5vEa85gaJpZM4aHszy.

Tokn59 commented 5 years ago

By your blog, you mean this site : https://domoticproject.com/roomberry-surveillance-robot-roomba-raspberry-pi-zero-w-camera/ ?

Because here I cannot find instructions on how to set up the 2nd PI once Apache2 and PHP are installed on it ?

My mistake maybe ?

From: Daniel MacĂ­as notifications@github.com Sent: 18 January 2019 12:26 To: danimaciasperea/Roomberry Roomberry@noreply.github.com Cc: Tokn59 tony.knors@live.com; Author author@noreply.github.com Subject: Re: [danimaciasperea/Roomberry] Installing Roomberry - 2nd PI as a wabserver (#11)

You can find everything, including basic configuration of Raspberry, Apache, Services, net configuration, etc. in my blog domoticproject.com or in internet using google ;)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/danimaciasperea/Roomberry/issues/11#issuecomment-455515152, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIyc_1q4bF8yEqTH1DgR8gxdiEEYUHLEks5vEa85gaJpZM4aHszy.

danimaciasperea commented 5 years ago

No, by the blog I mean the whole blog. Not only one post. Anyway: 1) there is nothing special to configure. 2) I insist. If you want to learn about how apache works, what modules you need to activate PHP, etc. have a look at google. I think this is not an issue of this project.

Tokn59 commented 5 years ago

You are absolutely right and I got Apache2 and PHP running on the 2nd PI without any problems.

BUT .. My question was on what to specifically configure on it so that it “knows” about the other PI running the services ? Sorry but I am not too familiar with that kind of architecture on PI.

Do I simply proceed as follows with the 2nd Pi :

Install the /var/www files on this PI as well as on the Zero PI ? Do I need to add the IP address of the Zero somewhere in the 2nd one ?

Google will not tell me this specifically for the Roomba project, right ?

Tony

From: Daniel MacĂ­as notifications@github.com Sent: 18 January 2019 13:12 To: danimaciasperea/Roomberry Roomberry@noreply.github.com Cc: Tokn59 tony.knors@live.com; Author author@noreply.github.com Subject: Re: [danimaciasperea/Roomberry] Installing Roomberry - 2nd PI as a wabserver (#11)

No, by the blog I mean the whole blog. Not only one post. Anyway:

  1. there is nothing special to configure.
  2. I insist. If you want to learn about how apache works, what modules you need to activate PHP, etc. have a look at google. I think this is not an issue of this project.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/danimaciasperea/Roomberry/issues/11#issuecomment-455526411, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIyc_0tLMxJVEAtRmdqwX1YL0T08nyaVks5vEbomgaJpZM4aHszy.

danimaciasperea commented 5 years ago

Tony,

You only have to have a look at the code. Only the first 5 lines of code of roomberryWrapper.php: . $url = "http://roomberry";

So here you have. All the requests will be sent to the host named: roomberry. If in your environment there is no host with this name. The requests will be lost.

A quick search in google about how to do this will take you to editing the /etc/hosts file. You can even find it in my blog.

You have to understand that it is materially imposible to document EVERYTHING. There are tones of things that will depend on your system, configuration, router, etc. Basic skills on Unix (or motivation to learn about it) is required to make this project work.

PD: no need to put the www files in the Raspberry Pi Zero . Web server is apache in Raspberry Pi.

Tokn59 commented 5 years ago

Daniel,

I fully agree. You cannot document everything indeed. That’s why we who try to re-build your projects ask stupid questions. 😊

I adapted the wrapper with the IP address of the roomberry (fixed IP) 


But this way documentation also gets a bit more completed I hope so future rebuilders don’t have to ask so many stupid questions.

I seem to be missing a lot in your blog but hey .. at least I don’t give up and got things up and running already a little bit ! 😊

Kind Regards,

Tony

From: Daniel MacĂ­as notifications@github.com Sent: 18 January 2019 13:44 To: danimaciasperea/Roomberry Roomberry@noreply.github.com Cc: Tokn59 tony.knors@live.com; Author author@noreply.github.com Subject: Re: [danimaciasperea/Roomberry] Installing Roomberry - 2nd PI as a wabserver (#11)

Tony,

You only have to have a look at the code. Only the first 5 lines of code of roomberryWrapper.php: . $url = "http://roomberry";

So here you have. All the requests will be sent to the host named: roomberry. If in your environment there is no host with this name. The requests will be lost.

A quick search in google about how to do this will take you to editing the /etc/hosts file. You can even find it in my blog.

You have to understand that it is materially imposible to document EVERYTHING. There are tones of things that will depend on your system, configuration, router, etc. Basic skills on Unix (or motivation to learn about it) is required to make this project work.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/danimaciasperea/Roomberry/issues/11#issuecomment-455534088, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIyc_7djiI4eyWTRyO--6iIVJRPwaTH1ks5vEcGAgaJpZM4aHszy.

Tokn59 commented 5 years ago

Daniel,

I succesfully tested the serial com with the Roomba. I am a bit stuck here :

[cid:image001.jpg@01D4AF4D.69A96A00]

The next step in your documentation is :

python3 /usr/local/lib/python3.5/dist-packages/irobot/console_interfaces/create2.py Launching REPL Serial Port> /dev/serial0 BRC Pin> 27 Enable quirks> No

Create2 attached as robot on /dev/serial0 May it serve you well

robot.clean()

robot.stop()

However the installation dis not create the necessary files in /usr/local/lib/python3.5/dist-packages/ 


This folder is actually empty :

[cid:image002.jpg@01D4AF4D.69A96A00] Tried the installation first as user and after again as root 
 Same result .. Any clue ?

From: Daniel MacĂ­as notifications@github.com Sent: 18 January 2019 13:44 To: danimaciasperea/Roomberry Roomberry@noreply.github.com Cc: Tokn59 tony.knors@live.com; Author author@noreply.github.com Subject: Re: [danimaciasperea/Roomberry] Installing Roomberry - 2nd PI as a wabserver (#11)

Tony,

You only have to have a look at the code. Only the first 5 lines of code of roomberryWrapper.php: . $url = "http://roomberry";

So here you have. All the requests will be sent to the host named: roomberry. If in your environment there is no host with this name. The requests will be lost.

A quick search in google about how to do this will take you to editing the /etc/hosts file. You can even find it in my blog.

You have to understand that it is materially imposible to document EVERYTHING. There are tones of things that will depend on your system, configuration, router, etc. Basic skills on Unix (or motivation to learn about it) is required to make this project work.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/danimaciasperea/Roomberry/issues/11#issuecomment-455534088, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIyc_7djiI4eyWTRyO--6iIVJRPwaTH1ks5vEcGAgaJpZM4aHszy.

danimaciasperea commented 5 years ago

No image is attached. I don't know what version of python are you using and is installed in your system. This problem has nothing to do with the name of the Issue.

Tokn59 commented 5 years ago

Hi Daniel,

I tried to follow the documentation and to document all the steps I have taken so far :

Step 1 : Install Roomberry on Pi Zero with Noobs 3.0

Roomberry.py creates a multithreading python web server that interacts with Roomba and the camera module installed. This code is intended to run as a daemon and handles the HTTP GET Requests performed against the Raspberry Pi. To install it just download the last release and configure it as a service: wget https://github.com/danimaciasperea/Roomberry/archive/1.0.0.tar.gz -P /tmp/ tar -xvf /tmp/1.0.0.tar.gz -C /tmp/

Before doing next step, adapt the code to your environment (serial port used, IFTTT Key, etc.)

sudo cp /tmp/Roomberry-1.0.0/roomberry/roomberry.py /usr/local/bin/ sudo cp /tmp/Roomberry-1.0.0/roomberry/roomberry.service /lib/systemd/system/

sudo systemctl enable roomberry.service sudo systemctl start roomberry (original doc started from su so adapted this for "normal" user

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 2205 87.0 2.8 14208 10948 ? Rs 09:05 0:01 /usr/bin/python3 /usr/local/bin/roomberry.py pi 2206 0.0 0.7 6460 2716 pts/0 R+ 09:05 0:00 ps aux

Step 2 : Installed Apache2 and PHP on secondary Raspberry Pi

sudo apt-get install apache2 -y

sudo apt-get install php libapache2-mod-php -y tested with a php file and working !

Next I installed the necessary files for the website :

wget https://github.com/danimaciasperea/Roomberry/archive/1.0.0.tar.gz -P /tmp/

tar -xvf /tmp/1.0.0.tar.gz -C /tmp/

Results in :

pi@raspberrypi:~ $ tar -xvf /tmp/1.0.0.tar.gz -C /tmp/ Roomberry-1.0.0/ Roomberry-1.0.0/.gitignore Roomberry-1.0.0/LICENSE Roomberry-1.0.0/README.md Roomberry-1.0.0/roomberry/ Roomberry-1.0.0/roomberry/roomberry.py Roomberry-1.0.0/roomberry/roomberry.service Roomberry-1.0.0/web-app/ Roomberry-1.0.0/web-app/css/ Roomberry-1.0.0/web-app/css/custom.css Roomberry-1.0.0/web-app/js/ Roomberry-1.0.0/web-app/js/common.js Roomberry-1.0.0/web-app/js/roomberry.js Roomberry-1.0.0/web-app/roomberry.html Roomberry-1.0.0/web-app/roomberryWrapper.php

[cid:image002.png@01D4B17E.E62FB970]

Modified the following files :

roomberryWrapper.php :

ORIGINAL :

[cid:image003.png@01D4B17F.C74AFB90]

My version :

[cid:image004.png@01D4B17F.C74AFB90]

Adapted the roomberryWrapper file :

$basePath = "/var/www/html "; $songsPath = $basePath . "songs/"; $snapFilename = "multimedia/snapR.jpg"; $roombaXMLFilename = "roomba.xml"; <- no roomba.xml file present ? $camXMLFilename = "cam.xml"; $mediaXMLFilename = "media.xml"; $url = "http://192.168.1.230"; <- changed to fixed IP of the Zero Pi running the Roomberry service $snapUrl = $url."/cam/snap.jpg"; $roombaXMLUrl = $url."/roomba/roomba.xml"; <- no Roomba.xml file present ? Should this folder /Roomba be created manually ? Where ? Like this ? /var/www/Roomba ? $camXMLUrl = $url."/cam/cam.xml"; $mediaXMLUrl = $url."/cam/media.xml";

Copied all web-app to \var\www\html\ (was not clear from the documentation where to exactly but assumed standard web server)

Result :

[cid:image001.jpg@01D4B181.0C250FC0]

When I do all this and I browse to the 2nd Pi (Apache Server)

http://192.168.1.148/roomberry.html

[cid:image009.jpg@01D4B181.0C250FC0] But whatever I try to do (click on Forward/backward ...) nothing happens. Please note, no camera is attached yet)

Any clue what I am doing wrong Daniel ?

Thanks for your support !

Tony

danimaciasperea commented 5 years ago

Hi Tony,

Like in your last issue, no image is attached so I can't see what changes have you made. Anyway, try to: 1) Use the python server independently. I mean, check if it works correctly. You salid that it is up and running, but did you test it? You can do it from your second raspberry with curl, sending operations ans seeing if the roomba reacts as expected. There is a log file, so if it is not working correctly find out there what the problem is.

2) Start with this step only once step 1 is accomplished and the python server is running fine. You need to find out what error are you receiving. Open the developer mode in your browser and see what is the error received.

Regards,

Daniel

Tokn59 commented 5 years ago

Hello Daniel, something is going wrong when I answer to github mails. I had prepared a step by step repro doc that I sent to you but apparently the (missing) images in it make it unreadable. They are screenshots. Can I please exceptionally sent it to you by email ? You will see that I really go step by step and am probably just missing a few details in order to get it working !

Your help is much appreciated and I am really doing my best to comply to your requirements for reporting issues and questions. As you asked me to I try to avoid creating issues ....

Kind regards,

Tony

Sent from my iPhone

On 21 Jan 2019, at 12:18, Daniel MacĂ­as notifications@github.com<mailto:notifications@github.com> wrote:

Hi Tony,

Like in your last issue, no image is attached so I can't see what changes have you made. Anyway, try to:

  1. Use the python server independently. I mean, check if it works correctly. You salid that it is up and running, but did you test it? You can do it from your second raspberry with curl, sending operations ans seeing if the roomba reacts as expected. There is a log file, so if it is not working correctly find out there what the problem is.

  2. Start with this step only once step 1 is accomplished and the python server is running fine. You need to find out what error are you receiving. Open the developer mode in your browser and see what is the error received.

Regards,

Daniel

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/danimaciasperea/Roomberry/issues/11#issuecomment-456039261, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIyc_yoPlNFTDdQE3GHv7JOsOm9Ui20-ks5vFaIVgaJpZM4aHszy.

danimaciasperea commented 5 years ago

Hi Tony,

I think that you can only add images when you use the web editor and not when answering through your email editor.

No problem, you can send me an email. But please, have a look at my last messages and check both points.

Regards,

Daniel

Tokn59 commented 5 years ago

Seems to be the case indeed. I will add a Word document with the repro steps and the screenshots as an attachment to this ? Agree ? Or direct mail to you ? What email address ?

Tony

From: Daniel MacĂ­as notifications@github.com Sent: 22 January 2019 08:58 To: danimaciasperea/Roomberry Roomberry@noreply.github.com Cc: Tokn59 tony.knors@live.com; Author author@noreply.github.com Subject: Re: [danimaciasperea/Roomberry] Installing Roomberry - 2nd PI as a wabserver (#11)

Hi Tony,

I think that you can only add images when you use the web editor and not when answering through your email editor.

No problem, you can send me an email. But please, have a look at my last messages and check both points.

Regards,

Daniel

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/danimaciasperea/Roomberry/issues/11#issuecomment-456303804, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIyc_wimRlN_AieHvaNd_ysHymIDQnyMks5vFsR0gaJpZM4aHszy.

danimaciasperea commented 5 years ago

You can find it in my Github profile, or even in the first page of the python program.