Ankermgmt / ankermake-m5-protocol

Ankermake M5 protocol specifications and libraries *NOT AFFILIATED WITH ANKER*
GNU General Public License v3.0
165 stars 39 forks source link

[BUG] lan-search for printers does not work on Windows 11 #152

Open treitmayr opened 9 months ago

treitmayr commented 9 months ago

During further investigation for PR #150 and Issue #142 I noticed, that ankerctl.py lan-search does not work as expected on Windows 11 in that no printer is found even though the host is on the same network as the printer and the printer is turned on. From Linux computers, the printer could be found without issues.

To Reproduce Steps to reproduce the behavior:

  1. execute ankerctl.py lan-search on a Windows 11 computer
  2. No printer will be detected.

Expected behavior The printer should be detected just the same as on a Linux machine.

Desktop (please complete the following information):

Initial Analysis The following observations where done:

So the solution for a Windows code path might be to determine all local network addresses and send out the broadcast individually from each of these addresses. I already found a library ifaddr which seems to do the job well according to initial tests.

treitmayr commented 9 months ago

I provided a fix in commit 2b6c402ed7887ef8d0e45ccd3f78204107ddb52a as part of PR #150.