From 05f32645373ad6d2770290e31f8fbc4c513dcf23 Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Thu, 26 Dec 2019 02:22:29 +0100 Subject: [PATCH 1/2] Added support for FW 3 and Braava robots. --- bin/www | 2 +- public/js/map.js | 5 ++++- routes/api.js | 3 ++- views/map.ejs | 5 ++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/bin/www b/bin/www index 98d22d4..a104e7d 100755 --- a/bin/www +++ b/bin/www @@ -38,7 +38,7 @@ if (sslKeyFile && sslCertFile) { * Listen on provided port, on all network interfaces. */ -server.listen(port); +server.listen(port, "0.0.0.0"); server.on('error', onError); server.on('listening', onListening); diff --git a/public/js/map.js b/public/js/map.js index f7bafae..6a1d3c2 100644 --- a/public/js/map.js +++ b/public/js/map.js @@ -68,7 +68,10 @@ function messageHandler (msg) { msg.ok = msg.cleanMissionStatus; msg.ok.pos = msg.pose; msg.ok.batPct = msg.batPct; - $('#bin').html(msg.bin.present); + if (msg.bin) { $('#bin').html(msg.bin.present); $('#binRow').show(); } else { $('#binRow').hide(); } + if (msg.detectedPad) { $('#detectedPad').html(msg.detectedPad); $('#detectedPadRow').show(); } else { $('#detectedPadRow').hide(); } + if (msg.mopReady) { $('#tankPresent').html(msg.mopReady.tankPresent); $('#tankPresentRow').show(); } else { $('#tankPresentRow').hide(); } + if (msg.mopReady) { $('#lidClosed').html(msg.mopReady.lidClosed); $('#lidClosedRow').show(); } else { $('#lidClosedRow').hide(); } $('#nMssn').html(msg.ok.nMssn); } msg.ok.time = new Date().toISOString(); diff --git a/routes/api.js b/routes/api.js index 2f0d908..f2fa3af 100644 --- a/routes/api.js +++ b/routes/api.js @@ -93,9 +93,10 @@ router.get('/local/info/sku', map2dorita('local', 'getSKU')); router.get('/local/info/wireless', map2dorita('local', 'getWirelessStatus')); router.get('/local/info/lastwireless', map2dorita('local', 'getWirelessLastStatus')); router.get('/local/info/mission', map2dorita('local', 'getMission')); +router.get('/local/info/model', map2dorita('local', 'getModel')); router.get('/local/info/sys', map2dorita('local', 'getSys')); -if (firmwareVersion === 2) { +if (firmwareVersion > 1) { router.get('/local/info/state', map2dorita('local', 'getRobotState')); } diff --git a/views/map.ejs b/views/map.ejs index 05fb56f..f6cf761 100644 --- a/views/map.ejs +++ b/views/map.ejs @@ -37,7 +37,10 @@ var updateEvery = <%=mapvalues.pointIntervalMs%>; Last point:
Mission Time: min
Mission:
- Bin present:
+ Bin present:
+ Detected pad:
+ Tank present:
+ Lid closed:
Cycle:
Phase:
Flags:
From 79d099cffe63b8ffd56100267dcf033e9e3addd0 Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Tue, 14 Jan 2020 02:07:17 +0100 Subject: [PATCH 2/2] Added readme info about FW version 3. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 914e1b6..7f343f0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # rest980 [![Build Status](https://travis-ci.org/koalazak/rest980.svg?branch=master)](https://travis-ci.org/koalazak/rest980) -rest980 create a http server to map all [dorita980](https://github.com/koalazak/dorita980) methods in a REST API to control your iRobot Roomba 900 series 980 / i7 / i7+ via HTTP requests. +rest980 create a http server to map all [dorita980](https://github.com/koalazak/dorita980) methods in a REST API to control your iRobot Roomba 900 series 980 / i7 / i7+ or Braava m6 via HTTP requests. ## Install ```bash @@ -23,7 +23,7 @@ The service can be configured by editing `config/default.json` or by setting env |blid|BLID|*(required)* The Roomba blid. *| |password|PASSWORD|*(required)* The Roomba password. *| |robotIP|ROBOT_IP|*(optional)* Set if you know your robot IP to skip discovery and speed up startup.| -|firmwareVersion|FIRMWARE_VERSION|*(optional)* Set to 1 or 2 depends of your robot firmware version. Use `2` for any firmware >=2 (yes, use 2 if you have firmware version 3). Default to 1 for firmware 1.6.6| +|firmwareVersion|FIRMWARE_VERSION|*(optional)* Set to 1, 2 or 3 depending of your robot firmware version. Default to 1 for firmware 1.6.6| |enableLocal|ENABLE_LOCAL|*(optional)* Set to 'no' if you want to disable local API. Default 'yes'.| |enableCloud|ENABLE_CLOUD|*(optional)* Set to 'no' if you want to disable cloud API. Default 'yes'.| |keepAlive|KEEP_ALIVE|*(optional)* Set to 'no' if you want to connect and disconnect to the robot in each request (slow but leave the connection free for the official mobile app).|