ioBroker / ioBroker.ping

Pings configured IPs for ioBroker
MIT License
21 stars 18 forks source link

other subnet mask is invisble #52

Closed PhagoZ closed 7 months ago

PhagoZ commented 2 years ago

my ioBroker has IP 192.168.0.41 and can´t find my devices which are in area 192.168.31.xxx

Other devices like sonoff via MQTT can communicate between these subnets. My mask at the primary network is set to 255.255.0.0 which causes the IP for the ioBroker. In line behind this router, the secound router is with the standard 255.255.255.0 mask because I can´t change it at this device.

I´m using this adapter for my presence control and before my old network was overloaded because of Iot AND normal usage, it worked great. Now I have an IoT Network and a standard. So our Smartphones are in the standard network 192.168.31.xxx and the ioBroker need to see these devices.

Any idea or workarounds?

Thanks a lot.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions. Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung.

stale[bot] commented 2 years ago

This issue has been automatically closed because of inactivity. Please open a new issue if still relevant and make sure to include all relevant details, logs and reproduction steps. Thank you for your contributions. Dieses Problem wurde aufgrund von Inaktivität automatisch geschlossen. Bitte öffnet ein neues Issue, falls dies noch relevant ist und stellt sicher das alle relevanten Details, Logs und Reproduktionsschritte enthalten sind. Vielen Dank für Eure Unterstützung.

Apollon77 commented 2 years ago

Infact can you ping the wanted IP directly from command line ofn the ioBroker hst? if notz then start checking there first ... If you can then also the adapter should be able to ...

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions. Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung.

mcm1957 commented 1 year ago

I can confirm that theres a problem. If I configure the adapter with IPs from my subnet - everything is working fine. If I configure an external node the adapter displays false while pinging from the commandline shows normal responses.

With debug enabled the following error ist logged

ping.0 | 2022-12-04 20:34:27.700 | debug | STDERR: /bin/ping: 136.243.225.161: Name or service not known
ping.0 | 2022-12-04 20:34:27.679 | debug | System command: /bin/ping -n -w 2 -c 1 136.243.225.161
ping.0 | 2022-12-04 20:34:27.677 | debug | Ping result for 136.243.225.161: false in -ms (Tried 2/3 times)

BUT when executing the same command at the commandline it works normally.

pi@pi4:~ $ /bin/ping -n -w 2 -c 1 136.243.225.161
PING 136.243.225.161 (136.243.225.161) 56(84) bytes of data.
64 bytes from 136.243.225.161: icmp_seq=1 ttl=54 time=24.1 ms

--- 136.243.225.161 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 24.115/24.115/24.115/0.000 ms
pi@pi4:~ $

Even if I use sudo -u iobroker .... everything works normally.

BUT some external addresses (ie 8.8.8.8) work normally.


OK - I could track down my problem. Maybe the OP had the same issue.

The problem is NOT cause by any network related data. I copied the external IP addresses using CTL-C and CTRL-V. This copy added a whitespace after the ip string. ("8.8.8.8 " instead of "8.8.8.8") This whitespace makes its way to the paramter of ping which assumes the string to be a dns name... This results in the error listed above.

The solution would be to trim the ip address string. Trailing / leading whitespaces are never usefull at this place. (If I have time, I will post a PR changing this)

mcm1957 commented 1 year ago

@PhagoZ Could you please check whether a trailing / leading whitespace character at the IP address could be the reason for your problem too ?

If this is not the case please: -) enable debug log and post the output here -) verify that the target is pingable from the iobroker system using the ame ping command as output by debug log.

Thanks

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions. Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung.

mcm1957 commented 1 year ago

Not yet solved

GermanBluefox commented 1 year ago

Please check with 1.6.1. IPs will be trimmed

mcm1957 commented 7 months ago

should be fixed with 1.6.2 https://github.com/ioBroker/ioBroker.ping#162-2023-07-19

@Apollon77 can be closed