No connection via Android app

Hi everyone,
I started to use openhab just recently and basically all works impressively fine so far.
Just the App doesn’t connect to my openhabian server via http://openhabianpi:8080 no matter what I try.
The app shows the message to make sure openhab is up and running and url is configured correctly but can’t reach the server. Access via browser on lan and wlan works perfectly.
I ran out of ideas now. Any suggestion what I maybe missed.
Many thanks, really appreciate the help.

2 Likes

If I am not completely wrong, the Android App uses the REST API to connect to openHAB2.
Make sure that you have that installed and try again.

You can check if it is already installed by accessing: http://openhabianpi:8080/doc/index.html
If you get nothing: Go to PaperUI -> Add-Ons -> Misc -> REST Documentation and install it

Disable demo mode, no config necessary, just start it and it connects automatically.

1 Like

Really?

Edit: in the beginning I did not have the REST docs installed and Android app worked fine …

I don’t know if you really need to have REST docs installed… (maybe this is just for a “UI” to REST and it’s not needed by the openHAB Android Client)

From here: GitHub - openhab/openhab-android: openHAB client for Android

Can you access your OH2 system from the Android phone by using the browser?
If you are on the same (W)LAN, try to use the IP Address of the openHABian system also.
openHAB URL: http://<ip>:8080

Thanks for your replies:

  • REST API is installed and reachable vía browser
  • Demo Mode unchecked
  • I reach the server via browser from the Android phone
  • I tried the IP address in the App too
    … nothing worked so far
    It feels like the App does not resolve the IP nor the alias once demo is unchecked. Same on my other mobile devices
    Any other ideas?
    Thanks indeed

Do you have the option to “Ignore SSL hostname” checked in the app-settings?

You don’t. The REST API is there whether or not the REST Docs are installed. The Docs are just that, documentation. Really cool interactive documentation but just documentation.

@jjhh, When you tap the hamburger menu (three horizontal lines icon in the upper right, at least on the Android app) do you see two Sitemaps listed? If so does selecting the other one give you your sitemap?

Do you have myopenhab.org/CloudConnector set up and does connecting through that work?

Do you see any errors in the logs when bringing up the apps on your mobile devices?

1 Like
  • the option to ignore SSL hostname is checked (any other specials I have to set in the settings?)
  • The sitemap menu just shows ‘Main Menu’ and ‘Home’ of the demo sitemap. The ‘Select default sitemap’ option only shows ‘demo’ and ‘_default’ but not my own sitemap.
  • I have not set up the cloud connector because I basically do not need remote access (yet). So I can’t say if this would work. I understand it is not needed for (w)lan access.
  • The logs do not show any references to the mobile devices when trying to access via apps …

fyi, for testing I just did a separate installation of the Windows version with a small sitemap and this can be correctly (!) accessed by the App on my Android phone.
So I figure it is some issue on the openhabianpi side. Can this help to narrow down the cause?

So… the App establishes a connection to the openHAB server but you can’t select your sitemap in the App…

Post your *.sitemap contents here to check them (mention the filename also)

Does this sitemap work from BasicUI?

I tested both the Windows and the openhabianpi installations with the simple sitemap below (default.sitemap).
The Android app works with the Windows server’s sitemap but not with the openhabianpi server’s sitemap.
Both work when accessed via browser from the Android device.

sitemap default label=“Home sitemap”
{
Text item=Date
Text item=Sunrise_Time
Text item=Sunset_Time
}

Is there a recommended way to re-install openhabian without losing too much of the openhab2 configuration already done?
thanks …

I don’t know about the rest of openhabian but you should be able to follow the backup and restore instructions for openHAB itself.

ok, eventually I will have to do it this way.
Maybe I also first try a separate second installation to see if the app would access that one correctly.
Thank you.

So … I reinstalled openhabian and restored my backup but again the app does not connect.
Is there any special point to observe which makes access via browser different from access via app?
Tks for any hint!

Did you try the app before restoring?
Maybe something in your config breaks it …

No: No connection via Android app - #3 by sihui

yes, sorry, forgot to mention that. Once the openhabian installation was finished and ‘Initial Setup Package Selection’ done (‘Expert’) I started trying the app, then again with below basic sitemap.
It worked via any browser (Desktop PC, mobile) but not via the app.

sitemap test label=“TEST TEST TEST sitemap”
{
}

The app never offers to select the ‘test’ sitemap, since it does not seem to connect to the IP at all.
Are the ‘demo’ and ‘_default’ sitemaps just built into the app or actually drawn from the server?
Is there any possibility to test the connection with on the REST API?
Is it possible the app is not allowed to connect to the 8080 port whereas browsers can? Where would I see/set this?

Sorry, can’t tell, I never had to debug the app because it always is just working :sunglasses: