How do I debug Tradfri on Openhab ?

open the openhab-cli:

root@rpi6:/home/pi# openhab-cli console

Logging in as openhab

                          __  _____    ____
  ____  ____  ___  ____  / / / /   |  / __ )
 / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  |
/ /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ /
\____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/
    /_/                        2.5.0.M4
                               Milestone Build

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown openHAB.

Find the packacke-namespace of the tradfri bundle:

openhab> bundle:list -s|grep trad
226 │ Active │  80 │ 2.5.0.M4              │ org.openhab.binding.tradfri

get the current debug-level:

openhab> log:get org.openhab.binding.tradfri
INFO

change the debug-level if needed:

openhab> log:set ERROR org.openhab.binding.tradfri
openhab> log:set DEBUG org.openhab.binding.tradfri
openhab> log:set INFO org.openhab.binding.tradfri

Error when adding Firebase to your app

When you add Firebase to your app and get similar error-messages like:

Duplicate class android.support.v4.app.INotificationSideChannel found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.IResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.ResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.ResultReceiver$1 found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)

Then add the following two lines in graddle.properties:

android.useAndroidX=true
android.enableJetifier=true

Netatmo API : How do I get the access_token ?

curl:

curl --location --request POST "https://api.netatmo.com/oauth2/token" \
  --form "grant_type=password" \
  --form "client_id=5a*******21175d8b45ec" \
  --form "client_secret=NR*******bYylIAigYvaO" \
  --form "username=be*******eb.de" \
  --form "password=***111***"

jQuery:

var form = new FormData();
form.append("grant_type", "password");
form.append("client_id", "5a*******21175d8b45ec");
form.append("client_secret", "NR*******bYylIAigYvaO");
form.append("username", "be*******eb.de");
form.append("password", "***111***");

var settings = {
  "url": "https://api.netatmo.com/oauth2/token",
  "method": "POST",
  "timeout": 0,
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});

Ruby:

require "uri"
require "net/http"

url = URI("https://api.netatmo.com/oauth2/token")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["content-type"] = 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
request.body = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"grant_type\"\r\n\r\npassword\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"client_id\"\r\n\r\n5a*******21175d8b45ec\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"client_secret\"\r\n\r\nNR*******bYylIAigYvaO\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"username\"\r\n\r\nbe*******eb.de\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\n***111***\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--"

response = https.request(request)
puts response.read_body

Python

import requests
url = 'https://api.netatmo.com/oauth2/token'
payload = {'grant_type': 'password',
'client_id': '5a*******21175d8b45ec',
'client_secret': 'NR*******bYylIAigYvaO',
'username': 'be*******eb.de',
'password': '***111***'}
files = {}
headers = {}
response = requests.request('POST', url, headers = headers, data = payload, files = files, allow_redirects=False, timeout=undefined, allow_redirects=false)
print(response.text)

Node

var https = require('https');

var options = {
  'method': 'POST',
  'hostname': 'api.netatmo.com',
  'path': '/oauth2/token',
  'headers': {
  }
};

var req = https.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function (chunk) {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });

  res.on("error", function (error) {
    console.error(error);
  });
});

var postData = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"grant_type\"\r\n\r\npassword\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"client_id\"\r\n\r\n5a*******21175d8b45ec\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"client_secret\"\r\n\r\nNR*******bYylIAigYvaO\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"username\"\r\n\r\nbe*******eb.de\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\n***111***\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--";

req.setHeader('content-type', 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW');

req.write(postData);

req.end();

PHP:

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.netatmo.com/oauth2/token",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => false,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => array('grant_type' => 'password','client_id' => '5a*******21175d8b45ec','client_secret' => 'NR*******bYylIAigYvaO','username' => 'be*******eb.de','password' => '***111***'),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
} ?>

Twelve steps to enable IPv6 in government and organizational networks | APNIC Blog

Guest Post: 12 fundamental steps to deploy IPv6 within governmental and organizational networks.

Source: Twelve steps to enable IPv6 in government and organizational networks | APNIC Blog