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

`getTime` never returning with my e6198 #109

Closed jfly closed 4 years ago

jfly commented 4 years ago

First off, thank you for the excellent library!

(I am using dorita980@3.1.7)

I'm trying to figure out what the clock on my e6198 roomba is set to, and I'm trying to use the getTime method to do so. However, when I try to use it, it just hangs and seems to never respond. Any advice on how to debug further? Thanks!

jfly commented 4 years ago

For the record, I do see a time in the lastCommand piece of the json returned by the getPreferences method. For example, using rest980:

➜  ~ curl -s https://.../api/local/config/preferences | jq .lastCommand
{
  "command": "pause",
  "time": 1580682639,
  "initiator": "localApp"
}
David-Hari commented 4 years ago

Most of the "get" methods just wait for a particular parameter to be received. If you look at the code, you'll see that getTime waits for 'utctime'. If it never returns, it's because your robot never sends that parameter in any update.

koalazak commented 4 years ago

yeah, seems like your robot is not reportin 'utctime' property on its state. Use getRobotState() to see all your robot state, maybe this robot model is returning the time in other properti. (time in last command is just the time when the command was fired)