From 776000325c01adc502b260af9cf04f85a1b3ea65 Mon Sep 17 00:00:00 2001 From: ghawken Date: Fri, 29 Dec 2017 11:28:29 +1100 Subject: [PATCH] 0.2.2 Less error logging for expected conditions Updated documentation --- README.md | 103 ++++++++++++++---- .../Contents/Info.plist | 2 +- .../Contents/Server Plugin/PluginConfig.xml | 2 +- .../Contents/Server Plugin/roomba.py | 8 +- 4 files changed, 86 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 56daa26..5fb9c46 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,99 @@ Hi all, -Roomba 980 Plugin for Indigodomo (Indigodomo.com) +![](http://downloads.indigodomo.com/pluginstore/com.GlennNZ/com.GlennNZ.indigoplugin.irobot/icon.png) -Hopefully not stepping on any toes :shock: - but have taken FlyingDiver iRoomba plugin (Thanks!) (which is no longer working given firmware changes) and used it as base to rewrite a new Plugin to support the iRoomba mqtt communication protocol. (as of firmware v.2.2.9-1 20th May 2017). This was helped a lot by a recent python library for roomba control. +Hopefully not stepping on any toes :shock: - but have taken FlyingDiver iRoomba plugin (Thanks!) (which is no longer working given firmware changes) and used it as base to rewrite a new Plugin to support the iRoomba mqtt communication protocol. (as of firmware v.2.2.9-1 29th December 2017). This was helped a lot by a recent python library for roomba control. Currently - have it functioning well and it enables a continuous connection to one Roomba-980 or multiple intermittent connections to two or more Roombas (although cannot test that aspect - as only have one sadly) The benefit of continuous connection is status is updated immediately - so can trigger events to occur which happen within a few seconds; Status is immediately updated. -The library I am using also supports mapping/drawing a map of cleaning - which I would imagine would look good on a control page. (I haven't worked through those aspects as yet - but have it on a todo list) +The library I am using also supports mapping/drawing a map of cleaning - which I would imagine would look good on a control page. (I haven't worked through those aspects as yet - but have it on a todo list) -Have it running for longer (currently 48 hours without connection issue) and bug testing, also slowly adding further items pulled from the mqtt iroomba stream - but those brave can take a leap here: +***Installation:*** -Usage: +Indigo 7 Only -Download and install +**Needs paho-mqtt for python installed via terminal window: +Within a terminal Window: +` pip install paho-mqtt `** -Needs paho-mqtt python library installed. -In terminal Window -pip install paho-mqtt +Download and Install from Plugin Store as below link: -v.0.1.8 -Fix for no Internet connection +https://www.indigodomo.com/pluginstore/132/ +or +https://github.com/Ghawken/Indigo-iRobotRoomba +***Setup*** -V.0.0.8 +For this plugin to work correctly you irobot needs to have a fixed IP address so to know whom it is. Assign your iroomba a fixed IP address; either a router level (would be my recommendation) or within iroomba setup. + +Install the plugin. + +*Configure the Plugin:* +![](https://preview.ibb.co/gS30CG/Plugin_Config.png) + +[i]Update Device status frequency[/i]: This is the interval between checks on iroomba status. Does not apply if running as continuous connection. +[i]Continous connection to ONE Roomba Device only[/i] Preferred method of communication. Maintains constant local connection to iroomba. If any status change any triggers or status change triggers will occur immediately. Reestablishes the connection only every 24 hours. If any communication issues restarts the plugin to overcome. + +*Create your iroomba Device* +![](https://preview.ibb.co/b99wmb/Device_Irobot.png) + +& +Edit Settings + +![](https://image.ibb.co/nMD0CG/Configure_IRobot.png) + +[i]Roomba IP Address:[/i] Enter the IP address (fixed ideally) of your iroomba robot + +This can be a slightly tricky part as need to be quick between activating iroomba with holding Home button (four notes confirm) and pressing the Get Password button. +Indigo will also give a timeout error (as communication takes longer than allowed). This can be ignored. +This will possibility take a couple of goes to establish communication. + +It then saves the communication password to a IP address based config file and will use this file if you happen to delete you device. + + +**Status** + +The plugin reports the following status - and this is updated live in the setting of continuous communication. + +![](https://image.ibb.co/cachRb/Status_Page.png) + + +**Actions** + +The plugin supports the following actions to control you iroomba. + +[![](https://image.ibb.co/bwo3zw/irobotactions.png)](https://imgbb.com/) + + + + +What could go wrong: + +1. Connection fails with a 'Broken Pipe' Error: + +Debug info may display the following info about your iroomba during the Get Password connection phase: + iRobot-Roomba Debug Received: { + "robotname": "pmgk roomba rdc ", + "sku": "R980020", + "nc": 0, + "ver": "2", + **"proto": "http",** + "ip": "192.168.1.13", + "hostname": "Roomba-", + **"sw": "v1.6.4", ** + "mac": " + } + +This means that your iroomba is on very old software 1.6.4 and is still using its old http protocol. The iroomba automatically update when connected to cloud after a short period of time (unless blocked at firewall level). +This plugin only works on the newer firmware version. +Wait it out and your iroomba will be updated and try again. + +2. If you do not have a fixed IP address for your device it will lose its connection when this is updated by your dhcp server. Set it to fixed. + +3. Occasionally if the plugin loses its connection to iroomba it will restart the plugin itself to reestablish. It does this automatically with no user input required. -Better checks to allow continuous connection for weeks -Change to logging/less verbose -Add X/Y to devices -v.0.0.5 -Supports continuous connection (most tested currently) to one iRoomba or intermittent to multiple -Supports Actions Stop/Start/Pause/Dock sent immediately with continuous connection, or within 15 seconds with intermittent connection. -Status updates immediate (with continuous and more information) or as set in time-interval with intermittent -Saves config details to file in Documents/Indigo-iRoomba for each IP address of Roomba -(can delete, recreate devices and will use same config/password for same IP address) -Get Password from Config Page - works and pulls/saves password (some tidying up of messaging needed) -Enable/Disable Debug mqtt communication as very verbose (and otherwise Indigo would save all to debug log) Glenn diff --git a/iRobot-Roomba.indigoPlugin/Contents/Info.plist b/iRobot-Roomba.indigoPlugin/Contents/Info.plist index c4d6a98..9c111a8 100755 --- a/iRobot-Roomba.indigoPlugin/Contents/Info.plist +++ b/iRobot-Roomba.indigoPlugin/Contents/Info.plist @@ -3,7 +3,7 @@ PluginVersion - 0.2.1 + 0.2.2 ServerApiVersion 2.0 IwsApiVersion diff --git a/iRobot-Roomba.indigoPlugin/Contents/Server Plugin/PluginConfig.xml b/iRobot-Roomba.indigoPlugin/Contents/Server Plugin/PluginConfig.xml index b23831f..7b642aa 100755 --- a/iRobot-Roomba.indigoPlugin/Contents/Server Plugin/PluginConfig.xml +++ b/iRobot-Roomba.indigoPlugin/Contents/Server Plugin/PluginConfig.xml @@ -18,7 +18,7 @@ Enable/Disable - + Enable/Disable diff --git a/iRobot-Roomba.indigoPlugin/Contents/Server Plugin/roomba.py b/iRobot-Roomba.indigoPlugin/Contents/Server Plugin/roomba.py index 4597070..33dc211 100755 --- a/iRobot-Roomba.indigoPlugin/Contents/Server Plugin/roomba.py +++ b/iRobot-Roomba.indigoPlugin/Contents/Server Plugin/roomba.py @@ -461,17 +461,17 @@ def _connect(self, count=0, new_connection=False): #fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1] #self.plugin.logger.error(unicode(exc_type)+ unicode(fname) +unicode( exc_tb.tb_lineno)) - self.plugin.logger.error("Connection Roomba Error: %s " % unicode(e[0])) + self.plugin.logger.debug("Connection Roomba Error: %s " % unicode(e[0])) #if e[0] == 111 or e[0] ==61 : #errno.ECONNREFUSED count +=1 if count <= max_retries: - self.plugin.logger.error("Attempting new Connection# %d" % count) + self.plugin.logger.debug("Attempting new Connection# %d" % count) time.sleep(5) self._connect(count, True) if count == max_retries: - self.plugin.logger.error("Unable to connect %s" % unicode(self.roombaName)) - self.plugin.logger.error("Setting restart switch....") + self.plugin.logger.debug("Unable to connect %s" % unicode(self.roombaName)) + self.plugin.logger.debug("Setting restart switch....") #self.plugin.restartPlugin(self) self.plugin.KILL = True