Unable to connect openHab (openHabian) from android app

Hi,

I installed openHabian on rasperry Pi 4 and I can use web-browser (chrome)
to access openHAB via port 8080 or 8443 (after accepting self-signed certs).
But I have problems to connect from openHAB Android App (normal or Beta).

Both apps do not find this installation (auto search). Network uses Wifi router Fritzbox (AVM).
App does also not find the instance when specifying URL.

For local server settings I used:
URL: http://192.168.111.20:8080/
user: admin
password: admin
Start page: openHAB 3 UI
(admin is the administrator account, created during installation via GUI)

The app still does not “find” the installation.

I tried to use URL: https://192.168.111.20:8443/
With normal app (not Beta), I got the https certs and had to confirm it.

tcpdump shows some requests and answers, but app does not display anything. just telling that it can not find a server.

GET /rest/inbox HTTP/1.1
Host: 192.168.111.20:8080
Connection: keep-alive
Accept: application/json
DNT: 1
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36
Authorization: Bearer …
Referer: http://192.168.111.20:8080/settings/things/
Accept-Encoding: gzip, deflate
Accept-Language: en-GB,en;q=0.9,en-US;q=0.8,de;q=0.7,lb;q=0.6
Cookie: X-OPENHAB-SESSIONID=73174562-f6df-4bc2-bba4-dad630231431

Answer:

HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 18 Aug 2021 17:21:12 GMT
Transfer-Encoding: chunked
Server: Jetty(9.4.40.v20210413)

106
[{“bridgeUID”:“bluetooth:bluez:hci0”,“flag”:“NEW”,“label”:“Generic Connectable Bluetooth Device”,“properties”:{“address”:“00:A0:50:62:73:15”},“representationProperty”:“address”,“thingUID”:“bluetooth:generic:hci0:00a050627315”,“thingTypeUID”:“bluetooth:generic”}][!http]

There are other comments in Google Play-Store where people have problems.
Any Idea?
/stephan

Can you change the start page to Sitemaps, enable debug logging (next to last item in settings), restart the app and then make a screenshot of it?

Hi,

when I tried today, I got an connection. The instance was found (automatically) and I could see the empty sitemap and also the GUI. I tried to delete the detected server and replace it with http (port 8080). connection
with that did not work. The error message was about certificates (401).
Which is strange, because http doesn’t have such. (later see below, manually setup http-8080 worked)

I then reverted to https (8443) and connection was possbile.
deleting username and password, did not change this.

So I deleted on mobile the complete app-cache and app-data. application was killed.
I started it again and got the pages showing the “features” which I skipped.
The application then tried to find the instance, but did not (several times).
I got the message that I should go to settings.

I then enabled the “Extended error messages” option, closed and killed the app and restart it.
→ no change.
I then switched the startpage to GUI, tried, and back to Sitemap, tried. Always closing the app and kill it.
→ no change. instance was not found.
The log (last menu entry of settings) only displays same messages about “activity”… nothing about connection/certs/ports.

strange again Now after writing this text here (10minutes), I wanted to set server manually. but the app tried to connect automatically and got https certificate message displayed. I accepted and got https connection working.

So I killed the app and deleted cache and app-data again. after starting the app runs the scan an found the instance immediately.
(note that before that, I tried it for 10min and it did not find anything, like yesterday the whole day).

Next try: deinstall the app and reinstall it from appstore:
first connection try failed. I enabled the “extended error message”) and then I got the certificate screen twice. now connection is working again.

The raspberry with openHAB was running since yesterday untouched (no restart,no power drop, no configuration changes)

My conclusion is, that detection (Upnp) did not work all the time. also somehow port 8080 (http) showed certificate error (enabled by extended error message option).
After playing and testing I have a connection to my instance and this works currently.

401 isn’t about the server certificate. It’s “unauthenticated”, which could be fixed by adding a client certificate.

Authentication failed. Please check the configured username and password respectively the provided SSL client certificate (HTTP code %d).

Well the auto discovery is just for convenience on the first app start. It searches for the TLS port of an openHAB server. If discovery fails, just enter the IP or hostname manually.
Once this is done, you don’t have to touch this preference ever again.

That what I have tried several times. Because the detection did not find the instances yesterday at all, I first tried to setup server in settings for http and port 8080. This did’nt work. So I tried it with https and prot 8443 did not work yesterday too, but today only sometimes.
Website on raspberry was working all the time (also from mobile).
For users that try to install and connect, it is not so easy.
By the way, it would be good, if the app always has enabled “extended error message”, as this give the user (which does not know this option yet), more insights. The message is not very big and does not disturb, but it would help a lot.
Thanks for your help