Roomba robots support

I just wanted to share my experience with connecting cloud-connected Roomba robots (i7 and m6).

I bought both on the Czech Alza e-shop. They unfortunately came with FW versions 1.3.4 and 1.0.1, which are both known to have cloud connectivity issues. What’s more unfortunate, OTA updates of FW are distributed over the cloud. So the robots connected to my Omnia, and I could command them through local network, but they could not be reached via the cloud, nor could they build/save maps, show cleaning history, or receive updates.

In the Android app, if you go to the robot details, click on wifi, wifi details, there is a field showing the cloud connection status. Mine told “trying to register with cloud” or something like that.

This known problem only manifests on some home routers, though. So I connected the robots to a Wifi hotspot I created on my notebook, and the robots got cloud connection instantly. So I forced FW updates and they ran without an issue.

Now both robots have FW 3.2.*, and after reconnecting them back to my Omnia, they are finally able to talk to the cloud.

With the robots finally connected and updated, I plan to play with https://github.com/koalazak/dorita980 and https://github.com/koalazak/rest980 to see if I can get a local service running on Omnia that will give me MQTT and REST access to the robots. And if I manage to find a serial connection to the robot, I’d really like to try commanding the robots via ROS ( https://github.com/AutonomyLab/create_autonomy ).

1 Like

TOS provides package feed from node.js through which perhaps some of it can be realised?

Thanks for pointing that out. At first, I didn’t even know TOS runs node.js, as opkg install nodejs and opkg install npm both fail… But your post forced me to look into it, so now I know it’s node and node-npm :slight_smile: I managed to install rest980, now let’s see what can be achieved with it.

I’ve got it running (at least the rest980 server, no success with ROS). Here’s a basic guide to get it running (tested on Turris Omnia with Turris OS 5.0.1). Before starting the guide, you’ll have to update robot firmware to version 3.x (as written in the first post).

Install node.js:

opkg update
opkg install node node-npm
echo 'Install("node")' >> /etc/updater/conf.d/user.lua
echo 'Install("node-npm")' >> /etc/updater/conf.d/user.lua

Note: in 5.0.1, node packages were not built, so this command will fail.

Summary

You can circumvent it by downloading node and node-npm from 5.0.0 and install them using opkg install *.ipk.

Download and install rest980:

mkdir -p /root/roomba
cd /root/roomba
git clone https://github.com/peci1/rest980.git
cd rest980
git checkout braava  # branch peci1/braava improves support for newer models; for older models, koalazak/master should work well
npm install
cd node_modules/dorita980
git init
git remote add peci1 https://github.com/peci1/dorita980
git fetch peci1
git reset --hard peci1/braava  # branch peci1/braava adds support for newer models; for older models, koalazak/master should work well

Figure out the IP address of your robot(s) (e.g. in Luci or the phone app). Next, you’ll have to find the BLID and password to connect to the robot.

/root/roomba/rest980/node_modules/dorita980/bin/getpassword.js <IP_OF_ROBOT>

Make note of the BLID and password fields. Now, let’s create the rest980 config:

mkdir /etc/rest980
cp /root/roomba/rest980/config/default.json /etc/rest980/
cp /root/roomba/rest980/config/default.json /etc/rest980/default-roomba.json

Edit file /etc/rest980/default.json which contains defaults for all robots:

{
  "port": 3000,
  "firmwareVersion": 3,
  "enableLocal": "yes",
  "enableCloud": "no",
  "keepAlive": "yes",
  "basicAuthUser": null,
  "basicAuthPass": null,
  "sslKeyFile": null,
  "sslCertFile": null
}

Edit file /etc/rest980/default-roomba.json with config for the particular robot that differs from the defaults. Mine looks like this for a Roomba i7:

{
  "port": 3000,
  "blid": "<BLID>",
  "password": "<PASSWORD>",
  "robotIP": "<IP_OF_ROBOT>"
}

Now, everything should be ready to start the rest980 server:

NODE_APP_INSTANCE=roomba NODE_CONFIG_DIR=/etc/rest980 npm run --prefix /root/roomba/rest980/ start

The NODE_APP_INSTANCE env variable allows you to run multiple instances of the rest980 server, e.g. if you have multiple robots. The server loads config from default.json and then default-${NODE_APP_INSTANCE}.json, so e.g. to create a server for a braava robot, you’d create config file default-braava.json and start the server with NODE_APP_INSTANCE=braava. You also have to choose another port in the config.

You can also set up a procd script to launch the server automatically. For that, create file /etc/init.d/rest980-roomba with the following content:

#!/bin/sh /etc/rc.common
# Copyright (C) 2020 Martin Pecka, 3-clause BSD license (see LICENSE file)

START=95

USE_PROCD=1

ROBOT=roomba

start_service() {
        procd_open_instance    
        procd_set_param command /usr/bin/npm run --prefix /root/roomba/rest980/ start
        procd_set_param env NODE_APP_INSTANCE=${ROBOT} NODE_CONFIG_DIR=/etc/rest980
        procd_set_param file /etc/default.json
        procd_set_param file /etc/default-${ROBOT}.json
        procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
        procd_set_param stderr 1
        procd_close_instance
}

reload_service()
{
        stop
        start
}

Make the file executable, and enable and start the service:

/etc/init.d/rest980-roomba enable
/etc/init.d/rest980-roomba start

And that’s it! You can verify the rest980 server by loading some sample API endpoints in your browser, e.g.

http://<ROUTER_IP>:3000/api/local/info/state
http://<ROUTER_IP>:3000/map