Just got a new phone transferred all my apps over to new phone and it would not connect remotely or via local to 2.4 versions. Tried multiple combinations. Wife’s android would connect however. Eventually went as far as upgrading to openhab 3 however now everything is broke.
I was able to get the sitemap migrated and most all of my items and things from 2.4 to 3. I can get the app to load the local site but can not seem to get the remote connection to work.
Can some please make a walk through of how to setup the openhab 3 for the remote connection on the app to work. I see a online status when I log into the myopenhab site. however I get a Authentication failed (http 401 error). This was easy to setup in the 2.4 versions can someone spend a few days and fix this to be easy. This shouldn’t have to be this frustrating to get a remote cloud connection to work. Seems like it should be easy to setup some kind of 2 factor authentication that would allow the apt to connect with the particular details for the users install.
I’ve spent 4 days trying to figure out why this wont work. And have not made headway. I’m tempted to roll back to a 2.4 version and fight with that to see if I can at least get it working again.
The openHAB Cloud Server works pretty much exactly the same for OH 2.x and 3.x so what ever problem you experienced before is probably the root of any of your problems now. Using the cloud server and cloud connector is exactly as easy as it was in OH 2 as far as I know. You put in the user name and password for the myopenhab.org account under the remote settings in the app and you are done. There are no additional steps if you want to use BasicUI. There are some extra steps to make the Andorid App use MainUI instead of BasicUI by default but you are not looking for that.
There is an alternative way to authenticate with OH 3 but you would have had to change some settings to enable that. In MainUI follow openHAB API tokens | openHAB to generate an API token. You can then use that as the username without a password for local connections. But you are having problems with the remote connection and the API token doesn’t work with the cloud connector, just connecting to OH directly.
The only think I can imagine might cause a problem settings wise would be if you disabled the Implicit User Role in MainUI under Settings → API Security → Advanced. That would lock down the OH REST API to only work with authenticated users which would break BasicUI. But the default is to have that enabled and BasicUI should work when it’s enabled.
So ultimately all I could guess is that there is a problem with your specific phone (since it appears to work on your wife’s phone) and what ever that problem is is unrelated to the version of OH running.
For security reasons the user name and password for local and remote connections isn’t included in the backup and therefore won’t be migrated to the new phone.
Please make sure you have the exact same credentials filled in than before. This should resolve http error 401.
I have tried the same log in nothing works going to wipe the pi and start fresh. Maybe 10th times the one. Idk just seems like something is off with the app or openhab3. Just kind of frustrating that it’s working fine on older phone and then new phone and all of a sudden lots of issues. I’ll have to go through all the setup docs again to setup a full install of the Pi. Wish it was a little more automated to install all the default settings and get everything up and running a little more simply. I also wish they had the rasbian install pre-loaded with the openhab system. I find it easier to work with having the pi OS and then VPN into the machine.
If it works fine with the old phone but not the new phone, I’d have zero expectation that blowing away the entire OH install is going to make any difference in the end. The problem is going to be something unique about that new phone. That means either there is:
a bug in the app
a bug in the Cloud Server
a bug in the cloud Connector add-on.
Those are where you need to focus your attentions. The actual OH server is working as evidenced by the fact that everything works fine on the old phone.
when I turn on extended error log this is what I get trying to log into app on mobile data only (No Wifi)
Authentication failed. Please check the configured username and password
respectively the provided ssl client certificate (http code 401).
Hope this can point you guys in what is going on to help get this sorted out. Sorry being frustrated just stressful changing phones and trying to get everything working on something new from something you’ve had for 5 years and know.
Okay so after scrolling a bunch of of topics on the subject I found the issue. In the user name email *** DO NOT USE AUTO-COMPLETE*** Their was a extra space on the end of my email. Openhab couldn’t authenticate the email with the additional space. If you are having issues logging in please check that you don’t have a extra space on your email.
I recommend filing an issue on the Android app. The value entered there can automatically trim trailing white space. I don’t think any authentication system allows trailing white space in a user name and it’s certainly not allowed in an email address. So I think this problem can be avoided in the app itself.
I didn’t find a source saying this is true for HTTP basic authentication and therefore the input isn’t trimmed. However it shows a warning directly under text field: “The last character is a whitespace, which is probably unwanted”
The syntax for a username is defined as follows, using the Augmented
Backus-Naur Form (ABNF) [RFC5234].
username = userpart *(1*SP userpart)
userpart = 1*(idbyte)
; an "idbyte" is a byte used to represent a
; UTF-8 encoded Unicode code point that can be
; contained in a string that conforms to the
; PRECIS IdentifierClass
I interpret that to mean userpart with the option to follow it by zero or more optional pairs of one space followed by one userpart. Though I suppose a space could be an idbyte and included in the userpart but I don’t see how the grammar could work in that case.
RFC7617, the RCF for BasicAuth refers to RFC7613 for defining the characters allowed in the user-id with the addition of : which is also not allowed in user-id for BasicAuth.
But as with lots of the RFCs, there is room for interpretation. But I recently had to go through these RFCs for work so they are fresh in my mind.