Seite 1 von 1

cmd=version liefert ungültiges JSON während das Gerät schläft [KEIN BUG, Timeout zu kurz eingestellt?]

Verfasst: Mo 3. Aug 2020, 13:30
von psilo
Hallo,

seit dem Update habe ich das Verhalten, dass Robonect mir über den version Webservice ungültiges JSON zurückliefert, während der Roboter schläft.
Wecke ich ihn bspw. via GUI auf, passen die Daten. Das Verhalten ist wohl auch nicht immer. Gerade habe ich im Zustand "Sleeping" erneut den Webservice aufgerufen und das Gerät wurde korrekt aufgeweckt.. Davor ist es offenbar nicht wach geworden via API Call.

Sieht für mich nach ner Art Timeout aus, nachdem er dann einen halb aufgebauten JSON String zurückliefert.
Ideen?

Sleeping:
version_sleep.PNG
version_sleep.PNG (3.34 KiB) 1956 mal betrachtet
Non-Sleeping:
version_notsleeping.PNG

Update: ich konnte den gleichen Effekt beim Download des Logs via GUI feststellen. Das heruntergeladene XML ist incomplete, das Gerät wacht nicht auf. Wecke ich das Gerät, ist das XML ok bzw. er lädt kilobyte-weise herunter.

"Halbes" XML:
<?xml version="1.0" encoding="UTF-8" ?><robonect><logbook><info><name>Mowie</name><id>D71784</id><logid>0x18032200</logid><version>V1.2</version><compiled>2020-07-14 10:32:00</compiled></info><settings><groupon>0xFFFF</groupon><groupoff>0x0000</groupoff><full>true</full><address>0x0035DBE0</address><sequence>65105</sequence><encoding>1</encoding></settings>

Re: cmd=version liefert ungültiges JSON während das Gerät schläft

Verfasst: Mi 12. Aug 2020, 21:07
von larsan
I can confirm this - my robonect now does the same. And it breaks my Homebridge plugin :(
Would be nice to have this fixed. :)

Re: cmd=version liefert ungültiges JSON während das Gerät schläft

Verfasst: Do 13. Aug 2020, 08:12
von psilo
Thx for confirming. Here is also the related exception from my (self programmed) SmartHomeNG plugin. As you can see it reflects the behavior i got when manually accessing the webservice.

it does not really break my plugin, but its not nice to have this exception at all.

Code: Alles auswählen

2020-08-13  08:06:24 ERROR    lib.plugin       Plugin 'robonect' exception in run() method: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
> Traceback (most recent call last):
>   File "/python/smarthome/lib/plugin.py", line 671, in run
>     self.plugin.run()
>   File "/python/smarthome/plugins/robonect/__init__.py", line 96, in run
>     self.poll_device(ignore_status=True)
>   File "/python/smarthome/plugins/robonect/__init__.py", line 203, in poll_device
>     self.get_mower_information_from_api()
>   File "/python/smarthome/plugins/robonect/__init__.py", line 800, in get_mower_information_from_api
>     json_obj = response.json()
>   File "/usr/local/lib/python3.7/dist-packages/requests/models.py", line 898, in json
>     return complexjson.loads(self.text, **kwargs)
>   File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
>     return _default_decoder.decode(s)
>   File "/usr/lib/python3.7/json/decoder.py", line 337, in decode
>     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
>   File "/usr/lib/python3.7/json/decoder.py", line 353, in raw_decode
>     obj, end = self.scan_once(s, idx)

Re: cmd=version liefert ungültiges JSON während das Gerät schläft

Verfasst: Mo 17. Aug 2020, 17:14
von Admin
Ich kann den Bug nicht bestätigen. Wenn ich die URL manuell aufrufe, dauert der Reponse etwas länger (ca. 6 Sek.) aber dann ist alles ok.
Ich gehe davon aus, dass euer Timeout zu kurz ist.