GithubHelp home page GithubHelp logo

optimumtact / roborock-oucher Goto Github PK

View Code? Open in Web Editor NEW

This project forked from porech/roborock-oucher

0.0 2.0 0.0 42.57 MB

An utility to make the Roborock / Xiaomi MI Vacuum Cleaner scream "Ouch!" (or everything else) everytime it bumps into something

Shell 0.97% Go 99.03%

roborock-oucher's Introduction

Roborock Oucher

Roborock Oucher logo

What is it?

Some time ago, Michael Reeves made a video that went viral, with a Roomba that was modded to scream when it hurts an obstacle. Michael removed many components from the Roomba, and that made the robot really funny but totally useless.

However, the Roborock, better known as Xiaomi Mi Vacuum Cleaner, already has all the components it needs to get the same result without any hardware modification, and without loosing any native functionality. So, we made up a Golang application that can be used on a rooted Roborock cleaner.

What models does it work on?

It has been tested on:

  • Xiaomi Mi Vacuum Cleaner gen1
  • Xiaomi Mi Vacuum Cleaner gen2
  • Roborock S5

It should work on any Roborock/Xiaomi Mi Vacuum Cleaner: if you successfully use it on other models please let us know by adding an issue so we can add it to the list. Don't be too scared to try if you don't have a compatible model: the software just reads a log file and doesn't make any modification to the system, so the worst thing that can happen is just that it doesn't work. The screams, not the robot ;)

In all of this README I will talk about "Roborock" to mention the robot. This is just for simplicity: the instructions apply to all the compatible models.

How do I install this?

First of all, you need to have a rooted Roborock. Please refer to this wiki page or search on the Internet about how to root your device. It's quite easy, but we won't offer support for this, sorry. :)

Download the oucher and oucher.conf files from this repository, or just clone the entire repo.

Then:

  • If you already had a previous version, stop the oucher service: service oucher stop
  • Copy oucher to the Roborock, in /usr/local/bin
  • Copy oucher.conf to the Roborock, in /etc/init
  • Log into SSH to the device
  • Install espeak, sox and alsa-utils: apt-get update && apt-get install espeak sox alsa-utils && apt-get clean
  • Start the service: service oucher start (or just reboot the device)

All of this can be executed from the shell, in the folder where you downloaded the files:

ssh [email protected] service oucher stop
scp oucher [email protected]:/usr/local/bin
scp oucher.conf [email protected]:/etc/init
ssh [email protected] apt-get -y update
ssh [email protected] apt-get -y install espeak sox alsa-utils
ssh [email protected] apt-get -y clean
ssh [email protected] service oucher start

Just replace 192.168.1.33 with your Roborock IP.

If you're installing for the first time, the first command will return an error. That's normal, don't worry about it.

Done! Just start a clean and wait for the first bump ;)

Can I customize the phrases?

Sure! Just customize the oucher.yml file and copy it to the Roborock, in the /mnt/data/oucher folder (you'll need to create it). From a shell:

ssh [email protected] mkdir /mnt/data/oucher
scp oucher.yml [email protected]:/mnt/data/oucher

Just replace 192.168.1.33 with your Roborock IP.

Remember to restart the service with service oucher restart each time you make changes to the configuration, because the file is read on startup only.

Can I use real screams?

Yes! You can create the /mnt/data/oucher/sounds folder (mkdir -p /mnt/data/oucher/sounds) and put some WAV files in there (no MP3, just WAV).
If you prefer to put the files in a different folder, you can customize the soundsPath parameter in the config file.

The phrase will be chosen randomly on every bump, from the textual or WAV ones. If you want to use WAV files only, set the phrases to an empty array in the config file:

phrases: []

Remember to restart the service with service oucher restart each time you add or remove a WAV file, because the list is loaded on startup only.

We're grouping some funny sound packs on this page: they're made by Oucher users with samples found on the Internet. If you own copyright for some of the files and you don't like them to be there, please open an issue and we'll remove them.

It's quite annoying...

You can set a delay in the configuration file. This way, the software will make sure that, after a scream is played, another one won't be played in the next N seconds. Set, for example, delay: 10 and it will feel much better!

What happens on a firmware upgrade?

A firmware upgrade will remove Oucher along with its dependencies and the root access. However, the /mnt/data/oucher folder is not deleted, so your configuration and custom sounds (if you put them here) are safe. You can root the device again and install Oucher back following the setup procedure above. Everything will work as before.

However, if you spent hours looking for the perfect sounds and phrases, we strongly recommend you to backup the config and WAV files, so you won't have to worry if for some reason you need to perform a factory reset.

How can I remove it?

If you just want to disable the software but be able to enable it back easily, you can just set enabled: false in the configuration. This way, the software does absolutely nothing: after loading the configuration, it just sleeps, without reading the log file or anything else.

If you want to totally remove the software, just delete the /usr/local/bin/oucherand /etc/init/oucher.conf files. If you have a custom configuration, or custom sounds, also remove the /mnt/data/oucher folder.
You won't also need espeak, sox and alsa-utils anymore, so you can remove them with apt-get remove espeak sox alsa-utils followed by an apt-get autoremove to uninstall their dependencies.

From the shell:

ssh [email protected] rm /usr/local/bin/oucher /etc/init/oucher.conf
ssh [email protected] rm -r /mnt/data/oucher
ssh [email protected] apt-get remove espeak sox alsa-utils
ssh [email protected] apt-get autoremove

Just replace 192.168.1.33 with your Roborock IP.

How does it work?

The Roborock service logs everything that happens while cleaning in a file: /run/shm/PLAYER_fprintf.log (or other files, depending on the model and firmware version). This includes bumps into obstacles. The software just follows the log file and, everytime a bump occurs, invokes espeak piped with aplay for text-to-speech, or aplay alone for WAVs. A semaphore avoids overlapped screams if multiple bumps occurr in a rapid sequence.

I used an old version that looked for the oucher.yml file in /etc. Do I need to move it?

You're not forced to move it: the configuration file is also looked up from the /etc folder, like in previous versions. Anyway, we strongly suggest to put it in /mnt/data/oucher, so you won't lose it in case of firmware upgrade (see above).

Are you planning to improve it?

Of course! Short-term plans are:

  • Provide some real screams out-of-the-box, recorded by us. This will be funny ;)
  • Improve the setup procedure, maybe by providing a deb file or a PPA to add to the Roborock

Anyway, we're sure you can get a great amount of fun with what already exists ;)

I tried this and now my robot doesn't work! Shame on you!

Sorry for your loss :) Seriously: we're pretty confident it's not an issue with our software, since it really doesn't touch anything on the system. Most probably, you had some trouble with the root procedure. It's really hard to brick a Roborock, so maybe you'll find a solution if you search carefully on the dedicated channels. As said above, we're not giving support about the root procedure.

I followed the procedure but the robot doesn't ouch / ouches at the wrong moment / woke me up at 3am by screaming for no reason

In this case, we're really happy to help! Just open an issue about it with as many details as you can, and we'll sort it out. If you can, please copy the following files from the robot immediately after the unexpected behaviour occurrs, and attach them to the issue:

  • /run/shm/PLAYER_fprintf.log
  • /run/shm/NAV_normal.log
  • /run/shm/NAV_TRAP_normal.log

I love it, can I offer you a beer?

Wow, thanks! You can drop some Bitcoin to 35J2dPDFHweeB87LiYcHbhVmtgBsNrP4eH

roborock-oucher's People

Contributors

ale-rinaldi avatar

Watchers

 avatar  avatar

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.