Git Product home page Git Product logo

danimaciasperea / roomberry Goto Github PK

View Code? Open in Web Editor NEW
27.0 7.0 7.0 53 KB

Roomberry is a surveillance robot based on Roomba and controlled by a Raspberry Pi Zero W with a camera module

Home Page: https://domoticproject.com/roomberry-surveillance-robot-roomba-raspberry-pi-zero-w-camera

License: MIT License

Python 17.03% CSS 8.28% JavaScript 39.46% HTML 29.21% PHP 6.02%
roomba roomba700 roomba600 roomba800 raspberry raspberrypi raspberrypizero raspberrypizerow python python-3

roomberry's Introduction

Roomberry

Roomberry is a surveillance robot based on Roomba using a Raspberry Pi Zero W and a camera module. A demo of Roomberry's capabilities as well as the web interface developed to interact with the robot can be seen in the following video:

Roomberry Demo

Requirements

To build this project you will need:

  • A mini DIN 7 male connector (DIN 8 is compatible too) with Roomba's pin 3 (RxD), 4 (TxD) and 5 (BRC).
  • A compatible Roomba (series 600/700/800) adapted to provide a regulated 5 V power source direct from the battery using an step-down (Pololu D24V5F5 is a good option).
  • A Raspberry Pi Zero W with Raspbian Stretch Lite version installed. The following software should also be installed: pyserial library, picamera package and an adapted version of Matthew Witherwax' Python iRobot library.
  • A Raspberry camera module (I used Version 1).
  • A HAT (Hardware Attached on Top) board to connect Raspberry's GPIO with a Logical Level Converter (Roomba's Serial is 5 V compatible but Raspberry uses 3.3 V).

How it works

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 system roomberry start

The commands sent to the robot are encoded in the request's  URL query string. The URL path should start with cam or roomba depending on the device that will execute the operation. If the command needs one or more parameters, they should be just passed as a field-value pair in the query string.

For instance:

#Send a clean command to Roomba
curl roomberry/roomba/?op=clean

#Drive Roomba straight at 20 mm/s
curl roomberry/roomba/?op=drive&velocity=20&radius=32768

#Set camera saturation to 65
curl roomberry/cam/?op=cam&saturation=65

#Download picture taken the 10th 08 2018 at 10:28:49
wget roomberry/cam/20180810/20180810-102849.jpg

To use the web interface you will need a Raspberry running apache2 with PHP enabled. Just deploy the web-application on the web server path. For instance:

sudo cp -R /tmp/Roomberry-1.0.0/web-app/ /var/www/

It has been designed using Bootstrap framework (HTML5 and Javascript with AJAX requests). You will probably need to adapt the HTML code to your particular needs/environment.

Find the complete instructions on how to build this project in the following post.

License

This project is licensed under the MIT License - see the license file for details

Legal Notice

Roomba is a trademark of iRobot Corporation. All other trademarks are the property of their respective owners.

Acknowledgments

roomberry's People

Contributors

danimaciasperea avatar marcostrullato avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

roomberry's Issues

Roomberry installation issue : irobot Library

Hello,

when installing the irobot library I get an error :

wget https://github.com/danimaciasperea/irobot/archive/irobot-1.0.0.tar.gz -P /tmp/irobot/
--2019-01-17 21:29:37-- https://github.com/danimaciasperea/irobot/archive/irobot-1.0.0.tar.gz
Resolving github.com (github.com)... 140.82.118.3, 140.82.118.4
Connecting to github.com (github.com)|140.82.118.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/danimaciasperea/irobot/tar.gz/irobot-1.0.0 [following]
--2019-01-17 21:29:37-- https://codeload.github.com/danimaciasperea/irobot/tar.gz/irobot-1.0.0
Resolving codeload.github.com (codeload.github.com)... 192.30.253.121, 192.30.253.120
Connecting to codeload.github.com (codeload.github.com)|192.30.253.121|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-01-17 21:29:38 ERROR 404: Not Found.

What is going wrong ? Thank you !

Problems installing the software

Hello,

I tried installing the software following the exact instructions :

wget https://github.com/danimaciasperea/Roomberry/archive/V1.1.tar.gz /tmp/
-> results in :

--2018-08-29 18:12:26-- https://github.com/danimaciasperea/Roomberry/archive/V1.1.tar.gz
Resolving github.com (github.com)... 192.30.253.112, 192.30.253.113
Connecting to github.com (github.com)|192.30.253.112|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/danimaciasperea/Roomberry/tar.gz/V1.1 [following]
--2018-08-29 18:12:27-- https://codeload.github.com/danimaciasperea/Roomberry/tar.gz/V1.1
Resolving codeload.github.com (codeload.github.com)... 192.30.253.121, 192.30.253.120
Connecting to codeload.github.com (codeload.github.com)|192.30.253.121|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-08-29 18:12:27 ERROR 404: Not Found.

/tmp/: Scheme missing.

Roomberry installation issue - Minicom

Hello Daniel, thanks for sharing this with us ! As I am following your instructions I am encountering some issues. Here's a first one :

Running on NOOBS 3.0

Instructions say :

sudo apt-get minicom

This results in an error : E: invalid operation minicom

Any idea ?

Thanks and kind regards,

Tony

xml files

Hi Dani,
For some reason the roomberry.py is creating folders but it's not creating any of the xml files. None of the xml are being created. I'm trying to understand the reason.. do you have any suggestion?

Regards

System start does not work

The instructions say :

sudo systemctl enable roomberry.service
system roomberry start

2nd command "system roomberry start" results in :

pi@raspberrypi:~ $ system roomberry start
bash: system: command not found

missing multimedia folder

Hi Daniel, the script roomberryWrapper.php is not creating the multimedia folder, which is required.
I'm opening this issue just to remember to add the code and open a pull request.

Cheers

methods missing?

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

Code errors

in the instructions itb is stated :

tar -xvf /tmp/1.0.0.tar.gz

-> this does not place the files in /tmp/Roomberry-1.0.0/roomberry/ BUT in the directory /Roomberry-1.0.0/roomberry/ thus the following lines do not work.

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/

-> Should be sudo cp Roomberry-1.0.0/roomberry/roomberry.py /usr/local/bin/

and the following line refers to lib/systemd/system/ where it should read /lib/systemd/system ...

sudo cp /tmp/Roomberry-1.0.0/roomberry/roomberry.service lib/systemd/system/

in my humble opinion .. :-)

Start web server

Instructions state :

pi@raspberrypi:~ $ sudo cp -R /tmp/Roomberry-1.0.0/web-app/ /var/www/
cp: cannot stat '/tmp/Roomberry-1.0.0/web-app/': No such file or directory
pi@raspberrypi:~ $ sudo cp -R Roomberry-1.0.0/web-app/ /var/www/

This should be sudo cp -R Roomberry-1.0.0/web-app/ /var/www/

Can you please elaborate on the next steps needed to start and reach the webserver ?

THANK YOU !!!

Installing Roomberry - 2nd PI as a wabserver

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 !!!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.