Problems linking Tradfri Gateway

Hey guys.
I’m new to obenHAB and i wanted to try to get some “real” automation with Tradfri, i.e. when i leave my home and my smartphone disconnects the wifi, lights should turn off.
So i installed openHABianpi on my RPi2 and done the initial setup like in the beginners guide.

I got already my AVM FIrtzBox connected and also the thermostats, which i can control. So it seems i’m doing things right ^^
When trying to connect Tradfri, the binding does not find any devices. Connecting the gateway manually with its ip openHAB tells me, the state is “unknown” and i still can’t find any devices like the lights.
I tried resetting the whole gateway to factory defaults, so it falls back to firmware version 1.0.0008. THEN it’s visible, but when i link it, the state is “UNINITIALIZED - HANDLER_CONFIGURATION_PENDING”.
Guessed i need to do the initial setup over the tradfri app, but doing this, it updates the gateway again to 1.2.42 and the state changes to “offline”. Doing the regular restart, i.e. unplug the power and plug it in again, does not change anything.

Help me plz :frowning:

Security Code ?!?!

Security code can be found on the back side of your Tradfri gateway.

I know. My Answer was mean as Question, because without Security Code you have the Issue he discribe.

Well, i entered the Security Code from the backside, and i guess it was right, cause i checked it twice.
I will still try it on (or two ^^) more time just to be sure.

because without Security Code you have the Issue he discribe

You mean the “UNINITIALIZED - HANDLER_CONFIGURATION_PENDING” error or the “unknown” state error?
And do i have to enter something special into “Thing ID” field? Or is it just a random generated Number?

PS: Just noticed, i see the gateway when searching with the “HTTP binding” for devices, but it’s invisible when searching with teh “tradfri binding”.

I had some difficulty with my Tradfri gateway recenty, around the time that IKEA updated the firmware… which may or may not have been related. I know the code was entered correctly as I presumed this was the problem. It seemed to resolve itself after a few reboots (of the gateway and of openhab). Sorry I can’t be of more help.

Indeed i have not tried rebooting both devices after linking the gateway manually.
I just updated the RPi over ssh and will try it now.

Feedback asap :wink:

So, its done, but still not working :frowning:

Restarted the GW … nothing.
Restarted the RPi … nothing.
Restarted both at the same time and i don’t know, whether it was just bad luck, or the error was associated to each other, but my GW was frozen, so i can’t even control it from the tradfri app on my smartphone.

Finally i did a full factory reset on the GW and done the whole setup thing again (this is so damn nasty to sync all remotes to GW and then sync all bulbs to each remote -.-*).
In this step i also did a full reinstall of openhabian on my RPi and now i just stuck where i startet from…
I can’t find my tradfri … Adding it manually results in “OFFLINE - COMMUNICATION_ERROR”.
But the GW is now up and running, as i can control it through the app and also see in in my FritzBox as a running network device.

PS: only thing i found in the log files:

2017-11-20 16:29:24.275 [ThingAddedEvent ] - Thing ‘tradfri:gateway:409aa389’ has been added.
2017-11-20 16:29:24.341 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:409aa389’ changed from UNINITIALIZED to INITIALIZING
2017-11-20 16:29:24.381 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:409aa389’ changed from INITIALIZING to UNKNOWN
2017-11-20 16:30:37.809 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:409aa389’ changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR)

PPS:
I also tried adding the GW manually by “hardcoding” it into the system. so i removed my GUI added GW and created a tradfri.things file. Added there:

Bridge tradfri:gateway:mygateway [ host=“192.168.178.125”, code="< my actual security code >" ] {
0100 myDimmableBulb [ id=65537 ]
}
Restarted the RPi and … got the same error XD

Oooookaaaay.

I did it finally!!!

You wont believe … The Security Code printed on the backside is WRONG!
I just figured it out, as i was randomly checking everything and extracted the information from the QR code.
A letter, which should be a “g” was printed as “q”, but a few letters on the “g” was again printed as a “g” … so it’s impossible to see it!

Thx for the help guys!

1 Like

Hi!
I Have a very similar problem with my IKEA Tradfri Gateway.
Started out with a Openhab 2.2.1 and that did not detect the gateway at all.
Upgraded to 2.2.2-snap: Now the gateway (Current firmware 1.2.42) is detected with an IP adress but never gets online. I am unsure if The Pre sheared security key is returned from the gateway. I have seen “****” in the line but I am unsure if that was my browser propsing to use the security code as I asked Chrome to remember the “password”


I have tried restarting, rebooting, removing the bindings and installing again without success, and even scanned the DOT matrix code (renegade2k) to ensure that the security code was correctly printed.

See Event Log:

‘tradfri:gateway:gwdcefcabc8263’ changed from OFFLINE (COMMUNICATION_ERROR): No response from gateway. Might be due to an invalid security code. to OFFLINE (CONFIGURATION_ERROR): Either security code or identity and pre-shared key must be provided in the configuration!
2017-11-29 22:38:55.407 [me.event.ThingUpdatedEvent] - Thing ‘tradfri:gateway:gwdcefcabc8263’ has been updated.
2017-11-29 22:38:55.418 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gwdcefcabc8263’ changed from OFFLINE (CONFIGURATION_ERROR): Either security code or identity and pre-shared key must be provided in the configuration! to UNKNOWN
2017-11-29 22:39:05.863 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gwdcefcabc8263’ changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): No response from gateway. Might be due to an invalid security code.
2017-11-29 22:40:38.607 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gwdcefcabc8263’ changed from OFFLINE (COMMUNICATION_ERROR): No response from gateway. Might be due to an invalid security code. to UNINITIALIZED
2017-11-29 22:40:38.614 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gwdcefcabc8263’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2017-11-29 22:41:59.978 [home.event.InboxAddedEvent] - Discovery Result with UID ‘tradfri:gateway:gwdcefcabc8263’ has been added.
2017-11-29 22:41:59.996 [me.event.InboxRemovedEvent] - Discovery Result with UID ‘tradfri:gateway:gwdcefcabc8263’ has been removed.
2017-11-29 22:42:00.023 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gwdcefcabc8263’ changed from INITIALIZING to UNKNOWN
2017-11-29 22:42:00.078 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gwdcefcabc8263’ changed from UNINITIALIZED to INITIALIZING
2017-11-29 22:42:03.410 [me.event.ThingUpdatedEvent] - Thing ‘tradfri:gateway:gwdcefcabc8263’ has been updated.
2017-11-29 22:42:10.734 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gwdcefcabc8263’ changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): No response from gateway. Might be due to an invalid security code.
2017-11-29 22:52:08.919 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gwdcefcabc8263’ changed from REMOVING to REMOVED
2017-11-29 22:52:08.930 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gwdcefcabc8263’ changed from REMOVED to UNINITIALIZED
2017-11-29 22:52:08.992 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gwdcefcabc8263’ changed from OFFLINE (COMMUNICATION_ERROR): No response from gateway. Might be due to an invalid security code. to REMOVING
2017-11-29 22:52:08.995 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gwdcefcabc8263’ changed from REMOVED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2017-11-29 22:52:34.688 [home.event.InboxAddedEvent] - Discovery Result with UID ‘tradfri:gateway:gwdcefcabc8263’ has been added.
2017-11-29 22:55:31.771 [me.event.InboxRemovedEvent] - Discovery Result with UID ‘tradfri:gateway:gwdcefcabc8263’ has been removed.
2017-11-29 22:55:31.778 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gwdcefcabc8263’ changed from INITIALIZING to OFFLINE (CONFIGURATION_ERROR): Either security code or identity and pre-shared key must be provided in the configuration!
2017-11-29 22:55:31.781 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gwdcefcabc8263’ changed from UNINITIALIZED to INITIALIZING
2017-11-29 23:00:00.775 [me.event.ThingUpdatedEvent] - Thing ‘tradfri:gateway:gwdcefcabc8263’ has been updated.
2017-11-29 23:00:00.783 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gwdcefcabc8263’ changed from OFFLINE (CONFIGURATION_ERROR): Either security code or identity and pre-shared key must be provided in the configuration! to UNKNOWN
2017-11-29 23:00:11.262 [hingStatusInfoChangedEvent] - ‘tradfri:gateway:gwdcefcabc8263’ changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): No response from gateway. Might be due to an invalid security code.

I really would appreciate some inputs. This is my first flirt with Openhab and I really would hate to throw the towel.’’

Br. TTNo13
PS: Unsure if it is significant: but in the Openhab.log it was reported that no IP adress was found in the Gatway. It wos online and the right IP adress was shown in the Thing Configuration. (TTNo13)


Started Paper UI at /paperui
2017-11-29 22:05:37.882 [WARN ] [iscovery.TradfriDiscoveryParticipant] - Discovered Tradfri gateway doesn’t have an IP address: [ServiceInfoImpl@4088961 name: ‘gw-dcefcabc8263._coap._udp.local.’ address: ‘(null):0’ status: ‘DNS: JmDNS-IP-1 [/192.168.0.20] state: probing 1 task: null’, has NO data, empty]
2017-11-29 22:05:37.967 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing ‘tradfri:gateway:gwdcefcabc8263’ to inbox.

END

Hm …
I’m really not a pro, but several things seems strange to me.

  1. I see your Headline - “Configuration > Things > Edit > Ikea_Tradfri”. When i edit mine, it looks like "Configuration > Things > Edit > Trådfri Gateway ". Are you sure you chosen the Tradfri Gateway, as you was detecting your “thing”?
  2. You got “identity” which might be the MAC-adress and “Pre-Shared key” which is a riddle to me … Mine for compare:
    Maybe the last point is which makes you GW looks like offline, cause your log says

Either security code or identity and pre-shared key must be provided in the configuration

So it seems even you entered the security key your config still waiting for identitiy and PSK

Thanks for your feedback. The difference in the GUI is because I’m using 2.2.0 snapshot an have named the gateway.
Still not working so I’m getting a little irritated. :slight_smile: I guess I’ll just have to wait for an update.
TT

Hi TTNo13,

did you find a solution for your problem? I have a similar problem with my Tradfri Gateway.

OH2 Release Build 2.2.0 and Tradfri Gateway Firmware 1.3.0.4 should fix all Problems.

and check your Security Code … Scan the QR Code with a Mobilphone and look if the printed Code is similar to the scanned Code …

iOS = Camera App
Android = Any QR Code App

Thanks for your help. I found the solution for my problem. As suggestedin another thread i replaced the network cable.

For later reference:
My OH is “relatively” new and on version 2.2.0 (Openhabian fresh installed at the christmas days). And my Tradfri Gateway is on Firmware 1.3.0.4.

I also had this problem, the “Security code” code was right (both QR and printed) but still didn’t work when I entered it in “Configuration > Things > Edit > Trådfri Gateway”. It guess the obtained “Identity” code was old one, so I had to manually clear that one.

I guess that should be cleared when one are entering a new Sercurity Code.

1 Like