Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: log DHCP lease assignments, or web ui showing table of assigned IPs #68

Open
malkowski opened this issue Mar 8, 2024 · 8 comments
Assignees
Labels
enhancement New feature or request fix incoming Issue should be fixed in next release

Comments

@malkowski
Copy link

I have a handful of tasmota devices, which pull IP addresses. I'm using this HomeAssistant add-on to create a WAP which these devices can connect to without killing my main AP performance. Problem is, I can't see which IPs the devices are actually assigned.

MVP: log MAC+IP leases in e.g. /hassio/addon/30e576d0_hassio-access-point/logs

Ideal: add a view in the addon which displays a table of current leases, with MAC + IP.

Bonus: ability to assign IPs based on MAC

@malkowski
Copy link
Author

malkowski commented Mar 8, 2024

if there's a way to do this already that i'm not aware of, please let me know. given that wlan0 doesn't even show as configured within the main HomeAssistant shell, I'm thinking this is probably something that needs to be done within the addon, but I'm still just getting my feet wet with HomeAssistant (finally migrated from homebridge and man, i do not know what took me so long).

@ROBOT0-VT
Copy link
Collaborator

Hiya,

AFAIK DNSMASQ can be configured to output leases to a file, I'd just have to figure out how to set that up and have that file be automatically logged. Will put this on the backlog =)

Ideal likely isn't gonna happen, I'm the only active maintainer and I'm really not up to write a UI at this stage :D

As for the bonus, that's already possible (although not intuitive) through the DNSMASQ config override by adding the highlighted line for every host to be bound. I'll look into making this more obvious/accessible in future.

@malkowski
Copy link
Author

Thanks for the quick reply! I had been trying to use "dhcp-host:" rather than "dhcp-host=", not sure where that came from. Correct syntax helps things work correctly, go figure. 🤣

I got dnsmasq logs to show up in the addon logs, just needed log-dhcp and more importantly log-facility=- to send logs to stderr rather than syslog or whatever it's default is.

@ROBOT0-VT
Copy link
Collaborator

Schweet. I'm in the process of refactoring networking and logging, so thank you for the nice contribution =)

If you have time, an optional code/config sample or a PR would be appreciated (although I'll probably close any PR because the refactor is going to break merges)

@ROBOT0-VT ROBOT0-VT self-assigned this Mar 11, 2024
@ROBOT0-VT ROBOT0-VT added enhancement New feature or request fix incoming Issue should be fixed in next release labels Mar 26, 2024
ROBOT0-VT added a commit to ROBOT0-VT/Hassio-Access-Point that referenced this issue Apr 6, 2024
@Domigome
Copy link

Domigome commented Apr 17, 2024

Maybe this feature can help us to link devices not found by the automatic discovery?

I'm really stuck because the only way I have to link devices is manually writing their IPs, but some devices that I do not know the IP all I have is their mac address by the log of Hassio-access-point.

@ROBOT0-VT could this help me? Maybe I can try your last commit if there is something to see IPs.

edit: I wonder if we could trigger the device discovery every time a new device does the handshake with the addon (and the addon detects it is not a registered entity).

@ROBOT0-VT
Copy link
Collaborator

Hiya, the fix for this is incoming, it's just in between a bunch of half-refactored code. If you'd like to try this fix yourself, you can add the lines @malkowski listed to the DNS config override

@malkowski
Copy link
Author

malkowski commented Apr 18, 2024

@Domigome I've attached a screenshot of my DNSMASQ custom configuration if it helps.

Screenshot 2024-04-18 at 10 14 58

@Domigome
Copy link

Domigome commented Jun 22, 2024

@malkowski @ROBOT0-VT Has arrived the day I needed to add a new device, and even with those settings, device seems connected properly but cannot discover it:

wlan0: STA 28:87:ba:89:93:6a IEEE 802.11: associated
wlan0: AP-STA-CONNECTED 28:87:ba:89:93:6a
wlan0: STA 28:87:ba:89:93:6a RADIUS: starting accounting session E7D2F61A2FB342CD
wlan0: STA 28:87:ba:89:93:6a WPA: pairwise key handshake completed (RSN)
wlan0: EAPOL-4WAY-HS-COMPLETED 28:87:ba:89:93:6a

If I could see the IP somehow, that would be enough to discover the device in the discovery, but only seeing the mac address I am not sure how to proceed, any idea what could I try?

edit: A temporal solution though no ideal was to use https://github.com/angryip/ipscan to scan and list all IPs: power off the new device, scan and list all the IPs (screen-shoot the list). Power on the new device and scan again to find the new IP, use that IP on the discovery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fix incoming Issue should be fixed in next release
Projects
None yet
Development

No branches or pull requests

3 participants