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
945 stars 150 forks source link

Intermittent hangs #93

Closed TroyJ closed 5 years ago

TroyJ commented 5 years ago

I'm getting intermittent hangs (hangs indefinitely).

For example, running this:

var dorita980 = require('dorita980');
var username = process.argv[2];
var password = process.argv[3];
var ip = process.argv[4];
var myRobotViaLocal = new dorita980.Local(username, password, ip);

console.log('1');
myRobotViaLocal.on('connect', execute);
console.log('2');

function execute() {
  console.log('3');
  myRobotViaLocal.getRobotState()
      .then((actualState) => {
        console.log('4');
        console.log(actualState)
      })
      .catch(console.log);
}

Gives the output:

1
2

Sometimes it works fine for days without doing this, and then it starts hanging. Rebooting the host machine doesn't help. I don't have the iphone app open anywhere (I know this causes hangs).

Running get-roomba-password returns the following (see below), but still hangs.

hass:root # get-roomba-password 192.168.137.60
Make sure your robot is on the Home Base and powered on (green lights 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.
Then press any key here...
Robot Data:
{ ver: '3',
  hostname: 'Roomba-3108871C80504720',
  robotname: 'Roomba',
  ip: '192.168.137.60',
  mac: '74:C6:3B:A2:68:98',
  sw: 'v2.4.6-3',
  sku: 'R960040',
  nc: 0,
  proto: 'mqtt',
  cap:
   { pose: 1,
     ota: 2,
     multiPass: 2,
     pp: 1,
     binFullDetect: 1,
     langOta: 1,
     maps: 1,
     edge: 1,
     eco: 1,
     svcConf: 1 },
  blid: '3108871C80504720' }
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: connect ETIMEDOUT 192.168.137.60:8883
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Emitted 'error' event at:
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Any ideas on how to proceed?

koalazak commented 5 years ago

can you share your node.js version and dorita980 version? thanks

TroyJ commented 5 years ago

npm dorita980 --version 6.9.0

node --version v10.16.2

Zefau commented 5 years ago

npm dorita980 --version is wrong and gives the npm version (which is 6.9.0 in your case). Use npm view dorita980 version

TroyJ commented 5 years ago

Oh, sorry... I'm new to npm.

npm view dorita980 version 3.1.3

koalazak commented 5 years ago

looks a wifi issue with 960 robots (several reports with same error only with 960 robots) or maybe the same ssl problem fixed in dorita980@3.1.4 please upgrade to dorita980@3.1.4 and try again.

FrankBlackMG commented 5 years ago

I have a 960 and have this same problem. I'm running dorita980 3.1.4. I can get my blid and password but no other functions work (never have), e.g. getting the weekly schedule or any status.

npm view dorita980 version 3.1.4

node --version v10.16.3