[SOLVED] Windows ping does not work correct

Actually I opened it, had to leave for awhile, came back and didn’t refresh to see the edit. But the same result. You beat me to it. :smiley:

Nope, its OPENHAB\conf\services on a Windows PC.

Those are config files for the Karaf console. Binding configs do not go there. Unless you know what you are doing there should be no need to edit anything in userdata. About the only time you should do anything with files in userdata is:

  • clear the cache
  • changing the logging config
  • changing karaf console login configs
  • fixing a problem (e.g. you removed a broker configuration in mqtt.cfg but the logs indicate the removed one is still there)

If the cfg file is still supported (I have no reason to believe it isn’t) the config will go in conf/services.

The other option I already tried was a network.cfg file in the OPENHAB\conf\services.
I have not tried to put a org.openHAB.binding.network.cfg named file in that folder. I will try that tomorrow.

I started this topic pointing out that the windows ping is not working as it should.
I hope that someone will response to that. If the windows ping works as expected then the problem with the config file is less important (for me).

I’ve seen it reported before that the Windows ping doesn’t work correctly.

I can confirm that the Windows ping is NOT working as expected. I switched back to the old Network Health Binding for my Windows installation.

I did a search but did not find a report of this issue. But there are a lot of topics and I could have simply missed it.

I use windows as a test environment for my Raspberry (‘production’) installation. Therefor the configuration should be as much as possible equal.

I agree and I also would like to use the new network binding. So I am also interested if there is a solution to this.

I opened this topic about 8 motnhs ago:

However at that time I was not aware that this was only a Windows related issue.

I only found out when I looked into the source. Then I search on the internet for an explanation. And I found it, see the link in the first entry. A solution is also in that link.

But not solution for the network Binding. Or do I misunderstand something?

Sorry, I did not mean that I have solved it, but that in the link a solution is given.

The solution would be that the output of the ping process should be tested against some text,
as in:
ping -n 1 %1|Findstr /I /C:“timed out” /C:“host unreachable” /C:“could not find host”

Of course this must be changed in the source code.
I wanted to try it out myself. But just now I can not get the latest developer installation downloaded. The Eclipse Installer gives errors. I am no expert in these matters.

Meanwhile I have tried every combination of cfg-files and folders. But I do not see any change.

If, as said, “A 2.x binding does not read a cfg file at all.” then, I think, the framework of a binding does not give a config file to the network binding. And inside the source of the binding I do not see code that does read a file itself.

In version 2.1 all parameters where given in the thing definition; that worked. If I understand things correctly, these parameters should now be given through a bridge.

The reading of the config file gets done by coffee in esh and the parsed result gets passed to the binding. The binding doesn’t read the configs itself.

OK. That explains that the source code does not read a file.

Some days ago I had placed breakpoints to see if the NetworkBindingConfiguration update function got called and it never happened. I will retry this.

Edit: Only got called with the default values.

Care to try out this test jar? I think it should fix the problem.

Code change is here, for those interested.

I gladly do. But it has to wait until to morrow.

Looks good (on first sight).

Thanks for the effort.

@ namraccr
I have tested the binding on a Windows 10 PC.
Ping now works correctly.
Thanks.

Can you give me some hints about the network.cfg file (name and folder) and the arping.exe file?

OK, I found (a part of) the solution for the config file myself.

For a normal installation: The parameters file for the network binding can be set with the PaperUI. The parameters are then written in a ‘network.config’ file. On Windows this file is in the folder “.\userdata\config\binding”. This file can be edited with an editor like Notepad++.

(During testing with Eclipse I did not see a network.config (or any *.config file). With the PaperUI you can set the parameters, but perhaps they are not saved in a file.
Somehow a network.cfg file inside .\conf\services get processed (logfile: “Processing config file ‘network.cfg’”) but I did not find out what is done with its content.)

PaperUI saves the binding configs down in userdata/config/org/openhab. You should not edit these files directly, but that is where they get saved.

Great. Would you like to open a defect in the OH2 issues list so we can get this added?

@rlkoshak: you are right of course. (But for now it is the only way I can solve it).

I have done so. See https://github.com/openhab/openhab2-addons/issues/3502.