openhab / openhab-qnap-qpkg

openHAB Packages for QNAP NAS systems
Eclipse Public License 2.0
77 stars 21 forks source link

openHAB Cloud service #12

Open Stefan39135 opened 7 years ago

Stefan39135 commented 7 years ago

thank you for the new qpkg!

everything works fine, but the openHAB Cloud service is not connecting, is this working on your installation? on myopenhab.orgthe the service Shows only offline

on the main page it Shows "You are using openHAB 1.x. To remotely access your openHAB's web Interface" i made a new installtion with your qpaq on my qnap

thopiekar commented 7 years ago

This is because the JRE by QNAP is too old. The openHAB Cloud service is using a fairly new SSL certificate and therefore the connection can't be verified. But there is a solution for this, which is not documented so far, but used over here for a long time.

  1. Open a console connection via SSH to your NAS
  2. Go to /share/CACHE[...]/.qpkg/openHAB/
  3. Run openHAB.sh stop
  4. Wait for approx 30-60s
  5. Run downloadJavaArm32 for example for a QNAP TS-228, which I have. For more see https://github.com/openhab/openhab-qnap-qpkg/blob/master/shared/openHAB.sh#L263 .
  6. Follow the instructions on the console and agree the Oracle Java license.
  7. After a successful installation, run openHAB.sh start to start openHAB again with your recently downloaded JRE.
  8. (Optionally) If you don't run any other application on your NAS with Java, then you can remove or disable the JRE installation from the App Center in your QTS.

Regards

Stefan39135 commented 7 years ago

Thank you for your help, the JRE is now updates, but it dosn't work - myopenhab only showes offline

in the log i found one error, could this be the Problem

cannot verify edelivery.oracle.com's certificate, issued by ‘/C=US/O=GeoTrust Inc./CN=GeoTrust SSL CA - G3’: Unable to locally verify the issuer's authority.

her is the full log.

Please visit http://www.oracle.com/technetwork/java/javase/terms/license/index.html and read the licence carefully. While downloading and using Oracle Java here, you agree the licence automatically. Continue downloading Oracle Java (y/n)? y Let's continue downloading Oracle Java... --2017-01-08 15:28:37-- http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-arm32-vfp-hflt.tar.gz Resolving download.oracle.com (download.oracle.com)... 104.121.150.19, 104.121.150.35 Connecting to download.oracle.com (download.oracle.com)|104.121.150.19|:80... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-arm32-vfp-hflt.tar.gz [following] --2017-01-08 15:28:37-- https://edelivery.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-arm32-vfp-hflt.tar.gz Resolving edelivery.oracle.com (edelivery.oracle.com)... 104.121.178.9, 2a02:26f0:12a:186::2d3e, 2a02:26f0:12a:192::2d3e Connecting to edelivery.oracle.com (edelivery.oracle.com)|104.121.178.9|:443... connected. WARNING: cannot verify edelivery.oracle.com's certificate, issued by ‘/C=US/O=GeoTrust Inc./CN=GeoTrust SSL CA - G3’: Unable to locally verify the issuer's authority. HTTP request sent, awaiting response... 302 Moved Temporarily Location: http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-arm32-vfp-hflt.tar.gz?AuthParam=1483885826_fd7200351450ed8298cb750c432f002d [following] --2017-01-08 15:28:38-- http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-arm32-vfp-hflt.tar.gz?AuthParam=1483885826_fd7200351450ed8298cb750c432f002d Connecting to download.oracle.com (download.oracle.com)|104.121.150.19|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 81562420 (78M) [application/x-gzip] Saving to: ‘/share/MD0_DATA/.qpkg/openHAB/jdk.tar.gz’

/share/MD0_DATA/.qpkg/openHAB 100%[================================================>] 77.78M 5.60MB/s in 15s

2017-01-08 15:28:53 (5.30 MB/s) - ‘/share/MD0_DATA/.qpkg/openHAB/jdk.tar.gz’ saved [81562420/81562420]

Download was fine! jdk1.8.0_111/COPYRIGHT jdk1.8.0_111/LICENSE . . .

jdk1.8.0_111/jre/plugin/desktop/sun_java.png jdk1.8.0_111/jre/plugin/desktop/sun_java.desktop jdk1.8.0_111/jre/README jdk1.8.0_111/jre/COPYRIGHT [/share/MD0_DATA/.qpkg/openHAB] # ./openHAB.sh start JAVA_HOME is: /share/MD0_DATA/.qpkg/openHAB/java/jre [/share/MD0_DATA/.qpkg/openHAB] #

Stefan39135 commented 7 years ago

after a qnap reboot ist works , thank you for your help Stefan

ghost commented 7 years ago

Hello, I have also the problem with java. I have installed this previously. Http://www.qnapclub.eu/provider.php/qpkg_dwl/99372/QJDK8_1.8.111_x86.qpkg. But openhab does not start. With java directly from qnap it goes. But then the cloud connection does not work, because the java version is too old. Can someone helps me?

YannisPap commented 7 years ago

@markusvitz just follow the steps @thopiekar mentions above:

  1. Open a console connection via SSH to your NAS
  2. Go to /share/CACHE[...]/.qpkg/openHAB/
  3. Run openHAB.sh stop
  4. Wait for approx 30-60s
  5. Run downloadJavaArm32 for example for a QNAP TS-228, which I have. For more see https://github.com/openhab/openhab-qnap-qpkg/blob/master/shared/openHAB.sh#L263 .
  6. Follow the instructions on the console and agree the Oracle Java license.
  7. After a successful installation, run openHAB.sh start to start openHAB again with your recently downloaded JRE.
    (Optionally) If you don't run any other application on your NAS with Java, then you can remove or disable the JRE installation from the App Center in your QTS.

In my case the commands were a little different:

  1. ./openHAB.sh stop
  2. ./openHAB.sh downloadJavaX64 (for X64 architecture)
  3. ./openHAB.sh stop

you can run ./openHAB.sh without any arguments to see the available.

... but it didn't work for me.

badplay commented 7 years ago

i want to try it but when i use putty to login via ssh to nas i dont know which the correct path ist Go to /share/CACHE[...]/.qpkg/openHAB/

badplay commented 7 years ago

i got it Go to cd /share/CACHEDEV1_DATA/.qpkg/openHAB/ ./openHAB.sh stop java is installed at ..... then i ./openHAB.sh downloadJavaX64 becorse i have a 253 pro intel x64 tehn i use ./openHAB.sh stop and then ./openHAB.sh start

but at myopenhab it shows offline. do i need to set up ports for openhab2 ???

peelos commented 7 years ago

Did also try to get this working but https://myopenhab.org/ shows not online

Running Java(TM) SE Runtime Environment (build 1.8.0_101-b13)

I noticed that there seems to be two UUID's

first: /share/CACHEDEV1_DATA/.qpkg/OpenHab/webapps/static second: /share/CACHEDEV1_DATA/.qpkg/openHAB/distribution/userdata

which differ in value

I tried using both of these UUID's together with the secret here: /share/CACHEDEV1_DATA/.qpkg/openHAB/distribution/userdata/openhabcloud

Neither working.

Could this be perhaps an issue not allowing the service to connect?

EDIT: fixed myself (using UUID from /share/CACHEDEV1_DATA/.qpkg/openHAB/distribution/userdata) by upgrading JCE from here http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html

followed instructions here http://suhothayan.blogspot.ch/2012/05/how-to-install-java-cryptography.html

overwrote in both JRE and JDK security settings, restarted Java and opehab and now connected.

Humphaz commented 6 years ago

This one has been a doozey!

First, not all QNAP will show that drive structure, for example on my 419+ it is actually:

/share/MD0_DATA/.qpkg/openHAB/

Second, the script will not work for downloading Java anymore it seems, this is due to the need to be logged into Oracle to get the download.

Third, it also depends on what version of ARM you are running, there is a difference between ARM and Embedded chips, mine is an embedded so I couldn't use that package, and getting the right version for embedded wasn't easy, so I just went for the latest (and last) Java update for 8 for embedded chip sets.

http://www.oracle.com/technetwork/java/embedded/embedded-se/downloads/index.html

Once I had scraped out of the script what it was doing, downloaded the above .gz through my computer and just dropped into File Manager, I just had to:

tar -xvzf <downloaded.tar.gz>

And then followed the instructions from there, went back to the dashboard in openHAB, and there we go, online.

Vardor commented 6 years ago

Current download links are different. That's why "openHAB.sh downloadJavaArm32" doesn't work. I replaced old link with new one (also md5 checksum). I opened openHAB.sh with a text editor and then replaced following line: downloadJavaCommon http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-arm32-vfp-hflt.tar.gz e74f9808168fb41570ee727e8e3f3366 with this one: downloadJavaCommon http://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/jdk-8u172-linux-arm32-vfp-hflt.tar.gz a22e671317c753ea7228eb614548b34e

After this you can execute procedure as described by @Stefan39135 openHAB.sh stop openHAB.sh downloadJavaArm32 openHAB.sh start

My nas is a QNAP TS-231P by the way.

Toffi32 commented 5 years ago

I had the same issue with myOpenHab and followed the instructions of thopiekar and in the end I´m Online. But I faced some minor issues:

  1. Open a console connection via SSH to your NAS -> i.O. with WinSCP and Putty

  2. Go to /share/CACHE[...]/.qpkg/openHAB/ -> the ".qpkg" folder is hidden, so use "ls -a"

  3. Run openHAB.sh stop -> run the script with: "sh openHAB.sh stop"

  4. Wait for approx 30-60s

  5. Run downloadJavaArm32 ("sh openHAB.sh downloadJavaArm32") for example for a QNAP TS-228, which I have. The script doesn´t work without replacing downloadlink in the script in the "function downloadJava..." with a valid oracle link. I decided for "Linux ARM 32 Hard Float ABI" form oracle.com. The md5 checksum has to be added too.

  6. Follow the instructions on the console and agree the Oracle Java license.

  7. After a successful installation, run "sh openHAB.sh start" to start openHAB again with your recently downloaded JRE.

  8. (Optionally) If you don't run any other application on your NAS with Java, then you can remove or disable the JRE installation from the App Center in your QTS.

I hope this helps.