Roomba 980 Wifi Connectivity Reverse engineering

Hub v1

and it does not appear to generate a response when I hit refresh on the app.

@ady624 is your hub v2? Maybe it’s an ST hub issue.

The terminal should continue to populate.

Does your ide log show anything?

Also you might want to check your device in ide. I think one time the host on ide didn’t match my app. This should be your rpi ip.

localAPI bool true
pollInterval number 5
roomba_host string 192.168.0.7
roomba_password password ****************

So after reviewing all of this, I have the following:

  1. Local API true
  2. IP address, BLID and Pwd all match.
  3. Log will only show the following upon refresh
  4. Nothing happens in terminal when I hit refresh, yet executing commands via http://localhost:3000/maps returns results in terminal.
  5. I do have ST Hub v2

Here is my configuration:

/var/node/roomba980/config/default.json:

{
  "port": 3000,
  "blid": "694WD50C6ZJ20X0E",
  "password": ":1:2G91Z90Z93:RXdkeiJwtB3zvLCz",
  "robotIP": "192.168.1.77",
  "firmwareVersion": 2,
  "enableLocal": "yes",
  "enableCloud": "yes",
  "keepAlive": "yes",
  "basicAuthUser": null,
  "basicAuthPass": null,
  "sslKeyFile": null,
  "sslCertFile": null
}

The BLID and password I’ve tampered with, they’re not real. The IP there is the robot’s IP, not the PI’s, not the hub’s, it’s the robot’s IP.

For the daemon run of roomba on the PI, use the steps I describe in my HomeCloudHub installation - see www.github.com/ady624/HomeCloudHub

NOTE: I have my node.js app running in /var/node/roomba980 - if you installed it in a different place, modify the paths below accordingly.

Namely, create a user for roomba:

sudo useradd --system roomba980

create /etc/default/roomba980 and put this in it:

# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
ROOMBA980_OPTS=-U /var/node/roomba980

# If you uncomment the following line, homebridge will log more.
# You can display this via systemd's journalctl: journalctl -f -u roomba980
# DEBUG=*

Create the /etc/systemd/system/roomba980.service file:

[Unit]
Description=Node.js Local Roomba980 Server
After=syslog.target

[Service]
Type=simple
User=roomba980
EnvironmentFile=/etc/default/roomba980
ExecStart=/usr/bin/npm start --prefix /var/node/roomba980
Restart=on-failure
RestartSec=10
KillMode=process

[Install]
WantedBy=multi-user.target

Then run these commands:

sudo systemctl daemon-reload
sudo systemctl enable roomba980
sudo systemctl start roomba980

Then check the status with:

sudo systemctl status roomba980

On to ST, in the device, here are my settings:

roomba host is the IP of the raspberry PI.
roomba port is 3000

Hope this helps,
Adrian

Wow! This is seriously detailed. I’m going to take next weekend to go through your CloudHub install and this install.

I’m sure you get this all the time, but thanks for all you do… especially with WebCore.

EPIC!!! It works!!

Question: when cleaning it doesn’t seem ‘Pause’ and ‘Resume’ buttons do anything?

Also, any plans for a dock button?

I haven’t done much work on the DTH itself and the button logic is all messed up. I haven’t had the time, but maybe someone may pick it up and just fix the tiles in the DTH…

Ha! Thought I got the auto start to work.

When I run systemctl status roomba980 I receive the following message

root@HomeAuto:~# sudo systemctl status roomba980
● roomba980.service - Node.js Local Roomba980 Server
   Loaded: loaded (/etc/systemd/system/roomba980.service; enabled)
   Active: activating (auto-restart) (Result: exit-code) since Sun 2017-07-16 01:10:24 UTC; 8s ago
  Process: 2343 ExecStart=/home/pi/node_modules/npm start --prefix /home/pi/rest980 (code=exited, status=203/EXEC)
 Main PID: 2343 (code=exited, status=203/EXEC)

Jul 16 01:10:24 HomeAuto systemd[1]: roomba980.service: main process exited, code=exited, status=203/EXEC
Jul 16 01:10:24 HomeAuto systemd[1]: Unit roomba980.service entered failed state.

Dorita980 is installed in /home/pi/node_modules/dorita980
Rest980 is installed in /home/pi/rest980

I think the problem is in the changing of the directories in the roomba.service file

I know I am missing a step and I think it is where my config.json file is located for rest980. I know rest980 is found at /home/pi/rest980 but I don’t see a config.json file.

@ady624 any ideas… sorry for the basic questions, but I cannot seem to get the node to auto start.

Thanks so much for these code snippets!

based on these I wrote a bash script that does it from the command line. see my script on github: https://github.com/mgafner/roomba980v1.9.2

anyway for the basics, for Linux users:
you may use curl to send commands to the irobot.

first step, get password:

replace HOST with https://your-roboter/uml

curl --insecure -X POST -H “Content-Type: application/json” -d ‘{“do”:“get”,“args”:[“passwd”],“id”:1}’ HOST

answer should look like:

{“ok”:{“passwd”:“ouMNGS7Lxk1UR7kP”},“id”:1}

encode the authentication header:

echo -n user:ouMNGS7Lxk1UR7kP | base64 dXNlcjpvdU1OR1M3THhrMVVSN2tQ

get the BLID:

curl --insecure -X POST -H “Content-Type: application/json” -H “Authorization: Basic dXNlcjpvdU1OR1M3THhrMVVSN2tQ” -d ‘{“do”:“get”,“args”:[“sys”],“id”:2}’ HOST

answer should look like this:

{“ok”:{“umi”:2,“pid”:2,“blid”[135,49,152,16,37,58,59,110],“sw”:“v1.2.9”,“cfg”:0,“boot”:3456,“main”:7890,“wifi”:517,“nav”:“01.08.04”,“ui”:2346,“audio”:32,“bat”:“lith”},“id”:2}

command to start the irobot:

auth_header=$(echo -n user:$PASSWORD | base64)

curl --insecure -X POST -H “Content-Type: application/json” -H “Authorization: Basic $auth_header” -d ‘{“do”:“set”,“args”:[“cmd” {“op”:“start”}],“id”:3}’ HOST

1 Like

is it known if this hack works on the newer 890/895 models?

I have a new 690. I too am wondering if this will work

Is this working for you yet? Did you copy your password including “:1:xxxxxx:yyyyyyyy”? I was missing the :1: and had a similar result. I think your directories are correct, otherwise you would see file not found errors.

Also, you don’t want to edit ExecStart=/usr/bin/npm start

First post, just bought a 890 today for a good deal. I have followed the instructions and have gotten to this point. It would seem Im on version 3…anything available or anyone else try?

root@Server:/home/pi/rest980# npm start

rest980@2.0.4 start /home/pi/rest980
node ./bin/www

Looking for robots…
Robot found! with blid/username: #######
{ ver: ‘3’,
hostname: ‘Roomba-#######’,
robotname: ‘Roomba’,
ip: ‘10.0.0.105’,
mac: ‘#######’,
sw: ‘3.1.0’,
sku: ‘R890020’,
nc: 0,
proto: ‘mqtt’,
cap: { ota: 1, eco: 1, svcConf: 1 } }
/home/pi/rest980/node_modules/dorita980/lib/v2/local.js:30
throw e;
^

Error: Connection refused: Not authorized
at MqttClient._handleConnack (/home/pi/rest980/node_modules/mqtt/lib/client.js:827:15)
at MqttClient._handlePacket (/home/pi/rest980/node_modules/mqtt/lib/client.js:315:12)
at process (/home/pi/rest980/node_modules/mqtt/lib/client.js:257:12)
at Writable.writable._write (/home/pi/rest980/node_modules/mqtt/lib/client.js:267:5)
at doWrite (/home/pi/rest980/node_modules/readable-stream/lib/_stream_writable.js:406:64)
at writeOrBuffer (/home/pi/rest980/node_modules/readable-stream/lib/_stream_writable.js:395:5)
at Writable.write (/home/pi/rest980/node_modules/readable-stream/lib/_stream_writable.js:322:11)
at TLSSocket.ondata (_stream_readable.js:642:20)
at emitOne (events.js:115:13)
at TLSSocket.emit (events.js:210:7)
at addChunk (_stream_readable.js:266:12)
at readableAddChunk (_stream_readable.js:253:11)
at TLSSocket.Readable.push (_stream_readable.js:211:10)
at TLSWrap.onread (net.js:585:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rest980@2.0.4 start: node ./bin/www
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the rest980@2.0.4 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2017-09-10T03_17_34_271Z-debug.log

Just curious, am I suppose to be able to still see any map generated in the iRobot Home app if I have this implemented (keep alive set to yes) for SmartThings integration. I used to be able to see the map generated when I first implemented this, but now all I get is “map unavailable”. Any idea?

Ok so I am new to all of this and just got a roomba980. My knowledge of how to do all of this is VERY basic and I can do simple tasks like add a device handler with instructions. Is there a device handler for the 980 yet? If there is a way to intergrate into smartthings can someone help? Even willing to offer money for time.

Hi,
I see this is the device handler, right?
Are you also using a smartapp or did you just create a new device from this code?

iRobot has added a IFTTT channel.

You can now start, dock, pause and cancel a cleaning!

1 Like