NetAtmo Binding

1,320 views
Skip to first unread message

Gaël L'hopital

unread,
Feb 6, 2014, 9:02:11 AM2/6/14
to ope...@googlegroups.com
Hello,
I'm try to setup the Netatmo binding, and at launch of the runtime, I've got this error :

14:59:05.022 ERROR o.openhab.io.net.http.HttpUtil[:211] - 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
14:59:05.025 ERROR o.o.c.s.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.RefreshTokenRequest.execute(RefreshTokenRequest.java:62)
Caused by: java.lang.NullPointerException: null
    at java.io.StringReader.<init>(StringReader.java:50)

I've configured the binding as explained and retrieved the refresh token using the curl command line, replaced with my credentials.
What I found weird is that my refresh token includes a pipe symbol :
51c55d041877596321000035|7e385550e1231d491e15b1c9963d1220

Could this be the reason of the failure of the binding ?

Gaël L'hopital

unread,
Feb 7, 2014, 4:58:51 AM2/7/14
to ope...@googlegroups.com
I think I have the beginning of an answer, same case found on Netatmo forum here, and maybe due to some kind of encoding issue (see stackoverflow here).
Then is it an issue in the binding ?

Andreas Brenk

unread,
Feb 7, 2014, 7:43:50 AM2/7/14
to ope...@googlegroups.com
It seems your JDK is missing the Certificate Authority that signed Netatmo's SSL certificate.

Gaël L'hopital

unread,
Feb 8, 2014, 3:13:20 AM2/8/14
to ope...@googlegroups.com
It works fine, thanks

gilles.l...@gmail.com

unread,
Jun 26, 2014, 8:53:29 AM6/26/14
to ope...@googlegroups.com
Hi Gaël,

I haven't got you ssl problem but a refresh token, with the pipe.

How do you solve that, I search everywhere and don't find any solution.

curl in a shell or by client simple rest always give me a pipe.

This isn't as describe in netatmo web site.

Could you help me (us, as I'm thinking I'm not alone in that case).


Thank you .

Gilles.

Gaël L'hopital

unread,
Jun 29, 2014, 4:57:43 AM6/29/14
to ope...@googlegroups.com
Hi Gilles,

I only had to install the SSL certificate as described in the attached link to solve the problem. The focus on pipe was a dead end in my search of the origin of the problem.
Regards
Gaël

Gilles L

unread,
Jul 2, 2014, 12:55:46 PM7/2/14
to ope...@googlegroups.com

Sorry for my late answer, but it's OK. I made a mistake in  binding name.

Thank you for your answer.

Gilles.

--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/b84UpXBr-Ho/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.

Alex Karls

unread,
Jul 13, 2014, 7:51:36 AM7/13/14
to ope...@googlegroups.com
sorry, but i don`t get it.. from where should i do this:
"Tool Box/StartCom CA Certificates/StartCom Root CA (PEM encoded)"

Andreas Brenk

unread,
Jul 13, 2014, 9:16:20 AM7/13/14
to ope...@googlegroups.com
I guess the StartSSL website was restructured. The solution and current location of the certificate is documented in the wiki:

https://github.com/openhab/openhab/wiki/Netatmo-Binding#missing-certificate-authority

Good luck!


--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/b84UpXBr-Ho/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.

Alex Karls

unread,
Jul 13, 2014, 9:16:29 AM7/13/14
to ope...@googlegroups.com
got it.. for the next one who´s searching for this, here the direct link to the cert, so you don´t have to sign up:

Andreas Brenk

unread,
Jul 13, 2014, 9:18:04 AM7/13/14
to ope...@googlegroups.com
That's what the wiki is for...


--

Alex Karls

unread,
Jul 13, 2014, 9:36:32 AM7/13/14
to ope...@googlegroups.com
well, thanks ;) 
--
mit freundlichen Grüßen,
Alexander Karls
Message has been deleted
Message has been deleted

Maximilian

unread,
Jul 16, 2014, 1:06:57 AM7/16/14
to ope...@googlegroups.com
That did not work.
Saving and using the certificate from https://api.netatmo.net worked though.

ari...@nesys.it

unread,
Aug 4, 2014, 6:04:33 PM8/4/14
to ope...@googlegroups.com
Hi Maximilian,

how to save the certificate from api.netatmo.net?

Thank you

Andrea

ari...@nesys.it

unread,
Aug 4, 2014, 6:11:46 PM8/4/14
to ope...@googlegroups.com
Solved:

sudo keytool -delete -alias StartCom-Root-CA -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit

sudo $JAVA_HOME/bin/keytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -alias StartCom-Root-CA -file api.netatmo.net\ \(ieXGGBU42pKmPQtQ\).cer


Now it seems working ...

Jari Macfed

unread,
Jan 12, 2015, 11:05:48 AM1/12/15
to ope...@googlegroups.com
I 've tried this I get reply keytool error: java.io.FileNotFoundException: api.netatmo.net (ieXGGBU42pKmPQtQ).cer (No such file or directory) 

If I look at my certificate on the webapp from netatmo I got an other certificatenumber Is there a way toget  a certificate 
ON OSX Yosemite 

JanR  

Maximilian

unread,
Jan 13, 2015, 2:48:21 AM1/13/15
to ope...@googlegroups.com
did you follow exactly what the wiki says ? Did you try the alternative approach ?
Make shure to use the correct path and filename:

https://github.com/openhab/openhab/wiki/Netatmo-Binding

Jari Macfed

unread,
Jan 13, 2015, 7:20:50 AM1/13/15
to ope...@googlegroups.com
Sometimes you must wait a day to get over the problems!

This is how I got it to work, maybe it might assist someone in the future

Netatmo certificate OS X Yosemite 


1st problem OpenHab did not accepted old JRE 1.6 for Netamo bindings needed to update 


Upgraded to Java SDK jdk1.8.0_25.jdk


Importing certificate  ca.pem and api.netatmo.net.crt in /Library/Java/Home/lib/security/cacerts with no success.


Noticed no jre directory 


created directory jre/lib/security

cp carets to above directory 

no succes 

OpenHab returned message 

2015-01-13 12:43:48.940 [ERROR] [g.openhab.io.net.http.HttpUtil] - 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


checked instal java 


/usr/libexec/java_home

/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home


created 

JAVA=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home

excecuted 

sudo $JAVA/bin/keytool -import -keystore $JAVA/jre/lib/security/cacerts -alias StartCom-Root-CA -file api.netatmo.net.crt 


Succes!!


From the log 

2015-01-13 13:00:38.523 [INFO ] [.o.b.n.internal.NetatmoBinding] - The following Netatmo measurements are not yet configured:

 
Thanks for your reply. It gave me a fresh start at the problem. 

I can start playing further.

JR

 

ari...@nesys.it

unread,
Jan 14, 2015, 6:04:44 PM1/14/15
to
Hi All,

something I see in my logs:

2015-01-14 23:00:07.831 [ERROR] [.service.AbstractActiveService] - Error while executing background thread Netatmo Refresh Service

java.lang.NullPointerException: null

at org.openhab.binding.netatmo.internal.NetatmoBinding.execute(NetatmoBinding.java:120) ~[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]


what should be root cause, and how to solve it?


Now I'm trying increasing the refresh timeout from 5 mins to 10 mins. We'll see.


Thanks for your support, much appreciated


Andrea

glh

unread,
Jan 15, 2015, 12:03:23 AM1/15/15
to ope...@googlegroups.com
This should disappear with the last PR I made regarding issue #1848

2015-01-15 0:04 GMT+01:00 <ari...@nesys.it>:
Hi All,

something I see in my logs:

2015-01-14 23:00:07.831 [ERROR] [.service.AbstractActiveService] - Error while executing background thread Netatmo Refresh Service

java.lang.NullPointerException: null

at org.openhab.binding.netatmo.internal.NetatmoBinding.execute(NetatmoBinding.java:120) ~[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]


what should be root cause, and how to solve it?


Thanks for your support, much appreciated


Andrea

--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/b84UpXBr-Ho/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.

ari...@nesys.it

unread,
Jan 15, 2015, 2:52:34 AM1/15/15
to ope...@googlegroups.com
Thank you for your reply

I will let you know as soon as 1.6.2 will be available.

Thanks

Andrea

ari...@nesys.it

unread,
Jan 31, 2015, 11:31:53 AM1/31/15
to ope...@googlegroups.com
Hi,

I've installed 1.6.2 but I see always the same issue in my logs:

2015-01-31 17:28:49.213 [ERROR] [g.openhab.io.net.http.HttpUtil] - 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

2015-01-31 17:28:49.235 [ERROR] [.service.AbstractActiveService] - 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:48) ~[na:na]

at org.openhab.binding.netatmo.internal.messages.RefreshTokenRequest.execute(RefreshTokenRequest.java:64) ~[na:na]

at org.openhab.binding.netatmo.internal.NetatmoBinding$OAuthCredentials.refreshAccessToken(NetatmoBinding.java:497) ~[na:na]

at org.openhab.binding.netatmo.internal.NetatmoBinding.execute(NetatmoBinding.java:101) ~[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_31]

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:59) ~[na:na]

... 4 common frames omitted



Any suggestion?

Thanks

Andrea

ari...@nesys.it

unread,
Jan 31, 2015, 11:41:31 AM1/31/15
to ope...@googlegroups.com
Just FYI

I've found a workaround: reinstall the startssl certificate:

sudo $JAVA_HOME/bin/keytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -alias StartCom-Root-CA -file api.netatmo.net\ \(ieXGGBU42pKmPQtQ\).cer


But would be nice to fix this issue, if possible.


Thank you very much for your support


Andrea

ari...@nesys.it

unread,
Sep 7, 2015, 4:02:09 PM9/7/15
to openhab
Folks,

same issue, it seem the workaround not working any more :(

2015-09-07 21:59:46.043 [ERROR] [g.openhab.io.net.http.HttpUtil] - 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

2015-09-07 21:59:46.090 [ERROR] [.service.AbstractActiveService] - 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:48) ~[na:na]

at org.openhab.binding.netatmo.internal.messages.RefreshTokenRequest.execute(RefreshTokenRequest.java:64) ~[na:na]

at org.openhab.binding.netatmo.internal.NetatmoBinding$OAuthCredentials.refreshAccessToken(NetatmoBinding.java:497) ~[na:na]

at org.openhab.binding.netatmo.internal.NetatmoBinding.execute(NetatmoBinding.java:101) ~[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_31]

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:59) ~[na:na]

... 4 common frames omitted


1.6.2 here

Any suggestion will be appreciated

Thanks

Andrea

Rob Nielsen

unread,
Sep 7, 2015, 10:15:43 PM9/7/15
to openhab
I'm not having problems. Did Java get updated? If so you'll need to reinstall the certs again.

Rob
Reply all
Reply to author
Forward
0 new messages