koalazak / dorita980

Unofficial iRobot Roomba and Braava (i7/i7+, 980, 960, 900, e5, 690, 675, m6, etc) node.js library (SDK) to control your robot
MIT License
964 stars 149 forks source link

Unable to connect to Roomba i7 #184

Closed klavergne closed 8 months ago

klavergne commented 10 months ago

I have the BLID, password and IP address of my Roomba i7, but I am unable to connect using the sample node file listed in the instructions. It appears to hang and never responds. Product software listed in the iRobot app says 22.25.10. I assume that means it's on firmware v2, but I'm not sure. I can't find anywhere that would tell me which firmware version it's on.

The sample file I'm using is this (slightly modified from what's on the instructions page):


var dorita980 = require('dorita980');

var myRobotViaLocal = new dorita980.Local('{BLID}', '{password}', '{IP address}'); // robot IP address

console.log("Registering connect handler");
myRobotViaLocal.on('connect', init);
console.log("Handler registered");

function init() {
    console.log("Connected to robot");
    myRobotViaLocal.getMission()
        .then((mission) => {
            console.log(mission);
        }).catch((err) => {
            console.log(err);
        });
}```
koalazak commented 8 months ago

probably the .getMission() method is waiting for a missing property in the i7 state. Try with getRobotState(['batPct', 'bbchg3'])

var dorita980 = require('dorita980');

var myRobotViaLocal = new dorita980.Local('{BLID}', '{password}', '{IP address}'); // robot IP address

console.log("Registering connect handler");
myRobotViaLocal.on('connect', init);
console.log("Handler registered");

function init() {
    console.log("Connected to robot");
    myRobotViaLocal.getRobotState(['batPct', 'bbchg3'])
        .then((state) => {
            console.log(state);
        }).catch((err) => {
            console.log(err);
        });
}

and next time please share the output