Send error in event-based data to server


I use the Openhab Beta on my mobile phone to access my Raspi with Openhab 2.10. Local address and remote access are set up and working. For presence detection, I use the event-based sending of the WLAN name to the server through the app. It actually always works when entering the WiFi. However, when leaving the WiFi it only works in 3 out of 10 cases. The error message appears in the app:
1 item could not be updated.
Update of item xxx
failed http code 500

What is wrong?

O am quite sure openHAB Beta is designed for openHAB 3.x, not the ancient openHAB 3.10. There have been major breaking architectural changes since 2.10.

So, as the WiFi goes down it is trying to send a message … via WiFi?

I use the wifi name change for presence detection. if at home wifi then i’m at home. when UNDEF is on the way

If I had to guess, and to elaborate on what rossko57 was trying to get across with his question, at the time that the app sees you have left the WiFi network it is in the process of switching over from WiFi to cellular data and not yet connected to any network. Consequently the app can’t reach either your OH server nor your (or how ever you have remote access configured).

I imagine this could be fixed with just a slight delay or a retry but I bet either will require changes to the app.

But, this is all just based on the behavior. In point of fact, if the 500 error code is accurate, everything I just said above is bunk. You wouldn’t get an “Internal server error” if the app can’t connect. Though there could be a timing issue with trying to post an update before the app is done authenticating or the like.

For the most part the REST API is unchanged so the app works just fine. Most of the updates to the app were made to support MainUI.

Actually there’re no changes in the REST API that is used by the app from openHAB 2 to 3. When new features are implemented there, the REST API version is bumped so the app can work with both versions.

The app always retries such background item updates, in case of the wifi name up to 10 times.

The log of the app would help here, but if I had to guess I’d say it’s just a timeout. The http library returns 500 is this case.

1 Like

People hitting the REST API authentication on OH3 beg to differ.

If I manually turn off the WiFi at home and turn it on again, it always works. Switches it automatically because I am out of range often does not work. I’ll post the log next time.

The Name of the Wifi is send to Item Andre_HandyWlan

Could you post the log as txt file

or like this (code block)?