Error on v0.9.20 - Exception Caught On Message

Posted on
Fri Feb 10, 2023 10:43 am
roquej offline
User avatar
Posts: 609
Joined: Jan 04, 2015
Location: South Florida, USA

Error on v0.9.20 - Exception Caught On Message

Getting:

iRobot-Roomba Error Exception Caught On Message
Traceback (most recent call last):
File "/Library/Application Support/Perceptive Automation/Indigo 2022.1/Plugins/iRobot-Roomba.indigoPlugin/Contents/Server Plugin/roomba.py", line 890, in on_message
log_string, json_data = self.decode_payload(msg.topic,msg.payload)
File "/Library/Application Support/Perceptive Automation/Indigo 2022.1/Plugins/iRobot-Roomba.indigoPlugin/Contents/Server Plugin/roomba.py", line 1089, in decode_payload
return formatted_data, dict(json_data)
UnboundLocalError: local variable 'json_data' referenced before assignment

Suggestions?

JP

Posted on
Fri Feb 10, 2023 10:06 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Error on v0.9.20 - Exception Caught On Message

Not seeing it across my growing numbers of iroombas.

When do you see it?

If all the time - turn debug on, and enable check box - there is a logging line above this that details msg received and payload. Presumably something is up with the payload.

This is the an example of debug message a few lines higher.
Code: Select all
 on_message: msg.topic:$aws/things/D16A1E25D11D4FD5ADBD2F6C4782B861/shadow/update msg.qos:0 payload:b'{"state":{"reported":{"cleanMissionStatus":{"cycle":"clean","phase":"run","expireM":0,"rechrgM":0,"error":0,"notReady":0,"condNotReady":[],"mssnM":0,"expireTm":0,"rechrgTm":0,"mssnStrtTm":1676089385,"operatingMode":2,"initiator":"localApp","nMssn":662,"missionId":"01GRZBCR18E4A969YC9T6P5ZCW"}}}}'


Edit:
Have had a look - and think can see what is happening. It would appear the plugin is receiving a bad json message which causes a ValueError, flowing on to this exception later. Quite what the message is would probably be useful.
Try 0.9.21
https://github.com/Ghawken/Indigo-iRobotRoomba

Fixes this issue, and debug log will show what the message was.



Glenn


Sent from my iPad using Tapatalk
Last edited by GlennNZ on Sat Feb 11, 2023 2:39 pm, edited 1 time in total.

Posted on
Sat Feb 11, 2023 10:03 am
roquej offline
User avatar
Posts: 609
Joined: Jan 04, 2015
Location: South Florida, USA

Re: Error on v0.9.20 - Exception Caught On Message

Thank you, Glenn for the quick turn around! Latest version installed and debug is on. Will share the message when it happens, which is sporadic.

JP

Posted on
Wed Feb 22, 2023 8:23 pm
roquej offline
User avatar
Posts: 609
Joined: Jan 04, 2015
Location: South Florida, USA

Re: Error on v0.9.20 - Exception Caught On Message

I have had time to look at this, but the issue is fairly regular now:

iRobot-Roomba Starting Roomba
iRobot-Roomba Debug updateFrequency = 86400.0
iRobot-Roomba Debug statusFrequency = 60
iRobot-Roomba Debug deviceStartComm called for Roomba-Master
iRobot-Roomba Debug Mapping File should equal:/Library/Application Support/Perceptive Automation/Indigo 2022.1/Preferences/Plugins/com.GlennNZ.indigoplugin.irobot/192.168.X.Y-mapping-data.json
iRobot-Roomba Debug Mapping Data File Does Not Exist.
iRobot-Roomba No Cloud Mapping Data found for this device. Please setup in Device Config if needed.
iRobot-Roomba Debug {}
iRobot-Roomba Debug checkALlRoombas called.
iRobot-Roomba Debug getRoomba Info Running..
iRobot-Roomba Debug getRoombaInfo for Roomba-Master
iRobot-Roomba Debug connectRoomba Called self.roomba_list = []
iRobot-Roomba Debug Device Name = Roomba-Master
iRobot-Roomba Debug connecting Roomba Device: Roomba-Master
iRobot-Roomba Debug Using config file: /Library/Application Support/Perceptive Automation/Indigo 2022.1/Preferences/Plugins/com.GlennNZ.indigoplugin.irobot/192.168.101.156-config.ini
iRobot-Roomba Debug CONTINUOUS connection
iRobot-Roomba Debug Reading Config File: 192.168.X.Y-config.ini
iRobot-Roomba Debug Reading config file... /Library/Application Support/Perceptive Automation/Indigo 2022.1/Preferences/Plugins/com.GlennNZ.indigoplugin.irobot/192.168.X.Y-config.ini
iRobot-Roomba Debug reading info from config file /Library/Application Support/Perceptive Automation/Indigo 2022.1/Preferences/Plugins/com.GlennNZ.indigoplugin.irobot/192.168.X.Y-config.ini
iRobot-Roomba Debug Sections ['192.168.X.Y']
iRobot-Roomba Debug Posting DECODED data
iRobot-Roomba Debug Connecting: Name:Roomba-Master && Address:192.168.X.Y && password::1:XXXXXXXXXXXXXXX && Port:8883
iRobot-Roomba Debug Connecting Roomba-Master
iRobot-Roomba Debug Selecting the best SSL TLS Settings
iRobot-Roomba Setting TLS
iRobot-Roomba Debug MQTT Client Succesfully setup
iRobot-Roomba Debug Client MQTT New Connection - Connect Running now Roomba-Master
iRobot-Roomba Debug Threading inital connection to avoid issues if one iRoomba down...
iRobot-Roomba Debug Client LoopStart Running now Roomba-Master
iRobot-Roomba Debug Adding myroomba to self.roomba_list..
iRobot-Roomba Debug self.roomba_list:[<roomba.Roomba object at 0x104b49990>]
iRobot-Roomba Debug Reconnecting device/checked
iRobot-Roomba Debug Updating Master States....
iRobot-Roomba Debug updateMasterStates called.
iRobot-Roomba Debug saveMasterStateDevice called. FromonMessage:False and currentstate:None
iRobot-Roomba Debug Writing Master State Device:XXXXXX:{}
iRobot-Roomba Debug Roomba Connected Roomba-Master
iRobot-Roomba Debug Subscribed: 1 (0,)
iRobot-Roomba Debug on_message: msg.topic:$aws/things/3162C22490730760/shadow/update msg.qos:0 payload:b'{"state":{"reported":{"country": "US"}}}'
iRobot-Roomba Debug check on_message called by on_message iroomba function: For Device:192.168.X.Y
iRobot-Roomba Debug Found Device: 192.168.X.Y Matching device IP192.168.X.Y
iRobot-Roomba Debug saveMasterStateDevice called. FromonMessage:True and currentstate:None
iRobot-Roomba Debug Writing Master State Device: XXXXXX:{"state": {"reported": {"country": "US"}}}
iRobot-Roomba Debug Errorcode and notReady:0
iRobot-Roomba Debug on_message: msg.topic:$aws/things/3162C22490730760/shadow/update msg.qos:0 payload:b'{"state":{"reported":{"cloudEnv": "prod"}}}'
iRobot-Roomba Debug check on_message called by on_message iroomba function: For Device:192.168.X.Y
iRobot-Roomba Debug Found Device: 192.168.X.Y Matching device IP192.168.X.Y
iRobot-Roomba Debug saveMasterStateDevice called. FromonMessage:True and currentstate:None
iRobot-Roomba Debug Writing Master State Device:XXXXXX:{"state": {"reported": {"country": "US", "cloudEnv": "prod"}}}
iRobot-Roomba Debug Errorcode and notReady:0
iRobot-Roomba Debug on_message: msg.topic:$aws/things/3162C22490730760/shadow/update msg.qos:0 payload:b'{"state":{"reported":{"svcEndpoints":{"svcDeplId": "v011"}}}}'
iRobot-Roomba Debug check on_message called by on_message iroomba function: For Device:192.168.X.Y
iRobot-Roomba Debug Found Device: 192.168.X.Y Matching device IP192.168.X.Y
iRobot-Roomba Debug saveMasterStateDevice called. FromonMessage:True and currentstate:None
iRobot-Roomba Debug Writing Master State Device: XXXXXX:{"state": {"reported": {"country": "US", "cloudEnv": "prod", "svcEndpoints": {"svcDeplId": "v011"}}}}
iRobot-Roomba Debug Errorcode and notReady:0
iRobot-Roomba Debug on_message: msg.topic:$aws/things/3162C22490730760/shadow/update msg.qos:0 payload:b'{"state":{"reported":{"wifiAnt":1}}}'
iRobot-Roomba Debug check on_message called by on_message iroomba function: For Device:192.168.X.Y
iRobot-Roomba Debug Found Device: 192.168.X.Y Matching device IP192.168.X.Y
iRobot-Roomba Debug saveMasterStateDevice called. FromonMessage:True and currentstate:None
iRobot-Roomba Debug Writing Master State Device: XXXXXX:{"state": {"reported": {"country": "US", "cloudEnv": "prod", "svcEndpoints": {"svcDeplId": "v011"}, "wifiAnt": 1}}}
iRobot-Roomba Debug Errorcode and notReady:0
iRobot-Roomba Debug on_message: msg.topic:umi/resp msg.qos:0 payload:b'"err":-32700}!'
iRobot-Roomba Error Exception Caught On Message
Traceback (most recent call last):
File "/Library/Application Support/Perceptive Automation/Indigo 2022.1/Plugins/iRobot-Roomba.indigoPlugin/Contents/Server Plugin/roomba.py", line 890, in on_message
log_string, json_data = self.decode_payload(msg.topic,msg.payload)
File "/Library/Application Support/Perceptive Automation/Indigo 2022.1/Plugins/iRobot-Roomba.indigoPlugin/Contents/Server Plugin/roomba.py", line 1089, in decode_payload
return formatted_data, dict(json_data)
UnboundLocalError: local variable 'json_data' referenced before assignment

Posted on
Wed Feb 22, 2023 8:57 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Error on v0.9.20 - Exception Caught On Message

Thanks for the log.

Unfortunately it looks like I’m not capturing the issue as I thought I was. (the error is coming through not as a dict which I didn’t alter). But at least with the logging now - can fix specifically for it as well.

Won’t be too long.
[Edit]
try 0.9.22:
Should catch better
& you should be able to turn off debug logging.


Your iRoomba seems to be sending regular error messages (which is why only you seeing this - the error message isn’t a json formatted message which they all should be) which is what is causing this Plugin issue. Probably pay at to force reboot it and see if revolved….

Glenn


Sent from my iPad using Tapatalk

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests