[RE-RELEASE] iRobot Scheduler

I think you're right. I'll have to dig further to see what's missing. Logs: app:20912022-07-02 12:01:01.343 pm erroriRobot error. Cannot start action. java.lang.NullPointerException: Cannot invoke method toInteger() on null object

app:20912022-07-02 12:01:01.210 pm infotriggering 'start' from 'on'

app:20912022-07-02 12:01:01.078 pm infoStarting Roomba normal cleaning schedule

app:20912022-07-02 12:01:00.885 pm infoNext scheduled cleaning: Saturday at 12:01 PM, rooms: default

Quick Question. Does the i7/i9 section apply to i3/i4 too?

Yes, I should probably rename it i-/s-series... iRobot kept releasing more variant - these settings should be optional.

I think the NullPointerException is our problem... Need to track down what is happening with that. Can you grab the /api/local/info/state JSON output from the rest980 server running on your rPi? Perhaps some attribute is not being reported the same by your model

Output: {"batPct":100,"batteryType":"F12433011","batInfo":{"mDate":"2021-7-20","mName":"PanasonicEnergy","mDaySerial":5550,"mData":"303030333035303100000000000000000000000000","mLife":"0C700B1B10420BD94DDC001504C6F44800C9FE5C2E0BFFFF0131061E00000000","cCount":30,"afCount":0},"batAuthEnable":true,"bbchg":{"nChatters":0,"nKnockoffs":2,"nLithF":0,"nChgOk":35,"aborts":[0,0,0],"chgErr":[0,0,0,0,0],"smberr":8,"nChgErr":0},"bbchg3":{"estCap":2539,"nAvail":84,"hOnDock":1699,"avgMin":89},"bbmssn":{"aCycleM":55,"nMssnF":10,"nMssnC":14,"nMssnOk":18,"aMssnM":105,"nMssn":42},"bbnav":{"aMtrack":89,"nGoodLmrks":0,"aGain":0,"aExpo":0},"bbpause":{"pauses":[22,9,33,18,18,9,22,46,99,99]},"bbrstinfo":{"nNavRst":27,"nMapLoadRst":0,"nMobRst":15,"nSafRst":1,"safCauses":[17,0,0,0,0,0,0,0,0,0]},"bbrun":{"nCBump":2,"nWStll":0,"nPanics":102,"nPicks":97,"nOvertemps":0,"nOpticalDD":0,"nPiezoDD":0,"nScrubs":0,"nMBStll":1121,"nStuck":19,"nEvacs":0,"sqft":124,"min":3,"hr":42,"nCliffsF":2273,"nCliffsR":0},"bbswitch":{"nBumper":60475,"nDrops":961,"nDock":26,"nSpot":11,"nClean":33},"bbsys":{"min":23,"hr":1812},"behaviorFwk":true,"bin":{"present":true,"full":false},"binPause":true,"cap":{"binFullDetect":2,"oMode":2,"dockComm":1,"edge":0,"maps":3,"pmaps":6,"tLine":2,"area":1,"eco":1,"multiPass":3,"team":1,"pp":0,"lang":2,"5ghz":0,"prov":3,"sched":1,"svcConf":1,"ota":2,"log":2,"langOta":2},"carpetBoost":false,"childLock":null,"cleanMissionStatus":{"cycle":"clean","phase":"run","expireM":0,"rechrgM":0,"error":0,"notReady":0,"condNotReady":[],"mssnM":0,"expireTm":0,"rechrgTm":0,"mssnStrtTm":1656787699,"operatingMode":2,"initiator":"rmtApp","nMssn":43,"missionId":"01G703W19RD40ZXT72QZ318RJK"},"cleanSchedule2":[],"cloudEnv":"prod","connected":false,"country":"US","deploymentState":0,"dock":{"known":true,"pn":null,"state":300,"id":null,"fwVer":null,"hwRev":null,"varID":null},"evacAllowed":true,"ecoCharge":false,"featureFlags":{"hibLed":0,"covPlan":0,"ros2SptLvl":true,"clearHaz":true,"umcsIfNotDrc":1,"quietNav":true},"hwPartsRev":{"csscID":0,"mobBrd":4,"mobBlid":"E7B46DE1AB2990F0F5CE65EEEB88E550","imuPartNo":"BMI088","navSerialNo":"FCJ3044001EV","wlan0HwAddr":"50:14:79:37:57:ef","NavBrd":1},"hwDbgr":null,"langs2":{"sVer":"1.0","uLangs":null,"dLangs":{"ver":"0.19","langs":["de-DE","en-US","es-ES","fr-CA","it-IT"]},"sLang":"en-US","aSlots":1},"lastCommand":{"command":"start","initiator":"rmtApp","time":1656787697,"favorite_id":"2008333ff5eac59ecce406ddbd4b010f","robot_id":"1577B02672EF4AF3BEEE307966B57084","ordered":null,"pmap_id":null,"regions":null,"user_pmapv_id":null},"lastDisconnect":2,"mapUploadAllowed":true,"missionTelemetry":{"aux_comms":1,"backup_counts":1,"bat_stats":1,"behaviors_report":1,"camera_settings":1,"coverage_report":1,"map_hypotheses":1,"map_load":1,"map_save":1,"mboe_landmark_stats":1,"mboe_reloc":1,"mission_stats":1,"pmap_navigability":0,"sensor_stats":1,"tumor_classifier_report":1,"vital_stats":1,"vslam_report":1},"mssnNavStats":{"nMssn":42,"missionId":"01G6WZ0PWGWAS24WPXZBGJ81DD","gLmk":0,"lmk":0,"reLc":2,"plnErr":"none","mTrk":89,"kdp":0,"sfkdp":0,"nmc":1,"nmmc":0,"nrmc":0,"mpSt":"idle","l_drift":0,"h_drift":0,"l_squal":3,"h_squal":38},"name":"Rosie","noAutoPasses":false,"noPP":false,"openOnly":false,"pmapLearningAllowed":true,"pmaps":[{"3FQfnevkSg-_Kfr0ljErSg":"220420T220343"}],"rankOverlap":15,"reflexSettings":{"rlWheelDrop":{"enabled":0}},"sceneRecog":1,"schedHold":false,"secureBoot":{"flip":-1,"lastRst":"unknown","recov":"linux+4.0.4.4+daredevil-release+112","idSwitch":0,"TSK":"PRODUCTION","permReq":0,"perm":"none"},"sku":"i415020","softwareVer":"daredevil+2.2.3+daredevil-release+113","subModSwVer":{"nav":"daredevil-nav+2.2.3+ubuntu-HEAD-0ae2e172d24+113","mob":"2.2.3+ubuntu-HEAD-0ae2e172d24+113","pwr":"0.6.0+ubuntu-HEAD-0ae2e172d24+113","sft":"1.1.0+Daredevil-Builds/Daredevil-Certified-Safety/daredevil-safety-71fa0661da6+6","mobBtl":"4.2","linux":"linux+4.0.4.4+daredevil-release+113","con":"3.13.0.3-tags/release-3.13.0.3@3031e631/"},"svcEndpoints":{"svcDeplId":"v005"},"timezone":"America/New_York","tls":{"tzbChk":1,"privKType":2,"lcCiphers":[0,0,0,0,0,0,0,0,50380848,50331708]},"twoPass":false,"tz":{"events":[{"dt":1656676800,"off":-240},{"dt":1667714401,"off":-300},{"dt":1678604401,"off":-240}],"ver":15},"vacHigh":false,"netinfo":{"dhcp":true,"addr":"192.168.4.228","mask":"255.255.252.0","gw":"192.168.4.1","dns1":"192.168.4.1","dns2":"0.0.0.0","bssid":"18:90:88:65:63:a6","sec":4},"signal":{"rssi":-35,"snr":22,"noise":-57},"wifistat":{"wifi":1,"uap":false,"cloud":14},"wlcfg":{"sec":4,"ssid":"57696567706F72742045787472656D65"}}

Thanks, tracing the sequence of the logs you pasted, was looking for the batPct value, which looks ok above.

If you click on the gear in the top-right of the App page, is there an entry under settings for "roombaBatteryLevel"?

No there isn't. Exercpt:

Ok, there's our problem. On the App page, under "Advanced options", there is a selection for Lowest battery percentage Roomba is allowed to start cleaning? -- the code implies that a default value of 60% should be selected, but it seems that isn't happening. Will look into that problem, but in the meantime if you select a value for this setting, I expect things will start working!

You are correct. I set it to 60%. Clicked the "on" button and Rosie is cleaning up. Good call.
Thanks for your help. Let me know if there's anything else you need.
Jay

My turn to need help. Got my pi4 setup with a clean Raspberry OS install, all updated, following the step by step instructions... and can't get this to to succeed.

  • In a new browser tab navigate to http://YOUR_RASPBERRY_PI:PORT (PORT usually is 3000)

Got my blid and password, set them in the file, using port 3000. Start rest980 and got this:

rest980@2.1.2 start
node ./bin/www

rest980:server Listening on port 3000 +0ms

This in Chrome 'http://192.168.1.104:3000/api/local/info/state%20JSON' gets me

This site can’t be reached.
192.168.1.104 took too long to respond

What did I mess up?

@dkilgore90 see above please.

Sorry, between sleep, work, and family, I hadn't gotten a chance to look at this yet :upside_down_face:

The Listening on port 3000 implied that the http server component started successfully. It should not return the prompt until the process dies/is killed. It should output any URLs that you call, along with the http status code and timing. If you're not seeing any additional output, then the server either isn't receiving the request or it's getting stuck within the program.

"Too long to respond" generally indicates some sort of firewall intercepting the packets - I'd suggest verifying your network topology/firewalls between the browser device and your rPi to make sure that the devices are allowed bidirectional communication. You could also install/run tcpdump on the rPi to capture the network traffic and inspect the packets for the expected http request/response.

Thanks for getting back to me, I get the sleep/work/family trifecta. I am running a primary / secondary set of Piholes on my network and plan to check their logs to see if they are being sneaky. I'm also going to check my router and see if I can see anything happening there. I am not getting anything at all after the 'Listening...' message.

The Piholes are also my DHCP servers, but since this guy is getting an IP just fine I doubt that's a factor. Networking has never been my forte and every step deeper in is hard earned for me. I guess you'd say I know enough to be dangerous. :slight_smile:

Ok, sorted all of my above issues. Working in the app to set up a schedule I can't find anywhere that tells me how to format the First Rooms field. I am guessing region IDs here. As a side note, I don't know if I'm supposed to, but I'm not getting region names using "http://192.168.1.73:3000/api/local/info/state".

These fields mirror the main i7/s9 cleanRooms configuration - see here.

Essentially, the full JSON regions array for what you want cleaned.

Yes, I've also noticed that the actual region names don't seem to come through. I haven't pursued this any further, as dorita980 seems to pretty blindly map all data structures from the Roomba, I assume this isn't provided by the mqtt interface.

I've got this mostly setup but I can't get it to work or clean. Hoping I can get some help and insight. I can get the state, see the device and manually control it but the scheduler (presence based) just does not work. Logs show:

the scheduler is set for every day at 10am with the following presence settings:

I have an I3+ in advanced I have it flipped on and have tried it with both Start and cleanRoom I've also tried it with every combination of Start, clearnRoom, ordered cleaning off/on.

If I go to the device, pause all schedules and hit start it will clean so I think it's working - seems to be something with the presence or scheudler?

Complete RPI noob here. I've got everything setup as per the instructions, but Rest980 doesn't seem to auto start after restarting the PI, which I assume is an issue with my roomba.service file?
[Unit]
Description=Roomba Service
After=network.target

[Service]
WorkingDirectory=/home/evojim/rest980
ExecStart=/usr/bin/npm start
Restart=on-failure
User=pi

[Install]
WantedBy=multi-user.target

The only thing I could see as a possible issue is in the permissions for the file, execution is set to Nobody, but if I try and change it to Anyone, I just get an error returned saying "Operation not permitted".

If I run npm start from the rest980 directory, everything fires up and works as it should (I believe). Does anyone have any idea where I may have screwed it up?

@wafox I'm looking into the errors from you logs -- looks like some unexpected null values. Can you send me the Current States and State Variables from your roomba Device, and the Application State from the App (click on the gear in the top-right on the App page)?

@evojim the start on reboot is set by the command sudo systemctl enable roomba.service in the Setting up rest980 to run as a service section of the README. You can simply re-run this, and/or double-check the current state by running systemctl status roomba.service -- the second line of the output should look something like this:

Loaded: loaded (/etc/systemd/system/roomba.service; enabled; vendor preset: enabled)

I tried restarting it a bunch of times previously, and again just now, but checking the current state returned this;

evojim@raspi:~ $ sudo systemctl enable roomba.service
evojim@raspi:~ $ systemctl status roomba.service
● roomba.service - Roomba Service
Loaded: loaded (/etc/systemd/system/roomba.service; enabled; vendor preset>
Active: failed (Result: exit-code) since Sat 2022-11-05 12:19:24 GMT; 4h 4>
Main PID: 594 (code=exited, status=217/USER)
CPU: 4ms

Nov 05 12:19:24 raspi systemd[1]: roomba.service: Scheduled restart job, restar>
Nov 05 12:19:24 raspi systemd[1]: Stopped Roomba Service.
Nov 05 12:19:24 raspi systemd[1]: roomba.service: Start request repeated too qu>
Nov 05 12:19:24 raspi systemd[1]: roomba.service: Failed with result 'exit-code>
Nov 05 12:19:24 raspi systemd[1]: Failed to start Roomba Service.
lines 1-11/11 (END)...skipping...
● roomba.service - Roomba Service
Loaded: loaded (/etc/systemd/system/roomba.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2022-11-05 12:19:24 GMT; 4h 41min ago
Main PID: 594 (code=exited, status=217/USER)
CPU: 4ms

Nov 05 12:19:24 raspi systemd[1]: roomba.service: Scheduled restart job, restart counter is at 5.
Nov 05 12:19:24 raspi systemd[1]: Stopped Roomba Service.
Nov 05 12:19:24 raspi systemd[1]: roomba.service: Start request repeated too quickly.
Nov 05 12:19:24 raspi systemd[1]: roomba.service: Failed with result 'exit-code'.
Nov 05 12:19:24 raspi systemd[1]: Failed to start Roomba Service.

hmm, so it's crashing out and restarting... should be some details in /var/log/syslog:

grep '12:19:24' /var/log/syslog

the status=217/USER suggests that the problem may be the User specified in the roomba.service file doesn't exist.

Ah, perfect, had completely missed that I'd not edited the user from the default. Thanks very much, you're a star!! :+1: :+1: