tobiipro / g3pylib

A Python client library for Glasses3
Other
15 stars 7 forks source link

Failing test suite - Temporary failure in name resolution #82

Closed edavalosanaya closed 1 year ago

edavalosanaya commented 1 year ago

Hello!

I am trying to develop my own application using the Python client for Tobii Glasses 3. After following the installation instructions shown here, I ran the test suite and had all failing tests. To reduce the print dump, I am only showing the output test_connect_to_glasses.py:

(test) eduardo@avocado-MS-7C83:~/GitHub/g3pylib/tests$ python -m pytest test_connect_to_glasses.py 
======================================================== test session starts =========================================================
platform linux -- Python 3.10.4, pytest-7.1.3, pluggy-1.0.0
rootdir: /home/eduardo/GitHub/g3pylib, configfile: pyproject.toml
plugins: dotenv-0.5.2, asyncio-0.19.0
asyncio: mode=auto
collected 6 items                                                                                                                    

test_connect_to_glasses.py FFFFFF                                                                                              [100%]

============================================================== FAILURES ==============================================================
__________________________________________ test_connect_with_hostname_using_zeroconf_and_ip __________________________________________

g3_hostname = 'tg03b-080201035331'

    async def test_connect_with_hostname_using_zeroconf_and_ip(g3_hostname: str):
>       async with connect_to_glasses.with_hostname(
            g3_hostname, using_zeroconf=True, using_ip=True
        ) as g3:

test_connect_to_glasses.py:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:312: in __aenter__
    return await self
../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:300: in __await_impl__
    ws_url, rtsp_url, http_url = await self.url_generator
../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:240: in _urls_from_hostname
    service = await G3ServiceDiscovery.request_service(hostname)
../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/zeroconf.py:281: in request_service
    await service.request(async_zeroconf.zeroconf, timeout)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = G3Service(hostname='tg03b-080201035331', type='_tobii-g3api._tcp.local.', server='tg03b-080201035331._tobii-g3api._tcp.local.',
 ipv4_address=None, ipv6_address=None)
zc = <zeroconf._core.Zeroconf object at 0x7fe719a4b640>, timeout = 3000

    async def request(self, zc: Zeroconf, timeout: float = 3000) -> None:
        """Attempts to update the services' information and raises `ServiceNotFoundError` when the services can't be found on the netw
ork."""
        success = await self.service_info.async_request(zc, timeout)
        if not success:
>           raise ServiceNotFoundError
E           g3pylib.zeroconf.ServiceNotFoundError

../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/zeroconf.py:147: ServiceNotFoundError
_________________________________________________ test_connect_with_service_using_ip _________________________________________________

g3_hostname = 'tg03b-080201035331'

    async def test_connect_with_service_using_ip(g3_hostname: str):
>       g3_service = await G3ServiceDiscovery.request_service(g3_hostname)

test_connect_to_glasses.py:28: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/zeroconf.py:281: in request_service
    await service.request(async_zeroconf.zeroconf, timeout)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = G3Service(hostname='tg03b-080201035331', type='_tobii-g3api._tcp.local.', server='tg03b-080201035331._tobii-g3api._tcp.local.',
 ipv4_address=None, ipv6_address=None)
zc = <zeroconf._core.Zeroconf object at 0x7fe71990f610>, timeout = 3000

    async def request(self, zc: Zeroconf, timeout: float = 3000) -> None:
        """Attempts to update the services' information and raises `ServiceNotFoundError` when the services can't be found on the netw
ork."""
        success = await self.service_info.async_request(zc, timeout)
        if not success:
>           raise ServiceNotFoundError
E           g3pylib.zeroconf.ServiceNotFoundError

../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/zeroconf.py:147: ServiceNotFoundError
______________________________________________ test_connect_with_service_using_hostname ______________________________________________

g3_hostname = 'tg03b-080201035331'

    async def test_connect_with_service_using_hostname(g3_hostname: str):
>       g3_service = await G3ServiceDiscovery.request_service(g3_hostname)

test_connect_to_glasses.py:35: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/zeroconf.py:281: in request_service
    await service.request(async_zeroconf.zeroconf, timeout)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = G3Service(hostname='tg03b-080201035331', type='_tobii-g3api._tcp.local.', server='tg03b-080201035331._tobii-g3api._tcp.local.',
 ipv4_address=None, ipv6_address=None)
zc = <zeroconf._core.Zeroconf object at 0x7fe7198b25f0>, timeout = 3000

    async def request(self, zc: Zeroconf, timeout: float = 3000) -> None:
        """Attempts to update the services' information and raises `ServiceNotFoundError` when the services can't be found on the netw
ork."""
        success = await self.service_info.async_request(zc, timeout)
        if not success:
>           raise ServiceNotFoundError
E           g3pylib.zeroconf.ServiceNotFoundError

../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/zeroconf.py:147: ServiceNotFoundError
_______________________________________ test_connect_with_hostname_using_zeroconf_and_hostname _______________________________________

g3_hostname = 'tg03b-080201035331'

    async def test_connect_with_hostname_using_zeroconf_and_hostname(g3_hostname: str):
>       async with connect_to_glasses.with_hostname(
            g3_hostname, using_zeroconf=True, using_ip=False
        ) as g3:

test_connect_to_glasses.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:312: in __aenter__
    return await self
../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:300: in __await_impl__
    ws_url, rtsp_url, http_url = await self.url_generator
../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:240: in _urls_from_hostname
    service = await G3ServiceDiscovery.request_service(hostname)
../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/zeroconf.py:281: in request_service
    await service.request(async_zeroconf.zeroconf, timeout)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = G3Service(hostname='tg03b-080201035331', type='_tobii-g3api._tcp.local.', server='tg03b-080201035331._tobii-g3api._tcp.local.',
 ipv4_address=None, ipv6_address=None)
zc = <zeroconf._core.Zeroconf object at 0x7fe7198dff70>, timeout = 3000

    async def request(self, zc: Zeroconf, timeout: float = 3000) -> None:
        """Attempts to update the services' information and raises `ServiceNotFoundError` when the services can't be found on the netw
ork."""
        success = await self.service_info.async_request(zc, timeout)
        if not success:
>           raise ServiceNotFoundError
E           g3pylib.zeroconf.ServiceNotFoundError

../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/zeroconf.py:147: ServiceNotFoundError
_______________________________________________ test_connect_with_hostname_no_zeroconf _______________________________________________

g3_hostname = 'tg03b-080201035331'

    async def test_connect_with_hostname_no_zeroconf(g3_hostname: str):
>       async with connect_to_glasses.with_hostname(
            g3_hostname, using_zeroconf=False
        ) as g3:

test_connect_to_glasses.py:50: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:312: in __aenter__
    return await self
../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:305: in __await_impl__
    G3WebSocketClientProtocol, await g3pylib.websocket.connect(ws_url)
../../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:650: in __await_impl_timeout__
    return await asyncio.wait_for(self.__await_impl__(), self.open_timeout)
../../../anaconda3/envs/test/lib/python3.10/asyncio/tasks.py:445: in wait_for
    return fut.result()
../../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:654: in __await_impl__
    transport, protocol = await self._create_connection()
../../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1025: in create_connection
    infos = await self._ensure_resolved(
../../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1404: in _ensure_resolved
    return await loop.getaddrinfo(host, port, family=family, type=type,
../../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:860: in getaddrinfo
    return await self.run_in_executor(
../../../anaconda3/envs/test/lib/python3.10/concurrent/futures/thread.py:58: in run
    result = self.fn(*self.args, **self.kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

host = 'tg03b-080201035331', port = 80, family = 0, type = <SocketKind.SOCK_STREAM: 1>, proto = 0, flags = 0

    def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0):
        """Resolve host and port into list of address info entries.

        Translate the host/port argument into a sequence of 5-tuples that contain
        all the necessary arguments for creating a socket connected to that service.
        host is a domain name, a string representation of an IPv4/v6 address or
        None. port is a string service name such as 'http', a numeric port number or
        None. By passing None as the value of host and port, you can pass NULL to
        the underlying C API.

        The family, type and proto arguments can be optionally specified in order to
        narrow the list of addresses returned. Passing zero as a value for each of
        these arguments selects the full range of results.
        """
        # We override this function since we want to translate the numeric family
        # and socket type values to enum constants.
        addrlist = []
>       for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E       socket.gaierror: [Errno -3] Temporary failure in name resolution

../../../anaconda3/envs/test/lib/python3.10/socket.py:955: gaierror
_______________________________________________________ test_connect_with_urls _______________________________________________________

g3_hostname = 'tg03b-080201035331'

    async def test_connect_with_urls(g3_hostname: str):
>       async with connect_to_glasses.with_url(
            f"ws://{g3_hostname}{DEFAULT_WEBSOCKET_PATH}",
            f"rtsp://{g3_hostname}:{DEFAULT_RTSP_PORT}{DEFAULT_RTSP_LIVE_PATH}",
            f"http://{g3_hostname}:{DEFAULT_HTTP_PORT}",
        ) as g3:

test_connect_to_glasses.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:312: in __aenter__
    return await self
../../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:305: in __await_impl__
    G3WebSocketClientProtocol, await g3pylib.websocket.connect(ws_url)
../../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:650: in __await_impl_timeout__
    return await asyncio.wait_for(self.__await_impl__(), self.open_timeout)
../../../anaconda3/envs/test/lib/python3.10/asyncio/tasks.py:445: in wait_for
    return fut.result()
../../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:654: in __await_impl__
    transport, protocol = await self._create_connection()
../../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1025: in create_connection
    infos = await self._ensure_resolved(
../../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1404: in _ensure_resolved
    return await loop.getaddrinfo(host, port, family=family, type=type,
../../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:860: in getaddrinfo
    return await self.run_in_executor(
../../../anaconda3/envs/test/lib/python3.10/concurrent/futures/thread.py:58: in run
    result = self.fn(*self.args, **self.kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

host = 'tg03b-080201035331', port = 80, family = 0, type = <SocketKind.SOCK_STREAM: 1>, proto = 0, flags = 0

    def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0):
        """Resolve host and port into list of address info entries.

        Translate the host/port argument into a sequence of 5-tuples that contain
        all the necessary arguments for creating a socket connected to that service.
        host is a domain name, a string representation of an IPv4/v6 address or
        None. port is a string service name such as 'http', a numeric port number or
        None. By passing None as the value of host and port, you can pass NULL to
        the underlying C API.

        The family, type and proto arguments can be optionally specified in order to
        narrow the list of addresses returned. Passing zero as a value for each of
        these arguments selects the full range of results.
        """
        # We override this function since we want to translate the numeric family
        # and socket type values to enum constants.
        addrlist = []
>       for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E       socket.gaierror: [Errno -3] Temporary failure in name resolution

../../../anaconda3/envs/test/lib/python3.10/socket.py:955: gaierror
====================================================== short test summary info =======================================================
FAILED test_connect_to_glasses.py::test_connect_with_hostname_using_zeroconf_and_ip - g3pylib.zeroconf.ServiceNotFoundError
FAILED test_connect_to_glasses.py::test_connect_with_service_using_ip - g3pylib.zeroconf.ServiceNotFoundError
FAILED test_connect_to_glasses.py::test_connect_with_service_using_hostname - g3pylib.zeroconf.ServiceNotFoundError
FAILED test_connect_to_glasses.py::test_connect_with_hostname_using_zeroconf_and_hostname - g3pylib.zeroconf.ServiceNotFoundError
FAILED test_connect_to_glasses.py::test_connect_with_hostname_no_zeroconf - socket.gaierror: [Errno -3] Temporary failure in name r...
FAILED test_connect_to_glasses.py::test_connect_with_urls - socket.gaierror: [Errno -3] Temporary failure in name resolution
========================================================= 6 failed in 12.35s =========================================================

I assume that the issue is setting up the .env file, here is my file:

G3_HOSTNAME=tg03b-080201035331

I looked up my network configurations and scanned my network for hostnames and got the following response:

(test) eduardo@avocado-MS-7C83:~/GitHub/g3pylib/tests$ ifconfig
br-87cd2f513d81: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.18.0.1  netmask 255.255.0.0  broadcast 172.18.255.255
        ether 02:42:a9:b2:cc:1c  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:fb:bc:7f:7f  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp3s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 2c:f0:5d:93:25:cd  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ham0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1404
        inet 25.69.22.53  netmask 255.0.0.0  broadcast 25.255.255.255
        inet6 2620:9b::1945:1635  prefixlen 96  scopeid 0x0<global>
        inet6 fe80::7879:19ff:fe45:1635  prefixlen 64  scopeid 0x20<link>
        ether 7a:79:19:45:16:35  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 621  bytes 91836 (91.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 7359  bytes 773084 (773.0 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7359  bytes 773084 (773.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.75.63  netmask 255.255.255.0  broadcast 192.168.75.255
        inet6 fe80::1099:1a8c:d87:42f5  prefixlen 64  scopeid 0x20<link>
        ether 9c:29:76:f4:d5:71  txqueuelen 1000  (Ethernet)
        RX packets 197770  bytes 273374829 (273.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 30846  bytes 5434138 (5.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

(test) eduardo@avocado-MS-7C83:~/GitHub/g3pylib/tests$ nmap -sP 192.168.75.0/24
Starting Nmap 7.80 ( https://nmap.org ) at 2022-09-27 06:49 CDT
Nmap scan report for _gateway (192.168.75.51)
Host is up (0.0022s latency).
Nmap scan report for avocado-MS-7C83 (192.168.75.63)
Host is up (0.0016s latency).
Nmap done: 256 IP addresses (2 hosts up) scanned in 6.80 seconds

I noticed that the hostname for the Tobii Glasses 3 was _gateway so I tried using that as the hostname, but I still had the same issue. Not sure how to proceed. Let me know how I can help.

Best, Eduardo Davalos

edavalosanaya commented 1 year ago

Update: created a new virtual environment and reinstall the package. Now I have 2/6 tests passing:

================================================================================================================================ test session starts =================================================================================================================================
platform linux -- Python 3.10.4, pytest-7.1.3, pluggy-1.0.0
rootdir: /home/eduardo/GitHub/g3pylib, configfile: pyproject.toml
plugins: dotenv-0.5.2, asyncio-0.19.0
asyncio: mode=auto
collected 6 items                                                                                                                                                                                                                                                                    

tests/test_connect_to_glasses.py::test_connect_with_hostname_using_zeroconf_and_ip 
----------------------------------------------------------------------------------------------------------------------------------- live log setup -----------------------------------------------------------------------------------------------------------------------------------
2022-09-27 07:41:23 [   DEBUG] Using selector: EpollSelector (selector_events.py:54)
2022-09-27 07:41:23 [   DEBUG] Using selector: EpollSelector (selector_events.py:54)
----------------------------------------------------------------------------------------------------------------------------------- live log call ------------------------------------------------------------------------------------------------------------------------------------
2022-09-27 07:41:23 [    INFO] Attempting connection to websocket ws://192.168.75.51/websocket, RTSP rtsp://192.168.75.51:8554/live/all and HTTP http://192.168.75.51:80 (__init__.py:301)
2022-09-27 07:41:23 [   DEBUG] = connection is CONNECTING (protocol.py:253)
2022-09-27 07:41:23 [   DEBUG] > GET /websocket HTTP/1.1 (client.py:111)
2022-09-27 07:41:23 [   DEBUG] > Host: 192.168.75.51 (client.py:113)
2022-09-27 07:41:23 [   DEBUG] > Upgrade: websocket (client.py:113)
2022-09-27 07:41:23 [   DEBUG] > Connection: Upgrade (client.py:113)
2022-09-27 07:41:23 [   DEBUG] > Sec-WebSocket-Key: LsclESXGmIqY+3PiK2mHMg== (client.py:113)
2022-09-27 07:41:23 [   DEBUG] > Sec-WebSocket-Version: 13 (client.py:113)
2022-09-27 07:41:23 [   DEBUG] > Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits (client.py:113)
2022-09-27 07:41:23 [   DEBUG] > Sec-WebSocket-Protocol: g3api (client.py:113)
2022-09-27 07:41:23 [   DEBUG] > User-Agent: Python/3.10 websockets/10.3 (client.py:113)
2022-09-27 07:41:23 [   DEBUG] < HTTP/1.1 101 Switching Protocols (client.py:144)
2022-09-27 07:41:23 [   DEBUG] < Server: Servd (client.py:146)
2022-09-27 07:41:23 [   DEBUG] < Date: Tue, 27 Sep 2022 13:38:16 GMT (client.py:146)
2022-09-27 07:41:23 [   DEBUG] < Access-Control-Allow-Origin: * (client.py:146)
2022-09-27 07:41:23 [   DEBUG] < Upgrade: websocket (client.py:146)
2022-09-27 07:41:23 [   DEBUG] < Connection: Upgrade (client.py:146)
2022-09-27 07:41:23 [   DEBUG] < Sec-WebSocket-Accept: tPxz5vhKgYE5BJpNb+BSEBPtPQ8= (client.py:146)
2022-09-27 07:41:23 [   DEBUG] < Sec-WebSocket-Protocol: g3api (client.py:146)
2022-09-27 07:41:23 [   DEBUG] < Content-Length: 0 (client.py:146)
2022-09-27 07:41:23 [   DEBUG] = connection is OPEN (protocol.py:342)
2022-09-27 07:41:23 [   DEBUG] Receiver task starting (__init__.py:224)
2022-09-27 07:41:23 [   DEBUG] > TEXT '{"path": "/system.recording-unit-serial", "method": "GET", "id": 1}' [67 bytes] (protocol.py:1158)
2022-09-27 07:41:23 [   DEBUG] < TEXT '{"id":1,"body":"TG03B-080201035331"}' [36 bytes] (protocol.py:1152)
2022-09-27 07:41:23 [   DEBUG] Received {'id': 1, 'body': 'TG03B-080201035331'} (__init__.py:196)
2022-09-27 07:41:23 [   DEBUG] receiver task cancelled (__init__.py:286)
2022-09-27 07:41:23 [   DEBUG] = connection is CLOSING (protocol.py:1207)
2022-09-27 07:41:23 [   DEBUG] > CLOSE 1000 (OK) [2 bytes] (protocol.py:1158)
2022-09-27 07:41:23 [   DEBUG] < CLOSE 1000 (OK) [2 bytes] (protocol.py:1152)
2022-09-27 07:41:23 [   DEBUG] = connection is CLOSED (protocol.py:1489)
PASSED                                                                                                                                                                                                                                                                         [ 16%]
tests/test_connect_to_glasses.py::test_connect_with_service_using_ip 
----------------------------------------------------------------------------------------------------------------------------------- live log call ------------------------------------------------------------------------------------------------------------------------------------
2022-09-27 07:41:23 [    INFO] Attempting connection to websocket ws://192.168.75.51/websocket, RTSP rtsp://192.168.75.51:8554/live/all and HTTP http://192.168.75.51:80 (__init__.py:301)
2022-09-27 07:41:23 [   DEBUG] = connection is CONNECTING (protocol.py:253)
2022-09-27 07:41:23 [   DEBUG] > GET /websocket HTTP/1.1 (client.py:111)
2022-09-27 07:41:23 [   DEBUG] > Host: 192.168.75.51 (client.py:113)
2022-09-27 07:41:23 [   DEBUG] > Upgrade: websocket (client.py:113)
2022-09-27 07:41:23 [   DEBUG] > Connection: Upgrade (client.py:113)
2022-09-27 07:41:23 [   DEBUG] > Sec-WebSocket-Key: 89gP7iBzvKZYRaRELr2QAQ== (client.py:113)
2022-09-27 07:41:23 [   DEBUG] > Sec-WebSocket-Version: 13 (client.py:113)
2022-09-27 07:41:23 [   DEBUG] > Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits (client.py:113)
2022-09-27 07:41:23 [   DEBUG] > Sec-WebSocket-Protocol: g3api (client.py:113)
2022-09-27 07:41:23 [   DEBUG] > User-Agent: Python/3.10 websockets/10.3 (client.py:113)
2022-09-27 07:41:23 [   DEBUG] < HTTP/1.1 101 Switching Protocols (client.py:144)
2022-09-27 07:41:23 [   DEBUG] < Server: Servd (client.py:146)
2022-09-27 07:41:23 [   DEBUG] < Date: Tue, 27 Sep 2022 13:38:16 GMT (client.py:146)
2022-09-27 07:41:23 [   DEBUG] < Access-Control-Allow-Origin: * (client.py:146)
2022-09-27 07:41:23 [   DEBUG] < Upgrade: websocket (client.py:146)
2022-09-27 07:41:23 [   DEBUG] < Connection: Upgrade (client.py:146)
2022-09-27 07:41:23 [   DEBUG] < Sec-WebSocket-Accept: K09OjVF/ehZk5LyRf+0cekfoJ3Y= (client.py:146)
2022-09-27 07:41:23 [   DEBUG] < Sec-WebSocket-Protocol: g3api (client.py:146)
2022-09-27 07:41:23 [   DEBUG] < Content-Length: 0 (client.py:146)
2022-09-27 07:41:23 [   DEBUG] = connection is OPEN (protocol.py:342)
2022-09-27 07:41:23 [   DEBUG] Receiver task starting (__init__.py:224)
2022-09-27 07:41:23 [   DEBUG] > TEXT '{"path": "/system.recording-unit-serial", "method": "GET", "id": 1}' [67 bytes] (protocol.py:1158)
2022-09-27 07:41:23 [   DEBUG] < TEXT '{"id":1,"body":"TG03B-080201035331"}' [36 bytes] (protocol.py:1152)
2022-09-27 07:41:23 [   DEBUG] Received {'id': 1, 'body': 'TG03B-080201035331'} (__init__.py:196)
2022-09-27 07:41:23 [   DEBUG] receiver task cancelled (__init__.py:286)
2022-09-27 07:41:23 [   DEBUG] = connection is CLOSING (protocol.py:1207)
2022-09-27 07:41:23 [   DEBUG] > CLOSE 1000 (OK) [2 bytes] (protocol.py:1158)
2022-09-27 07:41:23 [   DEBUG] < CLOSE 1000 (OK) [2 bytes] (protocol.py:1152)
2022-09-27 07:41:23 [   DEBUG] = connection is CLOSED (protocol.py:1489)
PASSED                                                                                                                                                                                                                                                                         [ 33%]
tests/test_connect_to_glasses.py::test_connect_with_service_using_hostname 
----------------------------------------------------------------------------------------------------------------------------------- live log call ------------------------------------------------------------------------------------------------------------------------------------
2022-09-27 07:41:23 [    INFO] Attempting connection to websocket ws://TG03B-080201035331/websocket, RTSP rtsp://TG03B-080201035331:8554/live/all and HTTP http://TG03B-080201035331:80 (__init__.py:301)
FAILED                                                                                                                                                                                                                                                                         [ 50%]
tests/test_connect_to_glasses.py::test_connect_with_hostname_using_zeroconf_and_hostname 
----------------------------------------------------------------------------------------------------------------------------------- live log call ------------------------------------------------------------------------------------------------------------------------------------
2022-09-27 07:41:23 [    INFO] Attempting connection to websocket ws://TG03B-080201035331/websocket, RTSP rtsp://TG03B-080201035331:8554/live/all and HTTP http://TG03B-080201035331:80 (__init__.py:301)
FAILED                                                                                                                                                                                                                                                                         [ 66%]
tests/test_connect_to_glasses.py::test_connect_with_hostname_no_zeroconf 
----------------------------------------------------------------------------------------------------------------------------------- live log call ------------------------------------------------------------------------------------------------------------------------------------
2022-09-27 07:41:24 [    INFO] Attempting connection to websocket ws://tg03b-080201035331/websocket, RTSP rtsp://tg03b-080201035331:8554/live/all and HTTP http://tg03b-080201035331:80 (__init__.py:301)
FAILED                                                                                                                                                                                                                                                                         [ 83%]
tests/test_connect_to_glasses.py::test_connect_with_urls 
----------------------------------------------------------------------------------------------------------------------------------- live log call ------------------------------------------------------------------------------------------------------------------------------------
2022-09-27 07:41:24 [    INFO] Attempting connection to websocket ws://tg03b-080201035331/websocket, RTSP rtsp://tg03b-080201035331:8554/live/all and HTTP http://tg03b-080201035331:80 (__init__.py:301)
FAILED                                                                                                                                                                                                                                                                         [100%]
--------------------------------------------------------------------------------------------------------------------------------- live log teardown ----------------------------------------------------------------------------------------------------------------------------------
2022-09-27 07:41:24 [   DEBUG] Using selector: EpollSelector (selector_events.py:54)
2022-09-27 07:41:24 [   DEBUG] Using selector: EpollSelector (selector_events.py:54)
2022-09-27 07:41:24 [   DEBUG] Using selector: EpollSelector (selector_events.py:54)
2022-09-27 07:41:24 [   DEBUG] Using selector: EpollSelector (selector_events.py:54)
2022-09-27 07:41:24 [   DEBUG] Using selector: EpollSelector (selector_events.py:54)
2022-09-27 07:41:24 [   DEBUG] Using selector: EpollSelector (selector_events.py:54)

====================================================================================================================================== FAILURES ======================================================================================================================================
______________________________________________________________________________________________________________________ test_connect_with_service_using_hostname ______________________________________________________________________________________________________________________

g3_hostname = 'tg03b-080201035331'

    async def test_connect_with_service_using_hostname(g3_hostname: str):
        g3_service = await G3ServiceDiscovery.request_service(g3_hostname)
>       async with connect_to_glasses.with_service(g3_service, using_ip=False) as g3:

tests/test_connect_to_glasses.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:312: in __aenter__
    return await self
../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:305: in __await_impl__
    G3WebSocketClientProtocol, await g3pylib.websocket.connect(ws_url)
../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:650: in __await_impl_timeout__
    return await asyncio.wait_for(self.__await_impl__(), self.open_timeout)
../../anaconda3/envs/test/lib/python3.10/asyncio/tasks.py:445: in wait_for
    return fut.result()
../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:654: in __await_impl__
    transport, protocol = await self._create_connection()
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1025: in create_connection
    infos = await self._ensure_resolved(
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1404: in _ensure_resolved
    return await loop.getaddrinfo(host, port, family=family, type=type,
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:860: in getaddrinfo
    return await self.run_in_executor(
../../anaconda3/envs/test/lib/python3.10/concurrent/futures/thread.py:58: in run
    result = self.fn(*self.args, **self.kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

host = 'tg03b-080201035331', port = 80, family = 0, type = <SocketKind.SOCK_STREAM: 1>, proto = 0, flags = 0

    def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0):
        """Resolve host and port into list of address info entries.

        Translate the host/port argument into a sequence of 5-tuples that contain
        all the necessary arguments for creating a socket connected to that service.
        host is a domain name, a string representation of an IPv4/v6 address or
        None. port is a string service name such as 'http', a numeric port number or
        None. By passing None as the value of host and port, you can pass NULL to
        the underlying C API.

        The family, type and proto arguments can be optionally specified in order to
        narrow the list of addresses returned. Passing zero as a value for each of
        these arguments selects the full range of results.
        """
        # We override this function since we want to translate the numeric family
        # and socket type values to enum constants.
        addrlist = []
>       for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E       socket.gaierror: [Errno -3] Temporary failure in name resolution

../../anaconda3/envs/test/lib/python3.10/socket.py:955: gaierror
--------------------------------------------------------------------------------------------------------------------------------- Captured log call ----------------------------------------------------------------------------------------------------------------------------------
INFO     g3pylib:__init__.py:301 Attempting connection to websocket ws://TG03B-080201035331/websocket, RTSP rtsp://TG03B-080201035331:8554/live/all and HTTP http://TG03B-080201035331:80
_______________________________________________________________________________________________________________ test_connect_with_hostname_using_zeroconf_and_hostname _______________________________________________________________________________________________________________

g3_hostname = 'tg03b-080201035331'

    async def test_connect_with_hostname_using_zeroconf_and_hostname(g3_hostname: str):
>       async with connect_to_glasses.with_hostname(
            g3_hostname, using_zeroconf=True, using_ip=False
        ) as g3:

tests/test_connect_to_glasses.py:45: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:312: in __aenter__
    return await self
../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:305: in __await_impl__
    G3WebSocketClientProtocol, await g3pylib.websocket.connect(ws_url)
../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:650: in __await_impl_timeout__
    return await asyncio.wait_for(self.__await_impl__(), self.open_timeout)
../../anaconda3/envs/test/lib/python3.10/asyncio/tasks.py:445: in wait_for
    return fut.result()
../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:654: in __await_impl__
    transport, protocol = await self._create_connection()
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1025: in create_connection
    infos = await self._ensure_resolved(
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1404: in _ensure_resolved
    return await loop.getaddrinfo(host, port, family=family, type=type,
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:860: in getaddrinfo
    return await self.run_in_executor(
../../anaconda3/envs/test/lib/python3.10/concurrent/futures/thread.py:58: in run
    result = self.fn(*self.args, **self.kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

host = 'tg03b-080201035331', port = 80, family = 0, type = <SocketKind.SOCK_STREAM: 1>, proto = 0, flags = 0

    def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0):
        """Resolve host and port into list of address info entries.

        Translate the host/port argument into a sequence of 5-tuples that contain
        all the necessary arguments for creating a socket connected to that service.
        host is a domain name, a string representation of an IPv4/v6 address or
        None. port is a string service name such as 'http', a numeric port number or
        None. By passing None as the value of host and port, you can pass NULL to
        the underlying C API.

        The family, type and proto arguments can be optionally specified in order to
        narrow the list of addresses returned. Passing zero as a value for each of
        these arguments selects the full range of results.
        """
        # We override this function since we want to translate the numeric family
        # and socket type values to enum constants.
        addrlist = []
>       for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E       socket.gaierror: [Errno -3] Temporary failure in name resolution

../../anaconda3/envs/test/lib/python3.10/socket.py:955: gaierror
--------------------------------------------------------------------------------------------------------------------------------- Captured log call ----------------------------------------------------------------------------------------------------------------------------------
INFO     g3pylib:__init__.py:301 Attempting connection to websocket ws://TG03B-080201035331/websocket, RTSP rtsp://TG03B-080201035331:8554/live/all and HTTP http://TG03B-080201035331:80
_______________________________________________________________________________________________________________________ test_connect_with_hostname_no_zeroconf _______________________________________________________________________________________________________________________

g3_hostname = 'tg03b-080201035331'

    async def test_connect_with_hostname_no_zeroconf(g3_hostname: str):
>       async with connect_to_glasses.with_hostname(
            g3_hostname, using_zeroconf=False
        ) as g3:

tests/test_connect_to_glasses.py:53: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:312: in __aenter__
    return await self
../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:305: in __await_impl__
    G3WebSocketClientProtocol, await g3pylib.websocket.connect(ws_url)
../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:650: in __await_impl_timeout__
    return await asyncio.wait_for(self.__await_impl__(), self.open_timeout)
../../anaconda3/envs/test/lib/python3.10/asyncio/tasks.py:445: in wait_for
    return fut.result()
../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:654: in __await_impl__
    transport, protocol = await self._create_connection()
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1025: in create_connection
    infos = await self._ensure_resolved(
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1404: in _ensure_resolved
    return await loop.getaddrinfo(host, port, family=family, type=type,
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:860: in getaddrinfo
    return await self.run_in_executor(
../../anaconda3/envs/test/lib/python3.10/concurrent/futures/thread.py:58: in run
    result = self.fn(*self.args, **self.kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

host = 'tg03b-080201035331', port = 80, family = 0, type = <SocketKind.SOCK_STREAM: 1>, proto = 0, flags = 0

    def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0):
        """Resolve host and port into list of address info entries.

        Translate the host/port argument into a sequence of 5-tuples that contain
        all the necessary arguments for creating a socket connected to that service.
        host is a domain name, a string representation of an IPv4/v6 address or
        None. port is a string service name such as 'http', a numeric port number or
        None. By passing None as the value of host and port, you can pass NULL to
        the underlying C API.

        The family, type and proto arguments can be optionally specified in order to
        narrow the list of addresses returned. Passing zero as a value for each of
        these arguments selects the full range of results.
        """
        # We override this function since we want to translate the numeric family
        # and socket type values to enum constants.
        addrlist = []
>       for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E       socket.gaierror: [Errno -3] Temporary failure in name resolution

../../anaconda3/envs/test/lib/python3.10/socket.py:955: gaierror
--------------------------------------------------------------------------------------------------------------------------------- Captured log call ----------------------------------------------------------------------------------------------------------------------------------
INFO     g3pylib:__init__.py:301 Attempting connection to websocket ws://tg03b-080201035331/websocket, RTSP rtsp://tg03b-080201035331:8554/live/all and HTTP http://tg03b-080201035331:80
_______________________________________________________________________________________________________________________________ test_connect_with_urls _______________________________________________________________________________________________________________________________

g3_hostname = 'tg03b-080201035331'

    async def test_connect_with_urls(g3_hostname: str):
>       async with connect_to_glasses.with_url(
            f"ws://{g3_hostname}{DEFAULT_WEBSOCKET_PATH}",
            f"rtsp://{g3_hostname}:{DEFAULT_RTSP_PORT}{DEFAULT_RTSP_LIVE_PATH}",
            f"http://{g3_hostname}:{DEFAULT_HTTP_PORT}",
        ) as g3:

tests/test_connect_to_glasses.py:61: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:312: in __aenter__
    return await self
../../anaconda3/envs/test/lib/python3.10/site-packages/g3pylib/__init__.py:305: in __await_impl__
    G3WebSocketClientProtocol, await g3pylib.websocket.connect(ws_url)
../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:650: in __await_impl_timeout__
    return await asyncio.wait_for(self.__await_impl__(), self.open_timeout)
../../anaconda3/envs/test/lib/python3.10/asyncio/tasks.py:445: in wait_for
    return fut.result()
../../anaconda3/envs/test/lib/python3.10/site-packages/websockets/legacy/client.py:654: in __await_impl__
    transport, protocol = await self._create_connection()
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1025: in create_connection
    infos = await self._ensure_resolved(
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:1404: in _ensure_resolved
    return await loop.getaddrinfo(host, port, family=family, type=type,
../../anaconda3/envs/test/lib/python3.10/asyncio/base_events.py:860: in getaddrinfo
    return await self.run_in_executor(
../../anaconda3/envs/test/lib/python3.10/concurrent/futures/thread.py:58: in run
    result = self.fn(*self.args, **self.kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

host = 'tg03b-080201035331', port = 80, family = 0, type = <SocketKind.SOCK_STREAM: 1>, proto = 0, flags = 0

    def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0):
        """Resolve host and port into list of address info entries.

        Translate the host/port argument into a sequence of 5-tuples that contain
        all the necessary arguments for creating a socket connected to that service.
        host is a domain name, a string representation of an IPv4/v6 address or
        None. port is a string service name such as 'http', a numeric port number or
        None. By passing None as the value of host and port, you can pass NULL to
        the underlying C API.

        The family, type and proto arguments can be optionally specified in order to
        narrow the list of addresses returned. Passing zero as a value for each of
        these arguments selects the full range of results.
        """
        # We override this function since we want to translate the numeric family
        # and socket type values to enum constants.
        addrlist = []
>       for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E       socket.gaierror: [Errno -3] Temporary failure in name resolution

../../anaconda3/envs/test/lib/python3.10/socket.py:955: gaierror
--------------------------------------------------------------------------------------------------------------------------------- Captured log call ----------------------------------------------------------------------------------------------------------------------------------
INFO     g3pylib:__init__.py:301 Attempting connection to websocket ws://tg03b-080201035331/websocket, RTSP rtsp://tg03b-080201035331:8554/live/all and HTTP http://tg03b-080201035331:80
------------------------------------------------------------------------------------------------------------------------------- Captured log teardown --------------------------------------------------------------------------------------------------------------------------------
DEBUG    asyncio:selector_events.py:54 Using selector: EpollSelector
DEBUG    asyncio:selector_events.py:54 Using selector: EpollSelector
DEBUG    asyncio:selector_events.py:54 Using selector: EpollSelector
DEBUG    asyncio:selector_events.py:54 Using selector: EpollSelector
DEBUG    asyncio:selector_events.py:54 Using selector: EpollSelector
DEBUG    asyncio:selector_events.py:54 Using selector: EpollSelector
============================================================================================================================== short test summary info ===============================================================================================================================
FAILED tests/test_connect_to_glasses.py::test_connect_with_service_using_hostname - socket.gaierror: [Errno -3] Temporary failure in name resolution
FAILED tests/test_connect_to_glasses.py::test_connect_with_hostname_using_zeroconf_and_hostname - socket.gaierror: [Errno -3] Temporary failure in name resolution
FAILED tests/test_connect_to_glasses.py::test_connect_with_hostname_no_zeroconf - socket.gaierror: [Errno -3] Temporary failure in name resolution
FAILED tests/test_connect_to_glasses.py::test_connect_with_urls - socket.gaierror: [Errno -3] Temporary failure in name resolution
============================================================================================================================ 4 failed, 2 passed in 0.38s =============================================================================================================================

[Process exited 1]
jonashogstrom commented 1 year ago

In your network, does it work to ping the glasses using the serial number: ping tg03b-080201035331 Or ping tg03b-080201035331.local

jonashogstrom commented 1 year ago

What is you computer and network setup? The logs say that you are running on linux and it seems you are connected to the G3 access point via wifi to the glasses? Is the python environment running inside any docker container or any other virtualization environement? Things you can try:

edavalosanaya commented 1 year ago

Apologies for the delay, life got busy.

I created a PR #84 with some code changes to help solve this issue.

edavalosanaya commented 1 year ago

Closed by PR #86