snstac / aiscot

Display Ships in TAK - AIS to TAK Gateway
https://github.com/snstac/aiscot
Apache License 2.0
41 stars 11 forks source link

Running on Windows fails with `ValueError: can not get address information` #7

Open ampledata opened 1 year ago

ampledata commented 1 year ago
PS C:\Users\gba> C:\Users\gba\AppData\Roaming\Python\Python39\Scripts\aiscot.exe
c:\python39\lib\site-packages\pytak\crypto_functions.py:40: UserWarning: Python cryptography module not installed. Install with:  python3 -m pip install cryptography
  warnings.warn(INSTALL_MSG)
Traceback (most recent call last):
  File "c:\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\gba\AppData\Roaming\Python\Python39\Scripts\aiscot.exe\__main__.py", line 7, in <module>
  File "C:\Users\gba\AppData\Roaming\Python\Python39\site-packages\aiscot\commands.py", line 28, in main
    pytak.cli(__name__.split('.', maxsplit=1)[0])
  File "c:\python39\lib\site-packages\pytak\client_functions.py", line 438, in cli
    asyncio.run(main(app_name, config, full_config), debug=debug)
  File "c:\python39\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "c:\python39\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "c:\python39\lib\site-packages\pytak\client_functions.py", line 324, in main
    await clitool.create_workers(config)
  File "c:\python39\lib\site-packages\pytak\classes.py", line 320, in create_workers
    reader, writer = await pytak.protocol_factory(i_config)
  File "c:\python39\lib\site-packages\pytak\client_functions.py", line 262, in protocol_factory
    reader, writer = await pytak.create_udp_client(cot_url, iface, local_addr)
  File "c:\python39\lib\site-packages\pytak\client_functions.py", line 96, in create_udp_client
    writer: DatagramClient = await dgconnect((host, port), local_addr=local_addr)
  File "c:\python39\lib\site-packages\pytak\asyncio_dgram\aio.py", line 270, in connect
    transport, protocol = await loop.create_datagram_endpoint(
  File "c:\python39\lib\asyncio\base_events.py", line 1315, in create_datagram_endpoint
    raise ValueError('can not get address information')
ValueError: can not get address information
ampledata commented 1 year ago

Fix:

Set the env var $env:PYTAK_MULTICAST_LOCAL_ADDR = '0.0.0.0' before running aiscot