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