Which would be expected since I didn’t pass in any arguments with the request. You might want to turn on debug logging by adding the following to logback.xml:
$ sudo keytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -alias StartCom-Root-CA -file api.netatmo.net.crt
Enter keystore password:
Re-enter new password:
keytool error: java.io.FileNotFoundException: api.netatmo.net.crt (No such file or directory)
wget https://www.startssl.com/certs/ca.pem
--2016-01-10 13:31:52-- https://www.startssl.com/certs/ca.pem
Resolving www.startssl.com (www.startssl.com)... failed: Name or service not known.
wget: unable to resolve host address `www.startssl.com'
I tried again but I get all these errors:
Here is what i got when i tried to install the certificate
Trust this certificate? [no]: yes
Certificate was added to keystore
keytool error: java.io.FileNotFoundException: /jre/lib/security/cacerts (No such file or directory)
and this is what openhab says when rebooting:
22:44:31.522 [DEBUG] [.o.b.n.internal.NetatmoBinding:99 ] - Querying Netatmo API
22:44:31.523 [DEBUG] [.o.b.n.internal.NetatmoBinding:606 ] - Refreshing access token.
22:44:31.525 [DEBUG] [.o.b.n.internal.NetatmoBinding:610 ] - Request: RefreshTokenRequest[clientId=568a9d9e67e482c411f60107,clientSecret=f56zkY7Yx9dG4avMbdptdK2p53THInBqGL,refreshToken=5689941269f7405b8cf3b8898372699d6457428a07c1c58221ced8ee]
22:44:31.745 [ERROR] [g.openhab.io.net.http.HttpUtil:233 ] - Fatal transport error: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
22:44:31.774 [ERROR] [.service.AbstractActiveService:175 ] - Error while executing background thread Netatmo Refresh Service
org.openhab.binding.netatmo.internal.NetatmoException: Could not refresh access token!
at org.openhab.binding.netatmo.internal.messages.AbstractRequest.newException(AbstractRequest.java:50) ~[na:na]
at org.openhab.binding.netatmo.internal.messages.RefreshTokenRequest.execute(RefreshTokenRequest.java:63) ~[na:na]
at org.openhab.binding.netatmo.internal.NetatmoBinding$OAuthCredentials.refreshAccessToken(NetatmoBinding.java:612) ~[na:na]
at org.openhab.binding.netatmo.internal.NetatmoBinding.execute(NetatmoBinding.java:105) ~[na:na]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156) ~[na:na]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173) ~[na:na]
Caused by: java.lang.NullPointerException: null
at java.io.StringReader.<init>(StringReader.java:50) ~[na:1.8.0]
at org.codehaus.jackson.JsonFactory.createJsonParser(JsonFactory.java:636) ~[na:na]
at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1854) ~[na:na]
at org.openhab.binding.netatmo.internal.messages.RefreshTokenRequest.execute(RefreshTokenRequest.java:58) ~[na:na]
... 4 common frames omitted
It appears you didn’t set the JAVA_HOME environment variable. Run the command: update-alternatives --list java
This should output something similar to: /usr/lib/jvm/java-8-oracle/jre/bin/java
Use everything before /jre/… to set the JAVA_HOME environment variable: export JAVA_HOME=/usr/lib/jvm/java-8-oracle
After you set the environment variable, try:
ls -l $JAVA_HOME/jre/lib/security/cacerts
If it’s set correctly then you should see something similar to: -rw-r--r-- 1 root root 101992 Nov 4 10:54 /usr/lib/jvm/java-8-oracle/jre/lib/security/cacerts
Now try and rerun the keytool command. If you didn’t get errors, you should be good to go.
Did you follow the instructions at https://github.com/openhab/openhab/wiki/Netatmo-Binding#pre-setup? You should only need to get the refresh token one time then add it to the configuration file. What kind of problems are you having now? Also if you haven’t already upgraded, can you upgrade to openhab 1.8?
Yes I did. I tried on two different rpi, hence two differnt curl call, and two different refresh tokens. But I will upgrade tonight:
sudo apt-get update
sudo apt-get upgrade
So after that i will request new refresh tokens and give it a new try. I am sure I will get it to work.
I just need to make sure that my flat mate is not home, due to rebooting and then the entire flat gets dark:)
The MAC address in the https://my.netatmo.com/app/station shows : 70:ee:50:1a:fc:b6, but this does not show up in router dhcp list. I think this might be the problem.