OH1 Config not loading

Hi all,

I just gave OpenHAB 2b1 a test-drive. However, I seem to experience some problems with getting the old 1.x bindings to work out-of-the box. To be more specific: It seems that the openhab.cfg file does not get loaded correctly on startup. However, if I trigger a refresh by renaming this config file (e.g. to openhab1.cfg) then the 1.x bindings start to work. This is reproducable on each startup. Also, it does not matter if i create separate cg files for the bindings as suggested in the documentation ( https://github.com/openhab/openhab-distro/blob/master/docs/sources/migration.md )

I run OpenHAB 2b1, the online package, with the demo-package being installed on first start. I did not alter the original demo files, except that I did extend these. The bindings I am testing with are the 1.8 bindings of pilight and PioneerAVR. I know that there is a 2.0 binding for the latter one, but in this case I use the old for the sake of testing purposes.

The rest of the config is as follows:
pilight:livingroom.host= pilight:livingroom.port=5000 pilight:livingroom.delay=1000 pioneeravr:livingroom.host= pioneeravr:livingroom.port=8102

...original demo items go here... ... Switch AV_Power "Power" { pioneeravr="INIT:livingroom:POWER_QUERY, OFF:livingroom:POWER_OFF, ON:livingroom:POWER_ON" } Switch AV_Mute "Mute" { pioneeravr="INIT:livingroom:MUTE_QUERY, ON:livingroom:MUTE, OFF:livingroom:UNMUTE" } Number AV_Source "" { pioneeravr="INCREASE:livingroom:SOURCE_UP, DECREASE:livingroom:SOURCE_DOWN, *:livingroom:SOURCE_SET" } Dimmer AV_Volume "Volume [%.1f]%" { pioneeravr="INIT:livingroom:VOLUME_QUERY, INCREASE:livingroom:VOLUME_UP, DECREASE:livingroom:VOLUME_DOWN, *:livingroom:VOLUME_SET" } Switch Light_Staande "StaandeLamp" <light> (LIGHT,Lights) { pilight="livingroom#switch2" }
These snippets of configuration work flawlesly in OpenHAB 1.6 and when I refresh the config file as well. Neither bindings are working on startup, altough the log tells me that pilight is connected succesfully:
20:52:26.667 [INFO ] [ng.pilight.internal.PilightConnector] - Established connection to pilight server at 20:52:39.552 [INFO ] [ternal.PilightGenericBindingProvider] - pilight:livingroom item Light_Staande bound to device switch2
The first line is repeated upon refreshing the cfg. Perhaps this is a problem in the binding itself (wrong order of initialization perhaps?). However, the Pioneed binding does not give me output in the log, but also functions flawlesly after a refresh.

Any ideas?


I think we will have to first find out whether it is the framework, which fails loading the files on startup or it it is a problem of the bindings to process the configs correctly.

Could you please type this in your openHAB console and restart?

log:set DEBUG org.eclipse.smarthome.config.dispatch.internal

You should then see an entry like

10:51:25.223 [DEBUG] [g.dispatch.internal.ConfigDispatcher] - Processing config file 'pilight.cfg'

If this is there, the problem is within the bindings. Then it would be best to enter an issue for each at https://github.com/openhab/openhab/issues, so that these problems can be addressed.

I’m glad this has already been raised as I’ve spent quite a bit of time the last couple of nights trying to pinpoint why my OH2 beta/nightlies couldn’t control my milights anymore which I mentioned briefly here in the start up script thread.

Anecdotally I think it’s something to do with the framework/karaf changes rather than the binding, partly because it was working on OH2 alpha and partly because I’m getting similar/same issue with a different binding.

I turned debugging on for the milight binding and noticed it was using the default port with a blank IP. I double checked my milight.cfg and the settings were correct and when scanning the log there was no sign of the milight.cfg file being loaded.

@Kai are there any significant differences between an extension being installed and manually adding the binding jar to the addons folder? I’m wondering if this is maybe something to look at.

Yes, the OSGi component activation seems to work slightly different with Karaf than it did before. Nonetheless, this is not a fault/bug of Karaf, so that we need to address the issues within the bindings (i.e. they should be good OSGi citizens and behave as expected).[quote=“danielwalters86, post:3, topic:6249”]
@Kai are there any significant differences between an extension being installed and manually adding the binding jar to the addons folder?
No, I don’t think that makes any difference, because in both situations the bundles are installed in the container and started the same way afterwards.

One thing to look at is to mark components to be started “immediately” (like in this PR). This is something that I already encountered that can be a problem.

Indeed, [g.dispatch.internal.ConfigDispatcher] - Processing config file ‘pilight.cfg’ is showing up.

Kai would we expect the binding to have started before the .cfg files are loaded?

Currently I’m seeing .cfg files loaded and then subsequently and gradually the addons are being loaded.

No, the configuration should be provided to the binding as soon as this starts up.

I guess the bit where it’s provided to the binding on start up is the bit that isn’t working correctly then. Any tips on where to start looking at the code in terms of classes/methods?

Same problem here
Run openhab 1.8.2 (online download) now on banana pro with SSD.
openhab starts quite fast but i got errors because config files are not loaded early enough.

is there a fix available for that problem

This issue concerned OpenHAB 2.0b1 actually, not the 1.x branch. I see that 1.8.2 was just released, bu tin 1.8.1 I had no single problem. OpenHAB 2b2 now also runs correctly for me.

Can you tell what is not working for you and post the important parts of the log?

Does this mean that https://github.com/openhab/openhab/issues/3805 can be closed?

Not yet. I am now using a RFXCom, so I haven’t tested OpenHAB 2.0b2 with the pilight 1.9 binding, but I expect that I have some time this evening to test this for you. All 1.9 bindings I did test seem to work with OH2b2 flawlessly.