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

dock() after stop() is not executed #104

Closed hokascha closed 4 years ago

hokascha commented 4 years ago

I got an i7 and I'm trying to send it back to it's dock. So I'm using:

myRobotViaLocal.stop()
                .then(() => myRobotViaLocal.dock())
                .then(() => myRobotViaLocal.end())
                .catch(console.log);

The robot stops but then doesn't go back to it's homebase. Am I doing something wrong?

Calling dock() when the robot is not currently cleaning works as expected.

thorazine-12 commented 4 years ago

I have the same problem - it is happening since recent iRobot firmware update. I know that because it worked properly few months ago. If you will send second dock() command then robot will come back to its base.

hokascha commented 4 years ago

Sending a second dock() command right after the first doesn't work for me. What works is restarting the script, which is renewing the connection to the bot and then sending a dock() command.

koalazak commented 4 years ago

maybe it is a time issue? did you try to wait a second after the stop() to send the dock()?

hokascha commented 4 years ago

Your're right! Waiting for 10s between stop() and dock() works!

warki commented 4 years ago

During this period roomba is updating the map. I wait for a new state and then send the "dock" command.

Mirarkitty commented 1 year ago

You can either wait for "isReady" or until status that it's stopped is reported, I think. Then you can send "dock".