I have recently set up a Raspberry Pi in my home with the openhabian image (running OH 2.1.0 stable).
Additionally I have installed Node-Red from the OpenHabian Configuration Tool.
After setting up the OH-Controller in the openhab2-node configuration in Node-Red (Protocol: http, Host: openhabianpi, Port: 8080). I get all my Items listed and I can select one.
However, I immedeately get the following error (red) in the debug tab (once):
msg:error
TypeError: Cannot read property ‘close’ of undefined
Afterwards I repeatedly (every 2-3 seconds) get the following warning(?)(orange) in the debug tab:
msg : string [35]
ERROR
{“type”:“error”,“status”:404}
If I delete the controller, the repeated warning messaged don’t stop, until I restart the Node-Red Service.
The Item state below the node then only shows a “?”.
I also tried to reach OpenHab with a second Pi (with an old setup, OH2.0) but I run into the same issue. The old OH2.0 setup however can be reached from both Node-Red setups, so I doubt this is an issue with Node-Red.
Did anybody ever run into a similar problem?
Any help, or even a pointer in the right direction would be appreciated.
@Peter_De_Mangelaere Did you get a chance to test this and see if there were issues with all the changes in the new versions?
Personally, I ended up setting up a mosquitto server and switching to mqtt (was on my to do list anyways and when I started getting similar errors I just made the jump).
I wasn’t having any issues with the previous version so wonder if there was a change in OH about the same time. I was able to get an openhab-get nodes to pull fine, it was just the openhab-in nodes.
Agree that msqtt isn’t quite as convenient but I got to imagine it’s a little faster and less resource intensive then checking a REST api. It didn’t take too long to switch them all over just miss the -get nodes options and having to use flow variables instead. I never heard back from Peter on my previous posting so hopefully this one catches his attention and he can look into it.
Alright so I figured out what the problem was by myself.
Problem:
I looked into the source code of the openhab2-in nodes and noticed that they use a class called eventsource. This basically sets up a listener for “Server-Sent Events”.
However in my OpenHAB-Setup (and I’m assuming it will be the same for all OpenHABian setups) this was disabled by default.
Solution:
1: Navigate to your openHAB application runtime directory.
For OpenHABian this will be /user/share/openhab2/runtime
For a manual installation it will be /opt/openhab2/runtime - I think
cd <application runtime path>
2: Open services.cfg with your preferred text editor