Closed hakan42 closed 7 years ago
That does not appear to be output from Netatmo or OH.
Actually, they are. I forgot to paste the URLs:
Dec 22 12:20:11 pitaya start-service.sh[729]: {"body":{"devices":[{"_id":"XX:XX:XX:XX:XX:XX","cipher_id":"enc:16:XXXXX
Dec 22 12:20:11 pitaya start-service.sh[729]: ,"battery_vp":5210,"battery_percent":61,"rf_status":55,"firmware":17},{"_id":"XX:XX:XX:XX:XX:XX","type":"NAModul
Dec 22 12:20:11 pitaya start-service.sh[729]: 797132,"wifi_status":42}],"user":{"mail":"hakan@tandogan.com","administrative":{"country":"DE","reg_locale":"en-
Dec 22 12:20:11 pitaya start-service.sh[729]: <--- END HTTP (4357-byte body)
Dec 22 12:20:11 pitaya start-service.sh[729]: ---> HTTP GET https://api.netatmo.net/api/getstationsdata?device_id=XXXXXXXXXXX
Dec 22 12:20:11 pitaya start-service.sh[729]: ---> END HTTP (no body)
Dec 22 12:20:12 pitaya start-service.sh[729]: <--- HTTP 200 https://api.netatmo.net/api/getstationsdata?device_id=XXXXXXX (154ms)
You can see from the requested URLs as well from the content (which I modified slightly to suppress my own credentials) that the request go to api.netatmo.net.
If an exception is thrown, the stack trace starts with
Dec 13 13:12:51 pitaya start-service.sh[4347]: at com.squareup.okhttp.Connection.connectAndSetOwner(Connection.java:175)
....
Dec 13 13:12:52 pitaya start-service.sh[4347]: at org.openhab.binding.netatmo.handler.NetatmoBridgeHandler.getStationsDataBody(NetatmoBridgeHandler.java:138)
Dec 13 13:12:52 pitaya start-service.sh[4347]: at org.openhab.binding.netatmo.handler.station.NAMainHandler.updateReadings(NAMainHandler.java:41)
Dec 13 13:12:52 pitaya start-service.sh[4347]: at org.openhab.binding.netatmo.handler.NetatmoDeviceHandler.updateChannels(NetatmoDeviceHandler.java:92)
Dec 13 13:12:52 pitaya start-service.sh[4347]: at org.openhab.binding.netatmo.handler.NetatmoDeviceHandler$1.run(NetatmoDeviceHandler.java:64)
Dec 13 13:12:52 pitaya start-service.sh[4347]: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
and goes straight through okhttp to make the HTTP calls.
That library is full of System.out.println calls. 😦
Kill it. Kill it with fire! Kill it with nuclear fire from orbit! 😈
So the possible fixes are:
O.k., back to serious discussion, I thought that our chosen http client was the one that comes with Jetty.
One reason I could imagine for chosing okhttp would be that it is used for OAUTH setup. Do we have any alternative in the ESH core for this? Also, should discussion be moved to community.openhab.org ?
BTW, this is the OH2 Netatmo binding, not the OH 1 Netatmo binding. Shouldn't the defect created at https://github.com/openhab/openhab2-addons/issues?
Ah, damn, opened the ticket in the wrong repo again :(
I will create a new one over there.
Expected Behavior
Debug traces should go to either to the designated log or be suppressed
Current Behavior
The HTTP requests and responses are dumped on the system console:
Possible Solution
Suppress the aforementioned if not explicitly enabled 😈
Steps to Reproduce (for bugs)
Context
Your Environment