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
931 stars 147 forks source link

myRobotViaLocal.on is not a function #164

Closed pmgendron closed 1 year ago

pmgendron commented 1 year ago

Hi,

I installed the library as per the documentation.

created an app for one of the roomba on my network with the following code

var dorita980 = require('dorita980');

var myRobotViaLocal = new dorita980.Local('ID', 'PASS', 'IP'); // robot IP address

myRobotViaLocal.on('connect', init);

function init () {
  myRobotViaLocal.clean()
  .then(() => myRobotViaLocal.end()) // disconnect to leave free the channel for the mobile app.
  .catch(console.log);
}

I tried running the app using node roombass.js and this is the error I'm getting:

myRobotViaLocal.on('connect', init);
                ^

TypeError: myRobotViaLocal.on is not a function
    at Object.<anonymous> (/home/pm/roombass.js:5:17)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47

I have a Roomba 980 with firmware 2.4.16-126 and node 18.8.0

At this point, I'm not sure what I could do to debug and make it work.

any help would be greatly appreciated.

cheers,

pm

pmgendron commented 1 year ago

i f*ck up... nevermind.