nibi79 / worxlandroid

openHAB Binding for Worx Landroid
57 stars 20 forks source link

OpenHAB crashes and restarts after changing an item in landroid sitemap #80

Open Mercur13 opened 1 year ago

Mercur13 commented 1 year ago

The binding does its work if nothing is changed.... But today: After I changed i.e. mowing duration for today or set the Onetime EdgeCut strange things happened (today twice) ... The OH-App shows "Not network connection" Http-Error 404. In the log all items from all bindings (homematic, zwave, openweather are reset and after a while (30 sec) slowly inititializing and go online again and so the sitemap. Neither the Event.log nor the Openhab.log shows what is causing the crash.

Openhab 3.4.2 on Raspi 4, Landroid-Binding 09.04.23; Landroid items and sitemap was copied from nibi's example.

Mercur13 commented 1 year ago

I'm surprised if no one else should have this problem, my configuration is not exotic (now Openhab 3.4.4 out of the box on a Raspi 4, 16GB SD card, the sitemap was taken from Nibi's example....) Based on my layman's understanding, I suspect an overflow that is causing the system to crash. Unfortunately, the logs do not give any information about the cause. Who has an idea how to get to the bottom of this phenomenon.

sihui62 commented 1 year ago

I'm surprised if no one else should have this problem

Nope, sorry 😗

nibi79 commented 1 year ago

I also have no idea and I don't know how to help you, sorry.

Mercur13 commented 1 year ago

I once described my problem in the German Openhab forum and received the following message from the user/maintainer J-N-K:

[url=https://openhabforum.de/viewtopic.php?p=54850#p54850]Betreff: System-Crash nach Veränderung einer Sitemap-Einstellung[/url]

[quote=J-N-K post_id=54850 time=1685119838 user_id=3736] So ganz generell kann man sich natürlich fragen, warum man MQTT mit AWS implementiert (was letztlich zu diesem Crash führt), aber:

[code] @Override public void processMessage(AWSMessageI message) {

    updateStatus(ThingStatus.ONLINE);

    JsonElement jsonElement = JsonParser.parseString(message.getPayload());

    if (jsonElement.isJsonObject()) {
        processStatusMessage(jsonElement.getAsJsonObject());
    }
}

[/code]

ist jetzt keine besonders gute Idee. Laut [url=https://javadoc.io/doc/com.google.code.gson/gson/latest/com.google.gson/com/google/gson/JsonParser.html#parseString(]JavaDoc zu JsonParser.parseString[/url] muss man JSONParseException und JSONSyntaxException handlen, also eher so

[code] @Override public void processMessage(AWSMessageI message) { updateStatus(ThingStatus.ONLINE); try { JsonElement jsonElement = JsonParser.parseString(message.getPayload()); if (jsonElement.isJsonObject()) { processStatusMessage(jsonElement.getAsJsonObject()); } } catch (JSONParseException | JSONSyntaxException e) { logger.warn("Received invalid JSON content '{}': {}", message.getPayload(), e.getMessage()); } } [/code] [/quote]

@nibi79. Can You please take a look to that ? Because I am far away to understand this. Thx in advance.