{"id":13583779,"url":"https://github.com/koalazak/dorita980","last_synced_at":"2025-05-15T05:06:09.895Z","repository":{"id":9136005,"uuid":"60990331","full_name":"koalazak/dorita980","owner":"koalazak","description":"Unofficial iRobot Roomba and Braava (i7/i7+, 980, 960, 900, e5, 690, 675, m6, etc) node.js library (SDK) to control your robot","archived":false,"fork":false,"pushed_at":"2024-05-11T14:16:02.000Z","size":110,"stargazers_count":1027,"open_issues_count":19,"forks_count":154,"subscribers_count":68,"default_branch":"master","last_synced_at":"2025-05-08T18:06:12.736Z","etag":null,"topics":["675","690","960","980","api","cloud","cloud-api","dorita980","e5","firmware","i7","iot","irobot","mqtt","robot","roomba","roomba980","sdk"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koalazak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":"dorita980","ko_fi":null,"tidelift":null,"custom":null}},"created_at":"2016-06-12T21:34:12.000Z","updated_at":"2025-05-07T16:25:58.000Z","dependencies_parsed_at":"2024-03-04T15:15:12.409Z","dependency_job_id":"4b81368b-ce52-483c-a3fb-36b5020b33f1","html_url":"https://github.com/koalazak/dorita980","commit_stats":{"total_commits":95,"total_committers":13,"mean_commits":"7.3076923076923075","dds":"0.21052631578947367","last_synced_commit":"6a833738f0dba67a5bb2b6139885bac085ce9d4f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koalazak%2Fdorita980","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koalazak%2Fdorita980/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koalazak%2Fdorita980/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koalazak%2Fdorita980/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koalazak","download_url":"https://codeload.github.com/koalazak/dorita980/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254120294,"owners_count":22017967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["675","690","960","980","api","cloud","cloud-api","dorita980","e5","firmware","i7","iot","irobot","mqtt","robot","roomba","roomba980","sdk"],"created_at":"2024-08-01T15:03:47.259Z","updated_at":"2025-05-15T05:06:09.869Z","avatar_url":"https://github.com/koalazak.png","language":"JavaScript","funding_links":["https://opencollective.com/dorita980"],"categories":["JavaScript"],"sub_categories":[],"readme":"# dorita980\n[![npm version](https://badge.fury.io/js/dorita980.svg)](http://badge.fury.io/js/dorita980)\n\nUnofficial iRobot Roomba (i7/i7+, 980, 960, e5, 690, 675, etc) node.js library (SDK).\n\n\nWith this library you can send commands to your wifi enabled Roomba through the iRobot cloud API or directly from your LAN and integrate your roboot with your own Home Automation or IoT project.\n\nSee [rest980](https://github.com/koalazak/rest980) if you need a HTTP REST API interface.\n\n# Advice\n\nIf you enjoy dorita980 and it works nice for you, I recommend blocking the internet access to your robot to avoid the OTA firmware updates. New firmware changes can cause dorita980 to stop working. Blocking firmware updates can be performed using the parental control options on your router.\n\nWhen a new firmware is published, you can come here to verify if dorita980 is still compatible. Once dorita980 is compatible you can temporarily enable internet access for your robot to get the firmware upgrade.\n\nIf you have firmware version 1.6.x [click here](https://github.com/koalazak/dorita980/blob/master/READMEv1.6.6.md) to see the old documentation.\n\n[Check your robot version!](http://homesupport.irobot.com/app/answers/detail/a_id/529)\n\n# Features\n\n- Compatible robots: all 600, 800, 900, e5 and i7/i7+ series with HOME app and Braava m6.\n- Get your username/password easily.\n- Auto discovery robot IP (optional).\n- Local API control (from your LAN).\n- Simplified Cleaning Preferences settings.\n- Firmware 1.6.x compatible.\n- Firmware 2.x.x compatible (latest serie 900 uses firmware v2, not v3).\n- Firmware 3.2.x compatible (latest serie 800 uses firmware v3).\n- See [rest980](https://github.com/koalazak/rest980) if you need a HTTP REST API interface to use dorita980 through it.\n\nLatest firmware tested and working: `v2.4.16-126`\n\n[![iRobot Roomba 980 cleaning map using dorita980 lib](https://img.youtube.com/vi/XILvHFEX7TM/0.jpg)](https://www.youtube.com/watch?v=XILvHFEX7TM)\n\nVideo: Realtime cleaning map using dorita980 lib in [rest980](https://github.com/koalazak/rest980).\n\n## Supported Features by Firmware Version\n\n|                                             | 1.6.x Local | 1.6.x Cloud   |  2.x.x Local  |2.x.x Cloud | 3.x.x Local |\n|---------------------------------------------|-------------|---------------|---------------|---------|--------| \n| Clean/Start/Stop/Pause/Dock/Resume/CleanRoom/Find| yes         | yes           | yes           | pending | yes    |\n| Get Preferences                             | yes         | yes           | yes           | pending | yes    |\n| Set Preferences                             | yes         | yes           | yes           | pending | yes    |\n| Get x,y,d Position                          | yes         | yes           | yes           | pending | -      |\n| Get Mission                                 | yes         | yes           | yes           | pending | yes    |\n| Get Mission number                          | no          | no            | yes           | pending | yes    |\n| Get General Info                            | yes         | yes           | yes           | pending | yes    |\n| Get Schedule                                | yes         | yes           | yes           | pending | yes    |\n| Set Schedule                                | yes         | yes           | yes           | pending | yes    |\n| Set CarpetBoost (performance, eco, auto)    | yes         | yes           | yes           | pending | -      |\n| Set Edge Clean                              | yes         | yes           | yes           | pending | -      |\n| Set Cleaning Passes (auto, on, two)         | yes         | yes           | yes           | pending | -      |\n| set Always Finish                           | yes         | yes           | yes           | pending | -      |\n| MQTT Custom events                          | -           | -             | yes           | pending | yes    |\n| HTTP API                                    | yes         | yes           | -             | -       | -      |\n| Discovery Robot IP                          | yes         | -             | yes           | -       | yes    |\n| Get BLID and Password                       | yes         | -             | yes           | -       | yes    |\n| Support multiples clients at the same time  | yes         | yes           | no            | pending | no     |\n\nNote: some new firmwares are not reporting robot position ('pose' property) to local env.\n\n# Install\n\nFirst you need node.js installed and then:\n\n```bash\n$ npm install dorita980 --save\n```\n\n# Quick start via Local request on your LAN\nYou can control the robot from your local network.\n\nCreate `myapp.js` file with this content:\n\n```javascript\nvar dorita980 = require('dorita980');\n\nvar myRobotViaLocal = new dorita980.Local('MyUsernameBlid', 'MyPassword', '192.168.1.104'); // robot IP address\n\nmyRobotViaLocal.on('connect', init);\n\nfunction init () {\n  myRobotViaLocal.clean()\n  .then(() =\u003e myRobotViaLocal.end()) // disconnect to leave free the channel for the mobile app.\n  .catch(console.log);\n}\n\n```\n\nThen install `dorita980` using `npm` and run your program:\n\n```bash\n$ npm install dorita980 --save\n$ node myapp.js\n```\n\n# Examples\n\nPause the robot via Local request:\n\n```javascript\nvar dorita980 = require('dorita980');\n\nvar myRobotViaLocal = new dorita980.Local('MyUsernameBlid', 'MyPassword', '192.168.1.104'); // robot IP address \n\nmyRobotViaLocal.on('connect', init);\n\nfunction init () {\n  myRobotViaLocal.pause()\n  .then(() =\u003e myRobotViaLocal.end()) // disconnect to leave free the channel for the mobile app.\n  .catch(console.log);\n}\n```\n\nGet robot week schedule\n\n```javascript\nvar dorita980 = require('dorita980');\n\nvar myRobotViaLocal = new dorita980.Local('MyUsernameBlid', 'MyPassword', '192.168.1.104'); // robot IP address \n\nmyRobotViaLocal.on('connect', init);\n\nfunction init () {\n  myRobotViaLocal.getWeek()\n  .then((weekConfig) =\u003e {\n    console.log(weekConfig)\n    myRobotViaLocal.end()\n  })\n  .catch(console.log);\n}\n```\n\n# How to get your username/blid and password\n\n(Needed for Cloud and Local requests)\n\nYou need your iRobot account credentials (username and password).\n\n** Option 1 **\n\nInstall `dorita980` globally and then run the `get-roomba-password-cloud` command:\n\n```bash\n$ npm install -g dorita980\n$ get-roomba-password-cloud \u003ciRobot Username\u003e \u003ciRobot Password\u003e [Optional API-Key]\n```\n\n** Option 2 **\n\nClone the repo and then run the npm script:\n\n```bash\n$ git clone https://github.com/koalazak/dorita980.git\n$ cd dorita980\n$ npm install\n$ npm run get-password-cloud \u003ciRobot Username\u003e \u003ciRobot Password\u003e [Optional API-Key]\n```\n\n** Option 3 **\n\nDocker run command:\n\n```\ndocker run -it node sh -c \"npm install -g dorita980 \u0026\u0026 get-roomba-password-cloud \u003ciRobot Username\u003e \u003ciRobot Password\u003e [Optional API-Key]\"\n```\n** Example Output **\n\n```\n$ npm install -g dorita980\n$ get-roomba-password-cloud myemail@example.com myeasypassword\nFound 1 robot(s)!\nRobot \"Dorita\" (sku: R98---- SoftwareVer: v2.4.16-126):\nBLID=\u003e xxxxxxxxxxxxx\nPassword=\u003e :1:1486937829:gktkDoYpWaDxCfGh \u003c= Yes, all this string.\n\nUse this credentials in dorita980 lib :)\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eShow old firmwares method (local call)\u003c/summary\u003e\n\nThis method stop working for latest firmwares. If you have problems using this method please use the cloud method.\n\nYou need to know your robot IP address (look in your router or scan your LAN network with nmap to find it). Or use the `dorita980.getRobotIP()` method.\n\n** Local Option 1 **\n\nInstall `dorita980` globally and then run the `get-roomba-password` command:\n\n```bash\n$ npm install -g dorita980\n$ get-roomba-password \u003crobotIP\u003e\n```\n\n** Local Option 2 **\n\nClone the repo and then run the npm script:\n\n```bash\n$ git clone https://github.com/koalazak/dorita980.git\n$ cd dorita980\n$ npm install\n$ npm run getpassword \u003crobotIP\u003e\n```\n\n** Local Option 3 **\n\nDocker run command:\n\n```\ndocker run -it node sh -c \"npm install -g dorita980 \u0026\u0026 get-roomba-password \u003crobotIP\u003e\"\n```\n\n** Example Output in local method **\n\n```\n$ npm install -g dorita980\n$ get-roomba-password 192.168.1.103\n\nMake sure your robot is on the Home Base and powered on. Then press and hold the HOME button on your robot until it plays a series of tones (about 2 seconds). Release the button and your robot will flash WIFI light.\nThen press any key...\n{ ver: '2',\n  hostname: 'Roomba-xxxxxxxxxxxxx',\n  robotname: 'Dorita',\n  ip: '192.168.1.103',\n  mac: '12:12:12:12:12:12',\n  sw: 'v2.0.0-34',\n  sku: 'R98----',\n  nc: 0,\n  proto: 'mqtt',\n  blid: 'xxxxxxxxxxxxx' \u003c---- username/blid\n}\nPassword=\u003e :1:1486937829:gktkDoYpWaDxCfGh \u003c= Yes, all this string.\nUse this credentials in dorita980 lib :)\n\n```\n\u003c/details\u003e\n\n### Troubleshoot - Getting the password\n\nMost common issues getting your password are related with:\n\n- Mobile application is open: You must close iRobot mobile application on your phone. The robot only support ONE connection at time. You will get a connection error if this is the case.\n- Other applications are using your robot: Close all your applications or scripts using the robot. Same as frist bullet.\n- Network connectivity issues: Make sure your computer can reach your robot: `nc -zv \u003crobot_ip\u003e 8883` if this command fails check your network.\n- Slow networks using local method: On some slow networks you need to run the `get-roomba-password` a couple of times until you get it. This is because UDP packages may be lost.\n- node.js version: Mostly tested on v10 but also works on v12, v14 and v16. Try using v10.\n- Wrong button: It is really common people touching CLEAN button on 980 robots instead of HOME button when prompted. Make sure you are pressing the correct button. Some model (like 675) do not have HOME button and you need to press DOCK+SPOT.\n- Make sure your robot is docked on the Home Base and powered on (short press Clean button once to turn it on. But do not start a cleaning session!)\n- Robot not configured: Did you configure the Robot for first time with the mobile app? If not, you need to do that first. This process set the actual password.\n- Sometimes the robot hangs: Reset the robot pressing Clean for 10 seconds aprox. Wait for restart and try again.\n\n# Auto discover IP address for local request:\n\nIf you don't known which IP address to use in `dorita980.Local()` you can use `dorita980.getRobotIP()` to find it.\nThis process takes 1-2 seconds, so if you know the IP you can just use it explicity.\n\nYou need UDP brodcast enable in your network!\n\n```javascript\nvar dorita980 = require('dorita980');\n\ndorita980.getRobotIP((ierr, ip) =\u003e {\n  if (ierr) return console.log('error looking for robot IP');\n\n  var myRobotViaLocal = new dorita980.Local('MyUsernameBlid', 'MyPassword', ip);\n\n  myRobotViaLocal.getMission()\n  .then((mission) =\u003e {\n    console.log(mission);\n  }).catch((err) =\u003e {\n    console.log(err);\n  });\n});\n```\n\nYou can also use `.discovery` method to get all the robots discovery data:\n\nYou need UDP brodcast enabled in your network!\n\n```javascript\nvar dorita980 = require('dorita980');\n\ndorita980.discovery((ierr, data) =\u003e {\n  console.log(data);\n});\n```\n\nWill print:\n```\n{ ver: '2',\n  hostname: 'Roomba-xxxxxxxxxxxxx',\n  robotname: 'Dorita',\n  ip: '192.168.1.103',\n  mac: '12:12:12:12:12:12',\n  sw: 'v2.0.0-34',\n  sku: 'R98----',\n  nc: 0,\n  proto: 'mqtt' }\n```\n\n# Local API\n\nThe library send commands directly over wifi to your robot. You dont need an internet connection.\n\n* \u003ca href=\"#Local\"\u003e\u003ccode\u003e\u003cb\u003edorita980.Local(blid, password, ip, firmwareVersion)\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#end\"\u003e\u003ccode\u003emyRobot.\u003cb\u003eend()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#getRobotState\"\u003e\u003ccode\u003emyRobot.\u003cb\u003egetRobotState(waitForFields)\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#getPreferences\"\u003e\u003ccode\u003emyRobot.\u003cb\u003egetPreferences()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#setPreferences\"\u003e\u003ccode\u003emyRobot.\u003cb\u003esetPreferences(newPreferences)\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#getMission\"\u003e\u003ccode\u003emyRobot.\u003cb\u003egetMission()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#getBasicMission\"\u003e\u003ccode\u003emyRobot.\u003cb\u003egetBasicMission()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#getWirelessStatus\"\u003e\u003ccode\u003emyRobot.\u003cb\u003egetWirelessStatus()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#getTime\"\u003e\u003ccode\u003emyRobot.\u003cb\u003egetTime()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#getBbrun\"\u003e\u003ccode\u003emyRobot.\u003cb\u003egetBbrun()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#getLangs\"\u003e\u003ccode\u003emyRobot.\u003cb\u003egetLangs()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#getSys\"\u003e\u003ccode\u003emyRobot.\u003cb\u003egetSys()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#getWirelessLastStatus\"\u003e\u003ccode\u003emyRobot.\u003cb\u003egetWirelessLastStatus()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#getWeek\"\u003e\u003ccode\u003emyRobot.\u003cb\u003egetWeek()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#setWeek\"\u003e\u003ccode\u003emyRobot.\u003cb\u003esetWeek(newWeek)\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#getCloudConfig\"\u003e\u003ccode\u003emyRobot.\u003cb\u003egetCloudConfig()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#start\"\u003e\u003ccode\u003emyRobot.\u003cb\u003estart()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#clean\"\u003e\u003ccode\u003emyRobot.\u003cb\u003eclean()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#cleanRoom\"\u003e\u003ccode\u003emyRobot.\u003cb\u003ecleanRoom(args)\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#cleanRoomMultiple\"\u003e\u003ccode\u003emyRobot.\u003cb\u003ecleanRoom(args) for multiple rooms\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#pause\"\u003e\u003ccode\u003emyRobot.\u003cb\u003epause()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#stop\"\u003e\u003ccode\u003emyRobot.\u003cb\u003estop()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#resume\"\u003e\u003ccode\u003emyRobot.\u003cb\u003eresume()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#dock\"\u003e\u003ccode\u003emyRobot.\u003cb\u003edock()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#setCarpetBoostAuto\"\u003e\u003ccode\u003emyRobot.\u003cb\u003esetCarpetBoostAuto()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#setCarpetBoostPerformance\"\u003e\u003ccode\u003emyRobot.\u003cb\u003esetCarpetBoostPerformance()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#setCarpetBoostEco\"\u003e\u003ccode\u003emyRobot.\u003cb\u003esetCarpetBoostEco()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#setEdgeCleanOn\"\u003e\u003ccode\u003emyRobot.\u003cb\u003esetEdgeCleanOn()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#setEdgeCleanOff\"\u003e\u003ccode\u003emyRobot.\u003cb\u003esetEdgeCleanOff()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#setCleaningPassesAuto\"\u003e\u003ccode\u003emyRobot.\u003cb\u003esetCleaningPassesAuto()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#setCleaningPassesOne\"\u003e\u003ccode\u003emyRobot.\u003cb\u003esetCleaningPassesOne()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#setCleaningPassesTwo\"\u003e\u003ccode\u003emyRobot.\u003cb\u003esetCleaningPassesTwo()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#setAlwaysFinishOn\"\u003e\u003ccode\u003emyRobot.\u003cb\u003esetAlwaysFinishOn()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#setAlwaysFinishOff\"\u003e\u003ccode\u003emyRobot.\u003cb\u003esetAlwaysFinishOff()\u003c/b\u003e\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#connect\"\u003e\u003ccode\u003emyRobot.on(\u003cb\u003e'connect'\u003c/b\u003e, callback)\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#close\"\u003e\u003ccode\u003emyRobot.on(\u003cb\u003e'close'\u003c/b\u003e, callback)\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#offline\"\u003e\u003ccode\u003emyRobot.on(\u003cb\u003e'offline'\u003c/b\u003e, callback)\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#update\"\u003e\u003ccode\u003emyRobot.on(\u003cb\u003e'update'\u003c/b\u003e, callback)\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#mission\"\u003e\u003ccode\u003emyRobot.on(\u003cb\u003e'mission'\u003c/b\u003e, callback)\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#state\"\u003e\u003ccode\u003emyRobot.on(\u003cb\u003e'state'\u003c/b\u003e, callback)\u003c/code\u003e\u003c/a\u003e\n* \u003ca href=\"#publish\"\u003e\u003ccode\u003emyRobot.publish(\u003cb\u003e'topic'\u003c/b\u003e, \u003cb\u003erawJsonMessageAsString\u003c/b\u003e, callback)\u003c/code\u003e\u003c/a\u003e\n\n## Methods\n\n\u003ca name=\"end\"\u003e\u003c/a\u003e\n#### `end()`\n\nClose the connection to the robot. It's important if you want to send commands via the official mobile app via Local network. There's a maximum of 1 connection at any time in local network, so if your app is connected, the official mobile app only works via cloud access.\n\nWhile dorita980 is connected, you can call other methods to send commands and listen for the events to get data. Just call the `.end()` method if you want. While dorita980 is connected, the official mobile app will only work via the cloud to send commands to your robot.\n\n\u003ca name=\"getRobotState\"\u003e\u003c/a\u003e\n#### `getRobotState(Array waitForFields)`\n\nGet the robot state but wait for the `waitForFields` fields before return.\n\nThe state object starts empty and the robot will add data over time.\n\n```javascript\nmyRobotViaLocal.getRobotState(['batPct', 'bbchg3']).then((actualState) =\u003e {\n  console.log(actualState);\n});\n```\n\nFull state should contain:\n```javascript\n\n{ netinfo:\n   { dhcp: true,\n     addr: 4294967040,\n     mask: 4294967040,\n     gw: 4294967040,\n     dns1: 4294967040,\n     dns2: 0,\n     bssid: '12:12:12:12:12:12',\n     sec: 4 },\n  wifistat: { wifi: 1, uap: false, cloud: 4 },\n  wlcfg: { sec: 7, ssid: '123123123123123123123123' },\n  mac: '34:34:34:34:34:34',\n  country: 'US',\n  cloudEnv: 'prod',\n  svcEndpoints: { svcDeplId: 'v005' },\n  localtimeoffset: -180,\n  utctime: 1487103319,\n  pose: { theta: 61, point: { x: 171, y: -113 } },\n  batPct: 100,\n  dock: { known: true },\n  bin: { present: true, full: false },\n  audio: { active: false },\n  cleanMissionStatus:\n   { cycle: 'none',\n     phase: 'charge',\n     expireM: 0,\n     rechrgM: 0,\n     error: 0,\n     notReady: 0,\n     mssnM: 2,\n     sqft: 29,\n     initiator: 'manual',\n     nMssn: 324 },\n  language: 2,\n  noAutoPasses: false,\n  noPP: false,\n  ecoCharge: false,\n  vacHigh: false,\n  binPause: false,\n  carpetBoost: true,\n  openOnly: false,\n  twoPass: false,\n  schedHold: false,\n  lastCommand: { command: 'dock', time: 1487103424, initiator: 'manual' },\n  langs:\n   [ { 'en-US': 0 },\n     { 'fr-FR': 1 },\n     { 'es-ES': 2 },\n     { 'de-DE': 3 },\n     { 'it-IT': 4 } ],\n  bbnav: { aMtrack: 45, nGoodLmrks: 15, aGain: 12, aExpo: 9 },\n  bbpanic: { panics: [ 8, 8, 8, 14, 8 ] },\n  bbpause: { pauses: [ 15, 0, 0, 0, 0, 0, 0, 0, 0, 17 ] },\n  bbmssn:\n   { nMssn: 323,\n     nMssnOk: 218,\n     nMssnC: 99,\n     nMssnF: 1,\n     aMssnM: 35,\n     aCycleM: 31 },\n  bbrstinfo: { nNavRst: 41, nMobRst: 0, causes: '0000' },\n  cap: { pose: 1, ota: 2, multiPass: 2, carpetBoost: 1 },\n  sku: 'R98----',\n  batteryType: 'lith',\n  soundVer: '31',\n  uiSwVer: '4582',\n  navSwVer: '01.09.09',\n  wifiSwVer: '20902',\n  mobilityVer: '5309',\n  bootloaderVer: '3580',\n  umiVer: '5',\n  softwareVer: 'v2.0.0-34',\n  tz:\n   { events: [ { dt: 0, off: -180 }, { dt: 0, off: -180 }, { dt: 0, off: 0 } ],\n     ver: 2 },\n  timezone: 'America/Buenos_Aires',\n  name: 'robotNAme',\n  cleanSchedule:\n   { cycle: [ 'none', 'none', 'none', 'none', 'none', 'none', 'none' ],\n     h: [ 17, 10, 10, 12, 10, 13, 17 ],\n     m: [ 0, 30, 30, 0, 30, 30, 0 ] },\n  bbchg3:\n   { avgMin: 158,\n     hOnDock: 6110,\n     nAvail: 1280,\n     estCap: 12311,\n     nLithChrg: 233,\n     nNimhChrg: 0,\n     nDocks: 98 },\n  bbchg: { nChgOk: 226, nLithF: 0, aborts: [ 4, 4, 4 ] },\n  bbswitch: { nBumper: 55889, nClean: 300, nSpot: 47, nDock: 98, nDrops: 300 },\n  bbrun:\n   { hr: 211,\n     min: 48,\n     sqft: 566,\n     nStuck: 17,\n     nScrubs: 85,\n     nPicks: 592,\n     nPanics: 178,\n     nCliffsF: 1532,\n     nCliffsR: 2224,\n     nMBStll: 0,\n     nWStll: 1,\n     nCBump: 0 },\n  bbsys: { hr: 6522, min: 54 },\n  signal: { rssi: -43, snr: 40 } }\n\n```\n\n\u003ca name=\"getPreferences\"\u003e\u003c/a\u003e\n#### `getPreferences()`\n\nGet the full robot state but wait for the `['cleanMissionStatus', 'cleanSchedule', 'name', 'vacHigh', 'pose']` fields before returning.\n\nAlias for `getRobotState(['cleanMissionStatus', 'cleanSchedule', 'name', 'vacHigh', 'pose', 'signal'])`\n\nWaits for the 'signal' to make sure we have the full state object.\n\nUse `getRobotState(['cleanMissionStatus', 'cleanSchedule', 'name', 'vacHigh', 'signal'])` without `pose` in models without navigation like E6 models.\n\n\u003ca name=\"setPreferences\"\u003e\u003c/a\u003e\n#### `setPreferences(newPreferences)`\n\nPartially overwrites the robot state to configure it.\n\n```javascript\nvar newPreferences = { \n binPause: false\n};\n\nmyRobotViaLocal.setPreferences(newPreferences)\n```\n\nResponse:\n\n```javascript\n{\"ok\":null}\n```\n\n\u003ca name=\"getMission\"\u003e\u003c/a\u003e\n#### `getMission()`\nWith this you can draw a map :) in models with position reporting. Use `getBasicMission()` in robots without position reporting feature like E5 models.\n\n```javascript\n{ cleanMissionStatus:\n   { cycle: 'none',\n     phase: 'charge',\n     expireM: 0,\n     rechrgM: 0,\n     error: 0,\n     notReady: 0,\n     mssnM: 15,\n     sqft: 0,\n     initiator: 'localApp',\n     nMssn: 323 },\n  pose: { theta: -160, point: { x: 166, y: -11 } } }\n```\n\n\u003ca name=\"getBasicMission\"\u003e\u003c/a\u003e\n#### `getBasicMission()`\nSame as `getMission` but don't wait for `pose` information\n```javascript\n{ cleanMissionStatus:\n   { cycle: 'none',\n     phase: 'charge',\n     expireM: 0,\n     rechrgM: 0,\n     error: 0,\n     notReady: 0,\n     mssnM: 15,\n     sqft: 0,\n     initiator: 'localApp',\n     nMssn: 323 }}\n```\n\n\u003ca name=\"getWirelessStatus\"\u003e\u003c/a\u003e\n#### `getWirelessStatus()`\n```javascript\n{ wifistat: { wifi: 1, uap: false, cloud: 4 },\n  netinfo:\n   { dhcp: true,\n     addr: 3232235880,\n     mask: 4294967040,\n     gw: 3232235777,\n     dns1: 3232235777,\n     dns2: 0,\n     bssid: 'c0:56:27:70:3b:fe',\n     sec: 4 } }\n```\n\n\u003ca name=\"getTime\"\u003e\u003c/a\u003e\n#### `getTime()`\n```javascript\n1487100141\n```\n\n\u003ca name=\"getBbrun\"\u003e\u003c/a\u003e\n#### `getBbrun()`\n```javascript\n { hr: 211,\n   min: 48,\n   sqft: 566,\n   nStuck: 17,\n   nScrubs: 85,\n   nPicks: 592,\n   nPanics: 178,\n   nCliffsF: 1532,\n   nCliffsR: 2224,\n   nMBStll: 0,\n   nWStll: 1,\n   nCBump: 0 }\n```\n\n\u003ca name=\"getLangs\"\u003e\u003c/a\u003e\n#### `getLangs()`\n```javascript\n [ { 'en-US': 0 },\n   { 'fr-FR': 1 },\n   { 'es-ES': 2 },\n   { 'de-DE': 3 },\n   { 'it-IT': 4 } ]\n```\n\n\u003ca name=\"getSys\"\u003e\u003c/a\u003e\n#### `getSys()`\n\n```javascript\n{ bbrstinfo: { nNavRst: 41, nMobRst: 0, causes: '0000' },\n  cap: { pose: 1, ota: 2, multiPass: 2, carpetBoost: 1 },\n  sku: 'R98----',\n  batteryType: 'lith',\n  soundVer: '31',\n  uiSwVer: '4582',\n  navSwVer: '01.09.09',\n  wifiSwVer: '20902',\n  mobilityVer: '5309',\n  bootloaderVer: '3580',\n  umiVer: '5',\n  softwareVer: 'v2.0.0-34',\n  audio: { active: false },\n  bin: { present: true, full: false } }\n```\n\n\u003ca name=\"getWirelessLastStatus\"\u003e\u003c/a\u003e\n#### `getWirelessLastStatus()`\n```javascript\n{ wifi: 1, uap: false, cloud: 4 },\n  wlcfg: { sec: 7, ssid: '1234567890796857336364' }\n```\n\n\u003ca name=\"getWeek\"\u003e\u003c/a\u003e\n#### `getWeek()`\nDisable Monday and start every day at 10:30am\n```javascript\n{ cycle: [ 'none', 'none', 'none', 'none', 'none', 'none', 'none' ],\n  h: [ 17, 10, 10, 12, 10, 13, 17 ],\n  m: [ 0, 30, 30, 0, 30, 30, 0 ] }\n```\n\n\u003ca name=\"setWeek\"\u003e\u003c/a\u003e\n#### `setWeek(newWeek)`\n\nDisable Sunday and start every day at 10:30am\n```javascript\nvar newWeek = {\"cycle\":[\"none\",\"start\",\"start\",\"start\",\"start\",\"start\",\"start\"],\"h\":[10,10,10,10,10,10,10],\"m\":[30,30,30,30,30,30,30]}\nmyRobotViaLocal.setWeek(newWeek)\n```\n\nResponse:\n\n```javascript\n{\"ok\":null}\n```\n\n\u003ca name=\"getCloudConfig\"\u003e\u003c/a\u003e\n#### `getCloudConfig()`\n```javascript\nprod\n```\n\n\u003ca name=\"start\"\u003e\u003c/a\u003e\n#### `start()`\n```javascript\n{\"ok\":null}\n```\n\n\u003ca name=\"clean\"\u003e\u003c/a\u003e\n#### `clean()`\n```javascript\n{\"ok\":null}\n```\n\n\u003ca name=\"cleanRoom\"\u003e\u003c/a\u003e\n#### `cleanRoom(args)`\n\n`cleanRoom` is an alias for `start` - but with arguments. To clean a room - you need a structure similar to:\n\n```javascript\nconst args = {\n  \"pmap_id\": \"ABCDEFG123456FGKS789\",\n  \"regions\": [\n    { \"region_id\": \"5\", \"region_name\": \"Hallway\", \"region_type\": \"hallway\", \"type\": \"rid\"}\n  ],\n  \"user_pmapv_id\": \"190917T20125Z\"\n};\n\nmyRobotViaLocal.cleanRoom(args);\n```\n\n```javascript\n{\"ok\":null}\n```\n\nThe easiest way to find this information is to start a clean using the iRobot app and then call the `getRobotState` method and copy the `lastCommand` values from it. Using this you can derive the `pmap_id`, `user_pmapv_id` and `regions` data. Or looking into `pmaps` property in the state.\n\n\u003ca name=\"cleanRoomMultiple\"\u003e\u003c/a\u003e\n#### `cleanRoom(args)` for multiple rooms\nBy adding more regions to the regions array, a set of rooms will be cleaned.\nAt least from firmware Version 3.8.3 you can set the desired order, when cleaning multiple rooms by adding `ordered = 1`:\n\n```javascript\nconst args = {\n  \"ordered\": 1,\n  \"pmap_id\": \"ABCDEFG123456FGKS789\",\n  \"regions\": [\n    { \"region_id\": \"5\", \"region_name\": \"Hallway\", \"region_type\": \"hallway\", \"type\": \"rid\"},\n    { \"region_id\": \"0\", \"region_name\": \"living room\", \"region_type\": \"familiy room\", \"type\": \"rid\"},\n    { \"region_id\": \"1\", \"region_name\": \"kitchen\", \"region_type\": \"kitchen\", \"type\": \"rid\"}\n  ],\n  \"user_pmapv_id\": \"190917T20125Z\"\n};\n\nmyRobotViaLocal.cleanRoom(args);\n```\n\n```javascript\n{\"ok\":null}\n```\n\n\u003ca name=\"pause\"\u003e\u003c/a\u003e\n#### `pause()`\n```javascript\n{\"ok\":null}\n```\n\n\u003ca name=\"stop\"\u003e\u003c/a\u003e\n#### `stop()`\n```javascript\n{\"ok\":null}\n```\n\n\u003ca name=\"resume\"\u003e\u003c/a\u003e\n#### `resume()`\n```javascript\n{\"ok\":null}\n```\n\n\u003ca name=\"dock\"\u003e\u003c/a\u003e\n#### `dock()`\nNote: before dock you need to pause() or stop() your robot.\n```javascript\n{\"ok\":null}\n```\n\u003ca name=\"find\"\u003e\u003c/a\u003e\n#### `find()`\nNote: sends locate request. If the robot is on dock nothing will happen, otherwise it will beep.\n```javascript\n{\"ok\":null}\n```\n\n## Simplifications to set Cleaning Preferences:\nThis methods use setPreferences() with the correct `flags` for each setting.\n\n\u003ca name=\"setCarpetBoostAuto\"\u003e\u003c/a\u003e\n#### `setCarpetBoostAuto()`\n```javascript\n{\"ok\":null}\n```\n\n\u003ca name=\"setCarpetBoostPerformance\"\u003e\u003c/a\u003e\n#### `setCarpetBoostPerformance()`\n\n\u003ca name=\"setCarpetBoostEco\"\u003e\u003c/a\u003e\n#### `setCarpetBoostEco()`\n\n\u003ca name=\"setEdgeCleanOn\"\u003e\u003c/a\u003e\n#### `setEdgeCleanOn()`\n\n\u003ca name=\"setEdgeCleanOff\"\u003e\u003c/a\u003e\n#### `setEdgeCleanOff()`\n\n\u003ca name=\"setCleaningPassesAuto\"\u003e\u003c/a\u003e\n#### `setCleaningPassesAuto()`\n\n\u003ca name=\"setCleaningPassesOne\"\u003e\u003c/a\u003e\n#### `setCleaningPassesOne()`\n\n\u003ca name=\"setCleaningPassesTwo\"\u003e\u003c/a\u003e\n#### `setCleaningPassesTwo()`\n\n\u003ca name=\"setAlwaysFinishOn\"\u003e\u003c/a\u003e\n#### `setAlwaysFinishOn()`\n\n\u003ca name=\"setAlwaysFinishOff\"\u003e\u003c/a\u003e\n#### `setAlwaysFinishOff()`\n\n\u003ca name=\"publish\"\u003e\u003c/a\u003e\n#### `publish(topic, rawJsonMessageAsString, callback)`\n\nJust to experiment with raw commands using the MQTT client. Known topics are `cmd` and `delta`. But Experiment with other topics and message formats!\n\nThe `delta` commands tipicaly have the following json format:\n```\n{'state': newState}\n```\n\nThe `cmd` commands tipicaly have the following json format:\n\n```\n{'command': command, time: Date.now() / 1000 | 0, initiator: 'localApp'};\n```\n\nFor example to send a clean command:\n\n```javascript\nlet myCommand = {command: 'clean', time: Date.now() / 1000 | 0, initiator: 'localApp'};\n\nmyRobotViaLocal.publish('cmd', JSON.stringify(myCommand), function(e) {\n  if(e) console.log('error', e);\n});\n```\n\nDont forget stringify the json message with `JSON.stringify(rawJsonMessageAsString)`.\n\nYou can see undocument commands and preferences in [this thread](https://github.com/koalazak/dorita980/issues/39)\n\n\n## Events\n\n\u003ca name=\"connect\"\u003e\u003c/a\u003e\n#### `connect` event\n\nEmitted on successful Connection.\n\n`function () {}`\n\nPut your code inside this callback.\n\n\u003ca name=\"close\"\u003e\u003c/a\u003e\n#### `close` event\n\nEmitted after a disconnection.\n\n\u003ca name=\"offline\"\u003e\u003c/a\u003e\n#### `offline` event\n\nEmitted when the client goes offline.\n\n\u003ca name=\"update\"\u003e\u003c/a\u003e\n#### `update` event\n\nEmitted every time the Robot publishes a new message to the mqtt bus.\n\n`function (data) {}`\n\n- `data` Data published by the Robot\n\n```javascript\nmyRobotViaLocal.on('update', function (data) {\n console.log(data);\n});\n```\nWill print:\n```javascript\n{ state:\n   { reported:\n      { soundVer: '31',\n        uiSwVer: '4582',\n        navSwVer: '01.09.09',\n        wifiSwVer: '20902',\n        mobilityVer: '5309',\n        bootloaderVer: '3580',\n        umiVer: '5',\n        softwareVer: 'v2.0.0-34' } } }\n```\n\u003ca name=\"mission\"\u003e\u003c/a\u003e\n#### `mission` event\n\nEmitted every `emitIntervalTime` milliseconds with the mission data. (util for mapping in models with position reporting)\n\n`function (data) {}`\n\n- `data` Mission data with `cleanMissionStatus` and `pose` state properties.\n\n```javascript\nvar cleanMissionStatus = 300; // default is 800ms\nvar myRobotViaLocal = new dorita980.Local('MyUsernameBlid', 'MyPassword', '192.168.1.104', 2, cleanMissionStatus); // Note Firmware version.\n\nmyRobotViaLocal.on('mission', function (data) {\n  console.log(data);\n});\n```\nWill print each 300ms:\n\n```javascript\n{ cleanMissionStatus:\n   { cycle: 'none',\n     phase: 'charge',\n     expireM: 0,\n     rechrgM: 0,\n     error: 0,\n     notReady: 0,\n     mssnM: 15,\n     sqft: 0,\n     initiator: 'localApp',\n     nMssn: 323 },\n  pose: { theta: -160, point: { x: 166, y: -11 } } }\n```\n\n\u003ca name=\"state\"\u003e\u003c/a\u003e\n#### `state` event\n\nEmitted every time the Robot publish a new message to the mqtt bus. \n\n`function (data) {}`\n\n- `data` Full robot state object\n\n```javascript\nmyRobotViaLocal.on('state', function (data) {\n console.log(data);\n});\n```\nWill print the Full robot state!\n\n# Note for node.js v0.10 users\n\ndorita980 is compatible with node.js \u003e 4.0 But you can use the [getpassword](https://github.com/koalazak/dorita980#how-to-get-your-usernameblid-and-password) feature in node.js \u003c 4.0 using `--harmony` flag like that:\n\n```bash\n$ node --harmony ./bin/getpassword.js \"192.168.1.104\"\n```\n\n# Custom tls cipher\n\nYou can set `ROBOT_CIPHERS` environment variable to overwrite the cipher suit used in tls connection to the robot. Default is `AES128-SHA256`\n\n```bash\n$ ROBOT_CIPHERS=AES128-SHA node myscript.js\n```\n# Cloud API\n\nNot implemented yet in Firmware 2.0.0. [Help wanted!](https://github.com/koalazak/dorita980/issues/25)\n\n# Donations\n\nIf you'd like to help dorita980 stay updated and support new robots and firmwares please consider making a donation to help me purchase the latest robots.\n\n|  Method        | Wallet                                     | \n|----------------|--------------------------------------------|\n| Bitcoin        | bc1qepwdmdk25yxa39g9kerzw9m5y7nxztwkmcu3aa |\n| Etherum        | 0x7EcE75b4fc6A2109850a106b58Dcf750C6B0CdE3 |\n| OpenColective  | [opencollective](https://opencollective.com/dorita980)       |\n| Paypal         | zak.tux@gmail.com                          |\n| Others         | Ask me                                     |\n\nThank you very much for your support!\n\n## Author\n\n- [Facu ZAK](https://github.com/koalazak) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoalazak%2Fdorita980","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoalazak%2Fdorita980","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoalazak%2Fdorita980/lists"}