OH1 Config not loading

openhab2
Tags: #<Tag:0x00007f6ce4ef71a0>

(Gerwin Hoogsteen) #1

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:
openhab.cfg
pilight:livingroom.host=192.168.1.14
pilight:livingroom.port=5000
pilight:livingroom.delay=1000
pioneeravr:livingroom.host=192.168.1.12
pioneeravr:livingroom.port=8102

demo.items
...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 192.168.1.14:5000
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?


(Kai Kreuzer) #2

Hi,

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.


(Daniel Walters) #3

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.


(Kai Kreuzer) #4

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).

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.


(Gerwin Hoogsteen) #5

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


(Daniel Walters) #6

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.


(Kai Kreuzer) #7

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


(Daniel Walters) #8

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?


(Jens Kluge) #9

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


(Gerwin Hoogsteen) #10

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?


(Jeroen Idserda) #11

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


(Gerwin Hoogsteen) #12

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.