Setup your own openhab-cloud (myopenhab) server/instance

According to the server headers nginx/1.10.3 is running on myopenhab.org.
The header also states that Ubuntu is running on it.
So according to the nginx version my conclusion would be that Ubuntu 16.04.X is running on that server.
Standard support ends in April 2021.

The only changes I see on git belong to updates related to OH3 although there are several users reporting back the same issues like those you have.

1 Like

Hi and Merry post- X-mas to everyone,

as already reported in reply #201, due to SD-card crash I lost my private cloud instance. After days of digging through this forum and Github, I have finally (!) managed to get the cloud back online. The time I invested to reinstall openhab-cloud was almost unbearable and if I hadnā€™t managed to install the cloud a couple of years ago, I would have given up by now and switched to different automation software.
HOWEVER, I did not. So, in case someone else runs into the same problem depicted in this post (and its replies), hereā€™s my guide to saving precious live time :wink: .

Preface: Ryanā€™s installation guide is still pretty comprehensive but needs a couple of adaptions, almost three years after the intial post. The steps below have been tested on following platform (and most likely will work on different setups, as well):

OH Version: 2.4
HW: RPi Zero + ENC28J60
OS : dietpi v6.33.3 & nginx 1.14.2

  1. Make yourself familiar with Ryanā€™s post (this one).

  2. Step #7: Make sure, that you really DO install build-essential and python. Some users (including me) have reported that the installation process npm install broke, because the precompiled package bcrypt@1.0.2 was unavailable! According to bcrypt@github, this is not a problem: if a precompiled version of a package is unavailable for a specific platform, npm install falls back to compile from source automagically.

  3. Step #7: do not pull the master trunk of openhab-cloud at GitHub - I wasnā€™t able to get that one running. Instead, pull tag 1.0.10:
    git clone --depth 1 --branch 1.0.10 https://github.com/openhab/openhab-cloud.git

  4. Step #7: Make sure that you install NodeJS, no other than v7.10.1, the install process will fail otherwise. If there is no setup-script for your architecture, donā€™t worry! You can follow the manual install instructions on GitHub - no problem.

  5. Step #7: When I first tried to run the cloud with node app.js, the console log reported ā€œunmet dependenciesā€. After a while of googling I found this on GitHub. If the cloud does not start after the first npm install, try at least
    npm install bcryptjs@^2.4.3 qunitjs@^2.0.0
    npm install node-time
    which will post-install 3 more packages.

  6. Reply #28 suggests using Unitechā€™s Process Manager PM2 to have app.js run as a system service. As openhab-cloud is tied to NodeJS v7.10.1, cloning the github repository from the latest branch is again no option. I found that PM2 versions below 4.x.x actually work with NodeJS v7.10.1
    npm install pm2@3.5.0 -g (as root) and then
    pm2 startup
    Consult Readme.MD for details on PM2!

Hope this helps!
Good luck & Best regards,
-bernie

3 Likes

this does not include the OH3 related changes.

Very true and thank you for the note! I still run OH 2.4 !
I will update my post, accordingly!

Has anyone launched a cloud on OH3?
Everything worked fine for me on OH2.5, but on OH3 I canā€™t go further than the HOME page.
A similar problem and its solution are described here https://github.com/openhab/openhab-cloud/issues/313, but nothing works for me.
Adding <ā€œproxyHostā€: home.openhab.mydomain.co> to config.json does not solve the problem. Apparently you need to implement all the actions described in the penultimate post, but here my knowledge is not enough.

Hello,

i tried to install the cloud server with the steps described at the first post.

At the point i have to start ā€œapp.jsā€ i get the following error:

sudo node app.js
{"errno":-2,"syscall":"open","code":"ENOENT","path":"certs/aps/AuthKey.p8"}
(node:43041) Warning: Accessing non-existent property 'MongoError' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
node_redis: Warning: Redis server does not require a password, but a password was supplied.

I am trying to install it on a ā€œfreshā€ vserver (ubuntu 20.04).

I found a similar issue. This seems to be due to the APN config. I do not use it, so I have a dummy config for it (oh-cloud wonā€™t seem to start without it), but the file referred to in the signingKey parameter still neds to exist even if empty.

I have this in my config:

    "apn" : {
       [... rest of apm config here, even if "dummy" ...]
      "signingKey": "aps.p8"
    },

And then just created an empty ā€œaps.p8ā€ file in the same directory as the config.js.

Thank you!
I created the path /certs/aps/AuthKey.p8 with an empty file.

Also i removed the password line from config.json for redis.

After these two changed i only get one error message:

(node:43041) Warning: Accessing non-existent property 'MongoError' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)

Not using ubuntu myself, so not sure I can help on this one. But first of all, it is it working? (as the message suggests a warning, not an error).

If not working, whatā€™s the output with --trace-warnings, and what version of mongodb are you using?

No, unfortunately it doesnā€™t work:

curl http://localhost:3000
curl: (7) Failed to connect to localhost port 3000: Connection refused

After start of app.js i get:

sudo node app.js
{}

Iā€™m also having the same issues. When I moved from S2300 to S2306 my cloud connector started to have some issues. I attempted to update and now Iā€™m down with the same errors.

EDIT: Iā€™ve opened service not starting - apn related? Ā· Issue #342 Ā· openhab/openhab-cloud Ā· GitHub to track.

I just merged Disables APNS if no APN or APN signingKey config is present by digitaldan Ā· Pull Request #343 Ā· openhab/openhab-cloud Ā· GitHub which will disable loading APNS certs if there is no apn or apn.signingKey in your config, the latest docker container is building now. Make sure to remove the apn section from your config if not using appleā€™s push service.

I have removed the apn section and the node just crashes. Doesnā€™t write any logs either.

# node app.js
(node:12469) Warning: Accessing non-existent property 'MongoError' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
#

I just pulled down the latest published docker image and ran against my config without the APN section and it works for me. Can you verify your config file is properly formed after removing the APN section? Thats the only thing i can think of that might cause a quick crash.

Iā€™ll recheck, but all I did was delete the lines in full. Iā€™m also not running docker, im running native on the box as this was just an upgrade for me.

My config is:

"express":{
  "key" : "some express key"
},
"gcm" : {

Which I believe should be fine.

Confirmed Iā€™m on the correct commit:

# git log
commit b97897ad2a3918a826e45674fd8ad53ceb65a1db (HEAD -> main, origin/main, origin/HEAD)
Author: Dan Cunningham <dan@digitaldan.com>
Date:   Sat Apr 3 14:26:08 2021 -0700

I attempted to use the docker image, thatā€™s also not working. Iā€™m going to try to build a docker image, but not sure that will do anything.

Docker is no going to help, iā€™m not sure what else is breaking for you. Did you do a npm install before you ran it?

Go figure this one out, it works when i build a docker image locally. The pulled image doesnā€™t work. Native doesnā€™t work. I made no changes to the configs after I did docker pull versus docker build.

What docker image are you using, iā€™m assuming the latest tag? (i have not tagged a version number yet) Also did you do a npm install when building locally? Thats the only thing i can think of that would be different from building and running with docker vs running node alone.

Process was:

Git clone new folder
Make config changes
Npm install
Attempt node app.js (fail)
Change .env in docker folder
Docker pull
Attempt docker (fail)
Docker build
Attempt docker (successful)