Can't get app to connect

Trying to get the OpenHab app to connect to my sitemap. Sitemap says its offline when I check the URL, but the secret and UUID are right.

Ran in debug mode and this bit repeats when I try connecting the app.

I can see my sitemap name in the app, so something has connected/ worked, but the sitemap just doesn’t load, and the loading wheel in the top has a real spaz.

When I open the app, it says connecting to configured URL, and then it is a blank screen (with spazzy loading wheel).

Any thoughts?

Been looking through again. I’m not 100% sure what LAN IP subnet is for my config file. I have it set to my Pis local IP. is this right?

This could be bug.

The log is showing more than just sitemap errors. That top error “Failed to connect to database null” coupled with all the “unknown page id ‘null’” errors make me think there is something fundamentally misconfigured on OH and it has nothing to do with my.openhab.

What version of OH are you using and walk us through exactly what settings have been made and how. What bindings are installed?

Thanks for the reply.

I am using OpenHab 1.8.3.

I have a simple sitemap with 1 switch. All the binding that come in the ‘addons’ download are installed (now I might have gotten this wrong. They are all in the folder. I assume this means they are installed. I am a novice…)

I beleive I have the correct MyOpenHab addon (see image)

I have followed the information on this page: https://my.openhab.org/docs

Secret and UIDD are correct.

I have created a myopenhab.persist with the following in:

Strategies {
default = everyChange
}
Items {

  • : strategy = everyChange
    }

Could it be an error with the SSL? I am not really sure what to do about the SSL, but I see that there is a known problem with it.

It is strange. MyOpenHab seems to see my sitemaps, but can’t load them.

The errors you posted are not related to my.openhab in any way as far as I can tell.

Can you connect to the sitemap on your LAN using your server’s IP and Port directly without trying to go through my.openhab?

That is a lot of addons and I’m pretty positive you are not using them all. It is best to only keep those addons that you are actually using in the addons folder. Each one at a minimum consumes resources and throws errors in the logs (perhaps that is were the mongo error is coming from).

For now, focus on seeing if you can get to the sitemap on your LAN using the server’s IP and port 8080. To make it even easier, change the name of your .sitemap file to “default.sitemap” which will make it come up as the default when you do not supply one in the URL.

Also, try getting to it from the browser first. We will gradually work backwards from there to get it working on the app and then through my.openhab.

Thanks for the response.

I do have it working through the LAN on a browser- it has been working reliably for about a month now (and it still does). This is why I am apprehensive about deleting things! I know they aren’t all needed, but in terms of resources my Pi seems to be running fine.

From the docs, I was a bit confused about the following sentence: ‘There is a known problem with SSL when using my.openHAB bundle with openjdk, so please use Oracle jdk.’ Could it be something to do with this?

Also (if it helps) those errors only come up with I try connecting with the app. If I close the app, they disappear.

I’d still recommend deleting the unused bindings.

What have you put into the app for the settings?

openHAB URL should be

http://<ip of server on your LAN>:8080

openHAB Remote URL should be

https://my.openhab.org

Username and password should be the ones you use to log into my.openhab.org.

You must use Oracle Java 1.8.0_111 or later to run OH in order for my.openhab to work. However you would be seeing SSL errors in the logs from the my.openhab binding. Like I said, the errors you posted above have nothing to do with my.openhab so I don’t know how to help.

Either your app is connecting through my.openhab just fine or you are connecting to it on your LAN and bypassing my.openhab and there is something else wrong.

Removing all extraneous bindings and generating some clean logs will go a very long way towards identifying the problem.

I know it might make me sound stupid, but what is the best way to remove addons? I have had a look on the forums and can’t find any help.

Just delete the jar files. You didn’t install using apt-get and you are running on 1.8.3 so just delete the jar files out of the addons folder that you are not using.

Appreciate the advice, thanks.

I have deleted most of the addons now, and you are right, the log now no longer shows that error.Now it is showing the following:

My openHAB URL is

http://:8080

and remote URL is:

You are getting something from my.openhab in there. We need to see what it logs when you first start OH though.

Sorry for the long file, but I hope this is what you were after.

You can actually paste the logs into the forum. Just use code fences and they will be nicely formatted and shown with a scroll bar. It’s way easier to read that way.

That being said, there are no my.openhab logs in those screenshots.

Run the following command and post the first first group of statements after 19:37

grep -i myopenhab /opt/openhab/logs/openhab.log

NOTE: This is probably neither here nor there, but is there a reason you did not install using apt-get. If you are running on a platform that supports it we highly recommend installing that way rather than a manual install.

Sorry, I am still very new to this, and haven’t got copy and paste over VNC set up yet. I am looking into it now, but I am still quite slow with all of this.

That comand gave the following:

It just repeats that (very fast) so hopefully it is easier to see than my many screen prints all bundled together!

Oh, and I didn’t use apt-get because the guide I was following didn’t use it. How can you tell I didn’t use it? What would be different?

OK, what I really need to see are the log statements around 19:37 when OH first started.

All these debug statements tell me is the binding is doing something. Not terribly useful.

Use:

grep -i myopenhab /opt/openhab/logs/openhab.log | less

Press <space> to page down and b to page up, go down to those statements around 19:37 when the binding first loads and connects.

Sigh. There are SO many old, out of date, incomplete, and incorrect “guides” out there it is incredibly frustrating.

This is the guide you should follow for OH 1.x:

This is the guide you should follow for OH 2.0:

http://docs.openhab.org/installation/rasppi.html

or

http://docs.openhab.org/installation/linux.html

Because everything is in /opt/openhab.

With an apt-get install everything gets put in the “proper” place according to Debian standards. That means the binaries go in /usr/share/openhab, configs go to /etc/openhab, logs to /var/log/openhab, data goes to /var/lib/openhab, etc. In addition to putting everything in the proper location, it also creates an openhab user, configures it to run as a service, and makes sure all the file permissions are correct.

Over all, those who install using apt-get experience fewer problems over all getting started.

Since you are pretty much doing everything on the command line anyway, consider using Putty and ssh to the machine. This will give you a shell on the machine and, more importantly, copy and paste capability. By default everything you highlight with the mouse in Putty gets copied to the clipboard and anything on the clipboard gets pasted into Putty when you press the right mouse button. I’m sure browsing on your main machine and copying commands will be much easier than trying to browse on the Pi through VNC.

Most people actually end up running their Pis without any windowing system at all.

Finally, in addition to the apt-get installation method, if you are interested in OH 2 you might consider looking into openHABian which with install and configure the entire operating system configured for openHAB 2.

Ah right I see. I really struggled to find useful guides for all of this. In the end I used several and had to fill in the gaps myself. This may well have been the issue. Shame.

I will certainly look into openHABian, sounds very useful for people like me!

Thanks for the help, it is really aprpeciated. I’ll get a move on with openHABian soon, but I’m sure I’ll be back with more problems before long (hopefully not the same one though!)

Thanks, Craig