fix autodiscover to work with a custom ip

- autodiscover by ip
- todo: better debug logging
- todo: fix spacing issues