OpenHab Cloud Installation

I resolved the issue by manually creating username and password as below but now getting some other error.

$ mongo

MongoDB shell version: 2.6.10
connecting to: test
> show dbs;
admin    0.078GB
local    0.078GB
openhab  (empty)
> use openhab
switched to db openhab
> var a = { user:"openhab", pwd:"password", roles:["readWrite"]}
> db.createUser(a)
Successfully added user: { "user" : "openhab", "roles" : [ "readWrite" ] }

###$ sudo node app.js
…
…
2017-01-05T09:27:37.424Z - info: openHAB-cloud: Successfully connected to mongodb
2017-01-05T09:27:37.624Z - error: uncaughtException: undefined is not a function date=Thu Jan 05 2017 09:27:37 GMT+0000 (UTC), pid=27597, uid=0, gid=0, cwd=/home/ubuntu/openhab-cloud, execPath=/usr/local/bin/node, version=v0.10.48, argv=[node, /home/ubuntu/openhab-cloud/app.js], rss=113377280, heapTotal=95370792, heapUsed=63958880, loadavg=[0.080078125, 0.0166015625, 0.00537109375], uptime=867965.058384011, trace=[column=19, file=/home/ubuntu/openhab-cloud/node_modules/node-xmpp/lib/xmpp/stream_parser.js, function=new StreamParser, line=17, method=null, native=false, column=19, file=/home/ubuntu/openhab-cloud/node_modules/node-xmpp/lib/xmpp/connection.js, function=Connection.startParser, line=137, method=startParser, native=false, column=37, file=/home/ubuntu/openhab-cloud/node_modules/node-xmpp/lib/xmpp/session.js, function=, line=64, method=null, native=false, column=16, file=events.js, function=CleartextStream.g, line=180, method=g, native=false, column=17, file=events.js, function=CleartextStream.emit, line=92, method=emit, native=false, column=17, file=tls.js, function=, line=1452, method=null, native=false, column=17, file=events.js, function=SecurePair.emit, line=92, method=emit, native=false, column=10, file=tls.js, function=SecurePair.maybeInitFinished, line=1029, method=maybeInitFinished, native=false, column=13, file=tls.js, function=CleartextStream.read [as _read], line=521, method=read [as _read], native=false, column=10, file=_stream_readable.js, function=CleartextStream.Readable.read, line=341, method=Readable.read, native=false, column=25, file=tls.js, function=EncryptedStream.write [as _write], line=418, method=write [as _write], native=false, column=10, file=_stream_writable.js, function=doWrite, line=226, method=null, native=false, column=5, file=_stream_writable.js, function=writeOrBuffer, line=216, method=null, native=false, column=11, file=_stream_writable.js, function=EncryptedStream.Writable.write, line=183, method=Writable.write, native=false, column=24, file=_stream_readable.js, function=write, line=602, method=null, native=false, column=7, file=_stream_readable.js, function=flow, line=611, method=null, native=false, column=5, file=_stream_readable.js, function=Socket.pipeOnReadable, line=643, method=pipeOnReadable, native=false, column=17, file=events.js, function=Socket.emit, line=92, method=emit, native=false], stack=[TypeError: undefined is not a function, at new StreamParser (/home/ubuntu/openhab-cloud/node_modules/node-xmpp/lib/xmpp/stream_parser.js:17:19), at Connection.startParser (/home/ubuntu/openhab-cloud/node_modules/node-xmpp/lib/xmpp/connection.js:137:19), at CleartextStream. (/home/ubuntu/openhab-cloud/node_modules/node-xmpp/lib/xmpp/session.js:64:37), at CleartextStream.g (events.js:180:16), at CleartextStream.emit (events.js:92:17), at SecurePair. (tls.js:1452:17), at SecurePair.emit (events.js:92:17), at SecurePair.maybeInitFinished (tls.js:1029:10), at CleartextStream.read [as _read] (tls.js:521:13), at CleartextStream.Readable.read (_stream_readable.js:341:10), at EncryptedStream.write [as _write] (tls.js:418:25), at doWrite (_stream_writable.js:226:10), at writeOrBuffer (_stream_writable.js:216:5), at EncryptedStream.Writable.write (_stream_writable.js:183:11), at write (_stream_readable.js:602:24), at flow (_stream_readable.js:611:7), at Socket.pipeOnReadable (_stream_readable.js:643:5), at Socket.emit (events.js:92:17)]
2017-01-05T09:27:37.625Z - error:

1 Like

i am also in the same state, i receive the “undefined is not a function” however the app seems working, i registered raspi openhab to it and i can see notifications and items
however when i try the remote access it redirects me to myopenhab.org

would be great if there is any little bit detailed steps

Great to hear that it is working and Thank you. Please update the thread as and when you come across issues and working solution, otherwise I need to report them here :slight_smile:

Hi,

@Kiran_Patil
if you have installed mongo and all according the quickstart you should be good to start.
the steps should be to rename the config-production.json to config.json. Please make sure to adjust the standard config values to your needs!
If you have followed the quickstart you shouldnt create users in mongo. This can be done by the UI.
For the other issue, I made a PR at github.

You can ignore the “is not a function”, since the app will work. Going to fix that message.

@Basem_AlSaeed: Yes, you probably should change the URL in the OH2 cloud connector under configurations pane in paperui. Did you point your OH2 instance to your newly oh cloud server URL?
I think you just left the default URL, which has the URL to myopenhab.org

Let me know if that worked for you guys.
BR Mehmet

@tominagaf did it work? Csn you post me here the logs for adjusted config-production.json?

hello @MARZIMA, thanks for your support, apparently my cloud connector is configured with the right URL, this is why i can see my items status there and see my openhab online, only when i click to access my openhab it redirects me to https://home.myopenhab.org/start/index please check the attached screenshot, i just hided my personal email
thanks again for your help :slight_smile:

looks good! Yes that shouldnt be like that. Will open an issue at github. There it should redirect to “your cloud URL” to access the dashboard.

1 Like

Hello @MARZIMA thank you again. I did a fresh install and followed the quickstart.

I changed config-production to config.json and changed only baseurl with my server IP address.

I’m getting this error:

2017-01-07T23:03:48.204Z - error: openHAB-cloud: Error while connecting from openHAB-cloud to mongodb: MongoError: auth fails
2017-01-07T23:03:48.204Z - error: openHAB-cloud: Stopping openHAB-cloud due to error with mongodb

I tried this with Ubuntu 14.04 both 32 bits and 64 bits but no success.

****EDIT
when I run “mongo” I got this:
Server has startup warnings:
Sat Jan 7 17:48:36.213 [initandlisten] ** WARNING: You are running in OpenVZ. This is known to be broken!!!

**EDIT
It is running now, I need to use community version of Mongo BD because the issue above.

I access my server using its IP address.
How should I configure OH Could Conector Base URL for the openHAB Cloud server ?

Should I put the IP and port or just IP address:
Eg.
201.200.210.201:443

1 Like

Thanks for sharing the solution. I installed mongodb community edition with this link http://www.techrepublic.com/article/how-to-install-mongodb-community-edition-on-ubuntu-linux/, by removing the old version. Now I did not create user and password in mongodb and it runs with out auth failure.

What port cloud connector uses to connect with OH Cloud? Is it necessary manually add the port in the connector url?

My OH Cloud is running and I pointed my local instace to Cloud but it shows offline.

I added port as well to connector url as, http://xx.x54.x.2xx:3000 and it shows online for me.

I think we need to restart openhab server once.

one more thing, did you add openHAB UUID and Secret ?

Yes thank you, it works now. The port 3000 was missing in url.

Now I’m trying to figure out how to remote access my local instance, since the link is redirecting to myopenhab.org. Is there a manual URL we can use?

EDIT******
Just append /basicui/app to remote access while we for for fix

http://XXX.XXX.XXX.XXX:3000/basicui/app

Also, I would like to know how to connect to OH Cloud as Admin to see stats.

To get habpanel as remote access,

http://xx.xx4.x.2xx:3000/habpanel/index.html#/

@tominagaf yes port 3000. Did it work for you so far?

Yes, it works. Now I Wonder how to make myself member of admin group.

now all of a sudden my openhab refuses to connect to my instance on cloud, i receive the below in the log

03:01:37.014 [DEBUG] [io.socket.engineio.client.Socket ] - socket error io.socket.engineio.client.EngineIOException: xhr poll error

any suggestions ? :slight_smile:

Like Kiran_Patil I am also not able to start Openhab-cloud because of mongodb: MongoError: auth failed but mine seems more serious. I don’t have the openhab schema at all. Here is my mongodb session:

bob@linux05:~/openhab-cloud$ mongo
MongoDB shell version: 2.6.10
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type “help”.
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
show dbs;
admin (empty)
local 0.078GB
exit

Is there a way to rerun just the mongo part of the install or do you have other suggestions?

Thanks,

@BobRak,

is this still a problem?
Without the openhab db it wont start. So you need to switch (if installed properly) to it by “use openhab”

Let me know if you still got problems…

BR mhmet