dorita980

repository·master·Indexed 20 days ago

https://github.com/koalazak/dorita980

An unofficial Node.js SDK for controlling iRobot Roomba 980 and other WiFi-enabled series vacuums. The library allows developers to integrate Roomba control into home automation or IoT projects via local LAN commands or the iRobot Cloud API. It includes tools for robot discovery and credential retrieval via the `getpassword` and `getPasswordCloud.js` CLI utilities.

Tokens
7K
Snippets
19
Records
23
Agent score
78%

What's inside dorita980

  1. How Local and Cloud connections work

    master

    The dorita980 library provides two primary ways to interact with your Roomba 980 (Firmware 1.6.6):

    1. Local Connection (dorita980.Local): Sends commands directly over WiFi to your robot on your LAN. This does not require an internet connection. You must provide the robot's IP address and the firmware major version.
    2. Cloud Connection (dorita980.Cloud): Controls the robot via the iRobot cloud API. This allows control from inside or outside your home without needing the robot's local IP address.

    Both methods require your robot's username/blid and password.

    var dorita980 = require('dorita980');
    
    // Local connection example
    var myRobotViaLocal = new dorita980.Local('MyUsernameBlid', 'MyPassword', '192.168.1.104', 1);
    
    // Cloud connection example
    var myRobotViaCloud = new dorita980.Cloud('MyUsernameBlid', 'MyPassword', 1);
  2. How to retrieve your robot's username/blid and password

    master

    To use the library, you need your robot's credentials. You can retrieve them by running the getpassword script from the repository clone:

    1. Clone the repo: git clone https://github.com/koalazak/dorita980.git
    2. Install dependencies: npm install
    3. Run the script: npm run getpassword <robotIP> <firmwareversion>

    Physical Robot Steps:

    • Ensure the robot is on the Home Base and powered on.
    • Press and hold the HOME button for about 2 seconds until it plays a series of tones.
    • Release the button; the WIFI light will flash.
    • The script will then output your Password and Username/blid.
    $ npm run getpassword 192.168.1.103 1
  3. Run getpassword on Node.js v0.10

    master

    The dorita980 library is compatible with Node.js versions greater than 4.0. If you are using Node.js v0.10, you must use the --harmony flag to use the getpassword feature.

    $ node --harmony ./bin/getpassword.js "192.168.1.104"
  4. Quick start: Control robot via Cloud

    master

    To control your robot from anywhere (inside or outside your home), use dorita980.Cloud. You do not need to provide a robot IP address, only the credentials and the firmware major version.

    var dorita980 = require('dorita980');
    
    var myRobotViaCloud = new dorita980.Cloud('MyUsernameBlid', 'MyPassword', 1);
    
    // start to clean!
    myRobotViaCloud.start().then((response) => {
      console.log(response);
    }).catch((err) => {
      console.log(err);
    });
  5. Quick start: Control robot via Local LAN

    master

    To control your robot from your local network, instantiate dorita980.Local with your credentials, the robot's IP address, and the firmware major version (e.g., 1 for firmware 1.6.6).

    var dorita980 = require('dorita980');
    
    var myRobotViaLocal = new dorita980.Local('MyUsernameBlid', 'MyPassword', '192.168.1.104', 1);
    
    // start to clean!
    myRobotViaLocal.start().then((response) => {
      console.log(response);
    }).catch((err) => {
      console.log(err);
    });
  6. Retrieve Roomba credentials via the cloud using getPasswordCloud.js

    master

    Use the getPasswordCloud.js CLI tool to retrieve your iRobot account credentials (BLID and Password) for your Roomba devices. This is useful for obtaining the credentials required to use the dorita980 library.

    Usage

    Run the script via npm (if configured in your package.json) or directly via node. You must provide your iRobot username and password as positional arguments.

    npm run get-password-cloud <iRobot username> <iRobot password> [Gigya API Key]

    Arguments

    1. <iRobot username>: Your iRobot account email/username.
    2. <iRobot password>: Your iRobot account password.
    3. [Gigya API Key] (Optional): An override for the Gigya API Key.

    Environment Variables

    The tool uses the following environment variables for configuration:

    • GIGYA_API_KEY: Used if the optional third argument is not provided.
    • IROBOT_COUNTRY_CODE: The country code for endpoint discovery (defaults to US).
    • IROBOT_DISCOVERY_URL: Overrides the default iRobot discovery endpoint.
    • GIGYA_BASE: Overrides the Gigya base URL.
    • IROBOT_HTTP_BASE: Overrides the iRobot HTTP base URL.

    Output

    If successful, the tool will print the number of robots found and list each robot's details, including:

    • Name
    • SKU
    • Software Version
    • BLID
    • Password
    npm run get-password-cloud <iRobot username> <iRobot password> [Gigya API Key]
  7. Auto-discover robot IP address

    master

    If you do not know your robot's IP address, you can use the dorita980.getRobotIP() method to find it on your network. This process typically takes 1-2 seconds.

    var dorita980 = require('dorita980');
    
    dorita980.getRobotIP(function (ierr, ip) {
      if (!ierr) {
        var myRobotViaLocal = new dorita980.Local('MyUsernameBlid', 'MyPassword', ip);
        // Use the discovered IP to perform actions
      } else {
        console.log('error looking for robot IP');
      }
    });
  8. Simplify Cleaning Preferences settings

    master

    Instead of manually constructing a setPreferences object, you can use these helper methods to toggle specific cleaning settings:

    • setCarpetBoostAuto() / setCarpetBoostPerformance() / setCarpetBoostEco()
    • setEdgeCleanOn() / setEdgeCleanOff()
    • setCleaningPassesAuto() / setCleaningPassesOne() / setCleaningPassesTwo()
    • setAlwaysFinishOn() / setAlwaysFinishOff()
  9. Use the Cloud API (Firmware 1.6.6)

    master

    When the robot is connected to a WiFi network, it can receive remote commands via the iRobot Cloud Service. The myRobotViaCloud object provides access to the following methods to control the robot remotely using your username and password.

    /* Available Cloud API methods */
    myRobotViaCloud.getStatus()
    myRobotViaCloud.accumulatedHistorical()
    myRobotViaCloud.missionHistory()
    myRobotViaCloud.clean()
    myRobotViaCloud.quick()
    myRobotViaCloud.spot()
    myRobotViaCloud.dock()
    myRobotViaCloud.start()
    myRobotViaCloud.pause()
    myRobotViaCloud.resume()
    myRobotViaCloud.stop()
    myRobotViaCloud.wake()
    myRobotViaCloud.reset()
    myRobotViaCloud.find()
    myRobotViaCloud.wipe() // untested
    myRobotViaCloud.patch() // untested
    myRobotViaCloud.dlpkg() // untested
    myRobotViaCloud.rechrg() // untested
    myRobotViaCloud.wlapon() // untested
    myRobotViaCloud.wlapoff() // untested
    myRobotViaCloud.wlston() // untested
    myRobotViaCloud.wlstoff() // untested
    myRobotViaCloud.wifiscan() // untested
    myRobotViaCloud.ipdone() // untested
    myRobotViaCloud.provdone() // untested
    myRobotViaCloud.bye() // untested
    myRobotViaCloud.wllogflush() // untested
    myRobotViaCloud.sleep()
    myRobotViaCloud.off()
    myRobotViaCloud.fbeep()
  10. Decode Cleaning Preferences Flags (Firmware 1.6.6)

    master
    For firmware version 1.6.6, cleaning preferences are represented by a decimal flag value. You can use the decodeCleaningPreferences(flags) method to translate these decimal values into human-readable settings. The settings include Carpet Boost (auto/Performance/Eco), Cleaning Passes (auto/one/two), whether to finish cleaning when the bin is full, and Edge Clean status.
  11. Configure TLS ciphers and legacy support for credential retrieval

    master

    When using the getpassword tool for newer firmware (V2), you can control the TLS connection behavior using environment variables:

    • ROBOT_CIPHERS: Specifies the allowed ciphers. Defaults to AES128-SHA256,TLS_AES_256_GCM_SHA384.
    • ROBOT_TLS_LEGACY: If set to anything other than '0', the tool will attempt to use SSL_OP_LEGACY_SERVER_CONNECT to support older TLS implementations.
    # Example setting a custom cipher
    ROBOT_CIPHERS='YOUR_CIPHER_STRING' npm run getpassword <robot_ip_address>
    
    # Example enabling legacy TLS support
    ROBOT_TLS_LEGACY='1' npm run getpassword <robot_ip_address>