This module allowed you to control IKEA Tradfri devices with Google Assistant.
Important: Sadly, I’m not using Tradfri devices for myself anymore, thus I’m unable to continue development on this module. The FHEM module is provided “as is”, it works for most basic functionalities flawlessly. I’m currently looking for a new maintainer for project ownership.
Contents
If you are already using the module…
…in its mainstream version, you’ve to remove the repository from the FHEM instance first:
update delete https://raw.githubusercontent.com/peterkappelt/Tradfri-FHEM/master/src/controls_tradfri.txt
Setting up the module and the repository in FHEM
Run the following commands in FHEM:
update add https://raw.githubusercontent.com/peterkappelt/Tradfri-FHEM/dev-cf/src/controls_tradfri.txt update shutdown restart
Asure again, that you’ve installed the JSON Perl modules (e.g. the libjson-perl package for apt on Debian-based distributions).
Please note, that until some point, there will be no entries in the CHANGED-file, so the update command will output information that are not up-to-date.
You can now define (or keep) the Gateway, Devices and Groups like you’d have in the mainstream version.
Setting up JTradfri
With the new implementation, you need a Java-Software that will run in background. This software acts as a translator between FHEM and the gateway.
In order to run this Java software you need to install a Java Runtime Environment (JRE) on your system, in Version 8 (or newer). A JRE 7 won’t work.
Create the folder /opt/jtradfri/ and download both the latest version of JTradfri and the sample configuration file. Create a new user (“jtradfri”) and change the ownership of the folder and files:
[email protected]:~ $ sudo mkdir -p /opt/jtradfri/ [email protected]:~ $ cd /opt/jtradfri/ [email protected]:/opt/jtradfri $ sudo wget -O jtradfri.conf https://raw.githubusercontent.com/peterkappelt/JTradfri/master/bin/jtradfri.conf.example [...] [email protected]:/opt/jtradfri $ sudo wget https://raw.githubusercontent.com/peterkappelt/JTradfri/master/bin/jtradfri.jar [...] [email protected]:/opt/jtradfri $ sudo useradd --home-dir /home/ --no-create-home --shell /bin/false jtradfri [email protected]:/opt/jtradfri $ sudo chown -R jtradfri:jtradfri . [email protected]:/opt/jtradfri $ ls -al insgesamt 8684 drwxr-xr-x 2 jtradfri jtradfri 4096 Feb 9 20:00 . drwxr-xr-x 5 root root 4096 Feb 9 19:59 .. -rw-r--r-- 1 jtradfri jtradfri 864 Feb 9 19:59 jtradfri.conf -rw-r--r-- 1 jtradfri jtradfri 8877624 Feb 9 19:59 jtradfri.jar
Edit the configuration file and insert the IP of the gateway and its secret (for example with the text editor “nano”, by running sudo nano /opt/jtradfri/jtradfri.conf ). A config file looks like that:
#Comments start with the "#"-Character #IP or DNS-Name of the Tradfri Gateway. Required gateway=TradfriGW.int.kappelt.net #PSK of the Gateway. Required secret=Your-PSK-Here #JTradfri receives commands over a TCP socket #Port of that TCP-Server, optional. Default 1505 #port=1505 #Listen-Address of the TCP-Server, optional. Default 127.0.0.1 #Set this to the IP of your PC if the TCP-Client (e.g. FHEM) isn't running on the same PC as JTradfri #listenaddress=192.168.2.121 #JTradfri opens an UDP-Socket #you can set this socket to a static port if you need to configure your firewall for this #Optional. Default is random port #udpport=12345 #JTradfri can read command interactively from the commandline #This can be disable with the following parameter (optional, default false) #That is necessary if JTradfri is running as a systemd-service #nocmdline=true
You may now test your config on the commandline:
java -jar /opt/jtradfri/jtradfri.jar -n -c /opt/jtradfri/jtradfri.conf
The output of a successful startup will look similar to that:
JTradfri 0.0.6-snapshot [GWConnection] Doing handshake to get connection keys/ parameters... Feb 09, 2018 8:16:50 PM org.eclipse.californium.core.network.CoapEndpoint start INFORMATION: Starting endpoint at coaps://0.0.0.0:0 Feb 09, 2018 8:16:50 PM org.eclipse.californium.scandium.DTLSConnector start INFORMATION: DTLS connector listening on [0.0.0.0/0.0.0.0:58784] with MTU [1.280] using (inbound) datagram buffer size [16.474 bytes] Feb 09, 2018 8:16:50 PM org.eclipse.californium.core.network.CoapEndpoint start INFORMATION: Started endpoint at coaps://0.0.0.0:58784 Feb 09, 2018 8:16:50 PM org.eclipse.californium.core.CoapClient setEndpoint INFORMATION: Started set client endpoint 0.0.0.0/0.0.0.0:58784 [GWConnection] Handshake: Using identity "jtr_e24bc3" [GWConnection] Tradfri gateway firmware version: 1.3.0014 [GWConnection] Got connection psk: HafkKuH4Fbt02Zhc Feb 09, 2018 8:16:51 PM org.eclipse.californium.scandium.DTLSConnector stop INFORMATION: Stopping DTLS connector on [0.0.0.0/0.0.0.0:58784] Feb 09, 2018 8:16:51 PM org.eclipse.californium.core.network.CoapEndpoint start INFORMATION: Starting endpoint at coaps://0.0.0.0:0 Feb 09, 2018 8:16:51 PM org.eclipse.californium.scandium.DTLSConnector start INFORMATION: DTLS connector listening on [0.0.0.0/0.0.0.0:59205] with MTU [1.280] using (inbound) datagram buffer size [16.474 bytes] Feb 09, 2018 8:16:51 PM org.eclipse.californium.core.network.CoapEndpoint start INFORMATION: Started endpoint at coaps://0.0.0.0:59205 Feb 09, 2018 8:16:51 PM org.eclipse.californium.core.CoapClient setEndpoint INFORMATION: Started set client endpoint 0.0.0.0/0.0.0.0:59205 [GWConnection] Fetching well-known... [GWConnection] <//15006>;ct=0;obs,<//15001>;ct=0;obs,<//15004>;ct=0;obs,<//15004/add>;ct=0,<//15004/remove>;ct=0,<//15010>;ct=0;obs,<//15005>;ct=0;obs,<//15011/15012>;ct=0;obs,<//15011/9034>;ct=0,<//15011/9030>;ct=0,<//15011/9031>;ct=0,<//15011/9094>;ct=0;obs,<//15011/9095>;ct=0;obs,<//15011/9104>;ct=0;obs,<//15010/265906>;ct=0;obs,<//15005/196210/215099>;ct=0;obs,<//15005/196210/209979>;ct=0;obs,<//15004/196210>;ct=0;obs,<//15005/196210>;ct=0;obs,<//15004/173540>;ct=0;obs,<//15005/173540>;ct=0;obs,<//15001/65538>;ct=0;obs,<//15001/65539>;ct=0;obs,<//15001/65537>;ct=0;obs,<//15001/65536>;ct=0;obs,<//15005/173540/198884>;ct=0;obs,<//15005/173540/213983>;ct=0;obs,<//15005/173540/206399>;ct=0;obs,<//15005/196210/201819>;ct=0;obs,<//15005/196210/222829>;ct=0;obs,<//15005/196210/225859>;ct=0;obs,<//15011/9063>;ct=0 TCP-Listener on /127.0.0.1 [TcpServer] Binding of socket @ port 1505 successfull.
Running JTradfri in background (as systemd service)
You can run JTradfri in background and start it automatically at system startup by using systemd. This only works, if your linux distribution is using systemd (which is the case for many modern versions).
Download the prepared config file an enable the service. No changes are necessary if you’ve followed the install instructions from above.
[email protected]:/opt/jtradfri $ sudo wget https://raw.githubusercontent.com/peterkappelt/JTradfri/master/bin/jtradfri.service -O /etc/systemd/system/jtradfri.service [email protected]:/opt/jtradfri $ sudo systemctl enable jtradfri.service
One can now start (sudo systemctl start jtradfri.service) and stop (sudo systemctl stop jtradfri.service) JTradfri like a normal service. It shall automatically run at system startup.
You can display the log file with sudo journalctl -xe -u jtradfri . A successful startup looks like that:
Feb 09 20:59:00 hcpi01 systemd[1]: Started JTradfri - FHEM-Tradfri Gateway Software. -- Subject: Unit jtradfri.service has finished start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit jtradfri.service has finished starting up. -- -- The start-up result is done. Feb 09 20:59:00 hcpi01 java[16488]: JTradfri 0.0.6-snapshot Feb 09 20:59:00 hcpi01 java[16488]: [GWConnection] Doing handshake to get connection keys/ parameters... Feb 09 20:59:02 hcpi01 java[16488]: Feb 09, 2018 8:59:01 PM org.eclipse.californium.core.network.CoapEndpoint start Feb 09 20:59:02 hcpi01 java[16488]: INFORMATION: Starting endpoint at coaps://0.0.0.0:0 Feb 09 20:59:02 hcpi01 java[16488]: Feb 09, 2018 8:59:02 PM org.eclipse.californium.scandium.DTLSConnector start Feb 09 20:59:02 hcpi01 java[16488]: INFORMATION: DTLS connector listening on [0.0.0.0/0.0.0.0:43545] with MTU [1.280] using (inbound) datagram buffer size [16.474 bytes] Feb 09 20:59:02 hcpi01 java[16488]: Feb 09, 2018 8:59:02 PM org.eclipse.californium.core.network.CoapEndpoint start Feb 09 20:59:02 hcpi01 java[16488]: INFORMATION: Started endpoint at coaps://0.0.0.0:43545 Feb 09 20:59:02 hcpi01 java[16488]: Feb 09, 2018 8:59:02 PM org.eclipse.californium.core.CoapClient setEndpoint Feb 09 20:59:02 hcpi01 java[16488]: INFORMATION: Started set client endpoint 0.0.0.0/0.0.0.0:43545 Feb 09 20:59:02 hcpi01 java[16488]: [GWConnection] Handshake: Using identity "jtr_24e4e8" Feb 09 20:59:03 hcpi01 java[16488]: [GWConnection] Tradfri gateway firmware version: 1.3.0014 Feb 09 20:59:03 hcpi01 java[16488]: [GWConnection] Got connection psk: 4c9AdW91iLdlck1G Feb 09 20:59:03 hcpi01 java[16488]: Feb 09, 2018 8:59:03 PM org.eclipse.californium.scandium.DTLSConnector stop Feb 09 20:59:03 hcpi01 java[16488]: INFORMATION: Stopping DTLS connector on [0.0.0.0/0.0.0.0:43545] Feb 09 20:59:03 hcpi01 java[16488]: Feb 09, 2018 8:59:03 PM org.eclipse.californium.core.network.CoapEndpoint start Feb 09 20:59:03 hcpi01 java[16488]: INFORMATION: Starting endpoint at coaps://0.0.0.0:0 Feb 09 20:59:03 hcpi01 java[16488]: Feb 09, 2018 8:59:03 PM org.eclipse.californium.scandium.DTLSConnector start Feb 09 20:59:03 hcpi01 java[16488]: INFORMATION: DTLS connector listening on [0.0.0.0/0.0.0.0:45420] with MTU [1.280] using (inbound) datagram buffer size [16.474 bytes] Feb 09 20:59:03 hcpi01 java[16488]: Feb 09, 2018 8:59:03 PM org.eclipse.californium.core.network.CoapEndpoint start Feb 09 20:59:03 hcpi01 java[16488]: INFORMATION: Started endpoint at coaps://0.0.0.0:45420 Feb 09 20:59:03 hcpi01 java[16488]: Feb 09, 2018 8:59:03 PM org.eclipse.californium.core.CoapClient setEndpoint Feb 09 20:59:03 hcpi01 java[16488]: INFORMATION: Started set client endpoint 0.0.0.0/0.0.0.0:45420 Feb 09 20:59:03 hcpi01 java[16488]: [GWConnection] Fetching well-known... Feb 09 20:59:03 hcpi01 java[16488]: [GWConnection] <//15006>;ct=0;obs,<//15001>;ct=0;obs,<//15004>;ct=0;obs,<//15004/add>;ct=0,<//15004/remove>;ct=0,<//15010>;ct=0;obs,<//15005>;ct=0;obs,<//150 Feb 09 20:59:03 hcpi01 java[16488]: TCP-Listener on /127.0.0.1 Feb 09 20:59:03 hcpi01 java[16488]: [TcpServer] Binding of socket @ port 1505 successfull.
Note: If you need to edit the systemd-file (/etc/systemd/system/jtradfri.service), please run sudo systemctl daemon-reload afterwards and restart this service.
Checklist for FHEM
Now, once everything is up and running, go back to the FHEM web interface. Open the view of the TradfriGateway device. If its state is “opened” everything is just fine. If it states “disconnected” the module couldn’t connect to the socket. You can simply wait a minute until FHEM tries to re-connect automatically or run “set reopen” on the gateway device. Now, the gateway device should be connected.
If it isn’t working after those steps, feel free to ask me.
Known Problems
- JTradfri doesn’t work reliably on Windows, because the Firewall closes the ports after some time without activity
Feedback
As always, I’m happy if you test the module and send me a small report about your experience.
If you experience a major issue, feel free to open a github issue (prefered by me).
Hallo Peter,
beim Aufruf des Befehls “java -jar JTradfri-03082017-0.0.3-snapshot-all.jar -s xxxxxxxxxxxxxxxx -g 192.168.2.56″
in dem Ordner, in dem sich die datei “JTradfri-03082017-0.0.3-snapshot-all.jar” befindet, kommt nur die Fehlermeldung: “-bash: span: Datei oder Verzeichnis nicht gefunden.” Die HTML-Angaben müssen raus – dann geht es!
Gruß Eberhard
Danke für den Hinweis. Ist nun korrigiert.
Hallo,
habe mal probiert die Beta ans Laufen zu bekommen. Leider klappt es mit dem Java-Client nicht so ganz, es kommt zu einer NPE:
java -jar JTradfri-03082017-0.0.3-snapshot-all.jar -d -g 192.168.42.17 -s
JTradfri 0.0.3-snapshot
Sep 04, 2017 9:28:33 AM org.eclipse.californium.core.network.CoapEndpoint start
INFO: Starting endpoint at coaps://0.0.0.0:0
Sep 04, 2017 9:28:34 AM org.eclipse.californium.scandium.DTLSConnector start
INFO: DTLS connector listening on [/192.168.42.208:65224] with MTU [1,280] using (inbound) datagram buffer size [16,474 bytes]
Sep 04, 2017 9:28:34 AM org.eclipse.californium.core.network.CoapEndpoint start
INFO: Started endpoint at coaps://192.168.42.208:65224
Sep 04, 2017 9:28:34 AM org.eclipse.californium.core.CoapClient setEndpoint
INFO: Started set client endpoint /192.168.42.208:65224
[GWConnection] Fetching well-known…
Exception in thread “main” java.lang.NullPointerException
at net.kappelt.JTradfri.GWConnection.connectionOpen(GWConnection.java:152)
at net.kappelt.JTradfri.GWConnection.(GWConnection.java:89)
at net.kappelt.JTradfri.JTradfri.startThreadHandler(JTradfri.java:54)
at net.kappelt.JTradfri.JTradfri.main(JTradfri.java:45)
# java -version
openjdk version “1.8.0_131”
OpenJDK Runtime Environment (build 1.8.0_131-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
Woran könnte das liegen?
Habe das gleiche Problem…
Hat @Peter da schon eine Lösung?
Sofern das Problem noch besteht:
– Probiert nochmal die aktuelle Version aus (https://github.com/peterkappelt/JTradfri/raw/master/bin/jtradfri.jar)
– Startet JTradfri mit “-d”, um Debug-Ausgaben zu aktivieren.
In beiden Fällen die Programmausgabe zeigen. Gerne mich auch mal per Mail dran erinnern.
Die steht im Zweifel im Impressum oder auf Github.
hi, es läuft 🙂 ihr seid super, weiter so.
Ich habe nur ein Problem, ich kann das Licht über die Gruppe aus schalten, allerdings passiert nichts beim ein schalten. Das Licht geht erst wieder wenn ich den Regler dimmvalue ändere und abschicke
Hallo Peter Kappelt,
ist die BETA mitlerweile in einem Stadium, die auch für den normalen Nutzer einsetzbar ist, oder rädst DU noch davon ab?
Wann wird die Version den BETA-Status verlieren?
Vielen Dank für Deine Bemühungen und bis bald
Martin
Hallo Peter,
ich kämpfe mich grade durch diese Anleitung und das FHEM-Forum…
Wie setzte ich diesen Text um:
“Ladet euch aus der Github-Repository die aktuelle Version herunter. Die Builds sind dabei nach dem Schema JTradfri-DDMMYYY-Version-all.jar benannt. Navigiert in der Konsole in den Ordner, in dem ihr JTradfri heruntergeladen habt. Der beispielhafte Aufruf für die momentan aktuelle Version sieht so aus:”
Ich versuche es in der Konsole (Raspi 2) folgendermaßen:
wget https://github.com/peterkappelt/JTradfri/blob/master/JTradfri-builds/JTradfri-06112017-0.0.5-snapshot-all.jar
Das scheint auch zu klappen. Dann führe ich ebendort folgenden Befehl aus:
java -jar JTradfri-06112017-0.0.5-snapshot-all.jar -s 8…A -g 192.168.188.35
und bekomme folgende Anzeige:
Error: Invalid or corrupt jarfile JTradfri-06112017-0.0.5-snapshot-all.jar
Da selbes auch bei der Version 4 vom 31.10. passiert sehe ich den Fehler eher bei mir als bei der Datei…
Martin
Hallo Martin,
das ist ein normaler Fehler den man als “beginner” bei GitHub Downloads gerne macht.
wget https://github.com/peterkappelt/JTradfri/raw/master/JTradfri-builds/JTradfri-06112017-0.0.5-snapshot-all.jar
Auf der Seite aus deiner URL musst die die Adresse des Download-Buttons kopieren 😉
Hallo,
Ich habe versucht alle schritte so auszuführen. (bin auch noch blutiger anfänger)
der versuch
wget https://github.com/peterkappelt/JTradfri/raw/master/JTradfri-builds/JTradfri-06112017-0.0.5-snapshot-all.jar
stößt immer auf ein timeout. auch wenn ich versuche die datei manuell herunterzuladen. egal ob auf Raspi oder einem anderen PC.
Was mache ich da falsch?
Danke
David
ok scheint als hätt ich es geschafft. hat wohl an meinem router gelegen. nach einem neustart hat alles gut funktioniert
Hallo,
erstmal vielen Dank für die tolle Arbeit. Bei mir läuft es ohne Probleme. Was jetzt noch wirklich super wäre, ist die Bewegungsmelder von Tradfri nutzen zu können. Ist dies auch etwas was zukünftig noch unterstützt wird oder gibt es hier von Tradfri Einschränkungen die dies prinzipiell verhindern?
Besten Dank
Ist der Download oben der nachfolger der Datei “JTradfri-06112017-0.0.5-snapshot-all.jar” ? Irgendwie blicke ich da nicht ganz durch.
mfg Marcel
Ja. Die Java-Anwendung heißt jetzt nur noch “jtradfri.jar”, die Versionsangabe wurde vom Dateinamen entfernt.
Bitte entschuldigt solche schnellen, schlecht dokumentierten Änderungen.
Versuche das Gateway von Tradfri einzubinden. der jtradfri server läuft one Fehler. IP adresse im FHEM stimmt Sicherheitskey ebenfalls. Nach define wird jedoch der Status immer mit IDLE angezeigt.
Was kann ich Tun?
Bitte schicke mir die Ausgaben von “update list” und “list TYPE=TradfriGateway” im FHEM,
außerdem noch die Meldungen beim Start von JTradfri.
Hallo, beim Start von jtradfri.jar bekomme ich einen NullPointerException Fehler.
Ich habe die aktuelle Version geladen und bekomme folgenden Fehler:
JTradfri 0.0.6-snapshot
[GWConnection] Doing handshake to get connection keys/ parameters…
Apr 29, 2018 9:31:28 PM org.eclipse.californium.core.network.CoapEndpoint start
INFO: Starting endpoint at coaps://0.0.0.0:0
Apr 29, 2018 9:31:29 PM org.eclipse.californium.scandium.DTLSConnector start
INFO: DTLS connector listening on [0.0.0.0/0.0.0.0:60542] with MTU [1,280] using (inbound) datagram buffer size [16,474 bytes]
Apr 29, 2018 9:31:29 PM org.eclipse.californium.core.network.CoapEndpoint start
INFO: Started endpoint at coaps://0.0.0.0:60542
Apr 29, 2018 9:31:29 PM org.eclipse.californium.core.CoapClient setEndpoint
INFO: Started set client endpoint 0.0.0.0/0.0.0.0:60542
[GWConnection] Handshake: Using identity “jtr_20b79b”
Exception in thread “main” java.lang.NullPointerException
at net.kappelt.JTradfri.GWConnection.getIdentityInformation(GWConnection.java:253)
at net.kappelt.JTradfri.GWConnection.connectionOpen(GWConnection.java:113)
at net.kappelt.JTradfri.GWConnection.(GWConnection.java:98)
at net.kappelt.JTradfri.JTradfri.start(JTradfri.java:138)
at net.kappelt.JTradfri.JTradfri.main(JTradfri.java:66)
Ich habe von Java keine Ahnung. Irgend eine Idee was das sein könnte?
Hallo Peter,
ich habe mit JTradfri 0.0.6-snapshot das gleiche Problem der NullPointerException. Die Ausgabe mit Option -d ist nicht informativer. Java ist 1.8.0 auf Raspian.
Kannst Du bitte helfen? Oder lieber FHEM-Forum?
Viele Grüße
Boris
Kommt zwar spät, aber bei mir war es schlicht ein Tippfehler im SecurityKey (Großes i und kleines L sind schwer zu unterscheiden)
Hallo, auf meinen rpi 1 lief die beta super. Jetzt hab ich auf einen rpi3 gewechselt und als von vorne neu installiert. ES läuft auch alles und das gateway zeigt den Status opend an und wenn ich in der app eine Lampe verstelle reagiert fhem in echtzeit und zeigt die Änderung an , aber aus fhem heraus selbst kann ich keine Lampe schalten. Es tut sich nichts, in fhrm sieht man das die befehle auf ausgeführt werden aber nichts passiert.
Tipp? Hab das beim Googeln gesehen das ich nicht der einzige bin mit dem problem.
Hallo!
Ich versuche eine 1. Lampe + Gateway anzubinden.
FHEM läuft auf Ubuntu 17.10
Java ist installiert…. alles schick, bis zur Weboberfläche. Hier ist mein TradfriGW auf Status opened; aber es erhält keine Devices (habe 2 Stück, eine LED Birne und eine Fernbedienung; über die APP sauber verbunden und funktioniert).
Wie kann ich hier auf Fehlersuche gehen ?
Vielen Dank,
Dennis
Sorry, war scheinbar zu ungeduldig… Sorry 🙂
Nun zeigt er mir mein Device an! Good job, Peter! Danke dafür!
Hallo Peter,
ich verzweifle. Ich bekomme immer die Fehlermeldung:
[GWConnection] Doing handshake to get connection keys/ parameters…
Aug 27, 2018 2:58:46 PM org.eclipse.californium.core.network.CoapEndpoint start
INFO: Starting endpoint at coaps://0.0.0.0:0
Aug 27, 2018 2:58:46 PM org.eclipse.californium.scandium.DTLSConnector start
INFO: DTLS connector listening on [0.0.0.0/0.0.0.0:46520] with MTU [1,280] using (inbound) datagram buffer size [16,474 bytes]
Aug 27, 2018 2:58:46 PM org.eclipse.californium.core.network.CoapEndpoint start
INFO: Started endpoint at coaps://0.0.0.0:46520
Aug 27, 2018 2:58:46 PM org.eclipse.californium.core.CoapClient setEndpoint
INFO: Started set client endpoint 0.0.0.0/0.0.0.0:46520
[GWConnection] Handshake: Using identity “jtr_f0862f”
Exception in thread “main” java.lang.NullPointerException
at net.kappelt.JTradfri.GWConnection.getIdentityInformation(GWConnection.java:253)
at net.kappelt.JTradfri.GWConnection.connectionOpen(GWConnection.java:113)
at net.kappelt.JTradfri.GWConnection.(GWConnection.java:98)
at net.kappelt.JTradfri.JTradfri.start(JTradfri.java:138)
at net.kappelt.JTradfri.JTradfri.main(JTradfri.java:66)
Irgendeine idee ???
danke & Gruß Willi
Hallo,
du bist nicht der einzige mit dem Problem. Ich habe da schon ein wenig dran rumgedoktor, scheint aber nicht wirklich zu helfen. Scheinbar reagiert JTradfri auf dieselbe (?) Antwort vom Gateway auf unterschiedliche Art und Weise.
Momentan bin ich dabei, mich in die Spezifikation vom Protokoll (DTLS) reinzulesen, um da genauer diagnostizieren zu können. Da kann ich aber auch nur begrenzt Zeit reinstecken.
Du würdest mir auf jeden Fall helfen, wenn du den (versuchten) Verbindungsaufbau mitschneiden könntest (z.b. “sudo tcpdump -i dein-netzwerk-interface -w tradfri.dump”) und mir das Ergebnis per Mail schickst.
Viele Grüße,
Peter
Hallo Peter,
gibt es schon was Neues zu dem Problem? Hats du die TCPdump Mitschnitte bekommen, sonst würde ich das nochmal mitschneiden.
Gruß
Florian
Ja, die Mitschnitte wären hilfreich!
Hallo Peter, es ist toll was du hier geleistet hast!!!
Ich habe jTradfri auf einem dienste Server laufen.
Jetzt möchte ich das aus meine FHEM ansprechen (RPi)
Problem ist, dass das FHEM Gateway Modul automatisch auf localhost:1505 zeigt.
Kommt da noch eine neue Version vom Gateway Modul?
Hey Peter, ich habe das Tradfrie Gateway(FHEM Modul)um das attribut JTradfrieSocket erweitert. Damit ist mein Problem gelöst. Möchtest du das haben und in deinem Git bereitstellen? Dann melde dich doch per mail, Danke
Hallo,
bei mir sieht es nur so aus.
WConnection] Doing handshake to get connection keys/ parameters…
Dec 02, 2018 11:47:29 AM org.eclipse.californium.core.network.CoapEndpoint start
INFO: Starting endpoint at coaps://0.0.0.0:0
Dec 02, 2018 11:47:29 AM org.eclipse.californium.scandium.DTLSConnector start
INFO: DTLS connector listening on [0.0.0.0/0.0.0.0:53522] with MTU [1,280] using (inbound) datagram buffer size [16,474 bytes]
Dec 02, 2018 11:47:29 AM org.eclipse.californium.core.network.CoapEndpoint start
INFO: Started endpoint at coaps://0.0.0.0:53522
Dec 02, 2018 11:47:29 AM org.eclipse.californium.core.CoapClient setEndpoint
INFO: Started set client endpoint 0.0.0.0/0.0.0.0:53522
[GWConnection] Handshake: Using identity “jtr_a8f785”
Exception in thread “main” java.lang.NullPointerException
at net.kappelt.JTradfri.GWConnection.getIdentityInformation(GWConnection.java:253)
at net.kappelt.JTradfri.GWConnection.connectionOpen(GWConnection.java:113)
at net.kappelt.JTradfri.GWConnection.(GWConnection.java:98)
at net.kappelt.JTradfri.JTradfri.start(JTradfri.java:138)
at net.kappelt.JTradfri.JTradfri.main(JTradfri.java:66)
Jemand ne Idee?