BalenaCam Connection Always Fails, ValueError: ... does not appear to be an IPv4 or IPv6 address

Hi!
I just installed BalenaCam on my Pi3a+ today following every instruction correctly. However, every time I try connecting via my android or win10 PC (chrome), the page loads for a little bit, shows nothing, then shows connection failed. Interestingly, it did work instantly on Edge with using a regular mjpeg stream. What went wrong? How do I fix this? Is there a way (env variables?) to enable mjpeg by default? Please help, here are my logs :slight_smile:

26.03.20 19:20:15 (-0700) ======== Running on http://0.0.0.0:80 ========
26.03.20 19:20:15 (-0700) (Press CTRL+C to quit)
26.03.20 19:20:42 (-0700) Task exception was never retrieved
26.03.20 19:20:42 (-0700) future: <Task finished coro=<RTCPeerConnection.__connect() done, defined at /usr/local/lib/python3.5/dist-packages/aiortc/rtcpeerconnection.py:554> exception=ValueError("‘aaf80f4b-a797-43bd-a41a-a383c76567e4.local’ does not appear to be an IPv4 or IPv6 address",)>
26.03.20 19:20:42 (-0700) Traceback (most recent call last):
26.03.20 19:20:42 (-0700) File “/usr/lib/python3.5/asyncio/tasks.py”, line 239, in _step
26.03.20 19:20:42 (-0700) result = coro.send(None)
26.03.20 19:20:42 (-0700) File “/usr/local/lib/python3.5/dist-packages/aiortc/rtcpeerconnection.py”, line 559, in __connect
26.03.20 19:20:42 (-0700) await iceTransport.start(self.__remoteIce[transceiver])
26.03.20 19:20:42 (-0700) File “/usr/local/lib/python3.5/dist-packages/aiortc/rtcicetransport.py”, line 284, in start
26.03.20 19:20:42 (-0700) await self._connection.connect()
26.03.20 19:20:42 (-0700) File “/usr/local/lib/python3.5/dist-packages/aioice/ice.py”, line 356, in connect
26.03.20 19:20:42 (-0700) if (protocol.local_candidate.can_pair_with(remote_candidate) and
26.03.20 19:20:42 (-0700) File “/usr/local/lib/python3.5/dist-packages/aioice/candidate.py”, line 114, in can_pair_with
26.03.20 19:20:42 (-0700) b = ipaddress.ip_address(other.host)
26.03.20 19:20:42 (-0700) File “/usr/lib/python3.5/ipaddress.py”, line 54, in ip_address
26.03.20 19:20:42 (-0700) address)
26.03.20 19:20:42 (-0700) ValueError: ‘aaf80f4b-a797-43bd-a41a-a383c76567e4.local’ does not appear to be an IPv4 or IPv6 address

Hello! So the issue I am seeing is ValueError: ‘aaf80f4b-a797-43bd-a41a-a383c76567e4.local’ does not appear to be an IPv4 or IPv6 address you can check this PR on how to disable IP hiding on webrtc on chrome here https://github.com/balenalabs/balena-cam/pull/62/commits/cc1e3669cf339eef51adf4dc094fd7be1067a312 .

Hi I get the same error when I try to connect via the web with Windows 10/Firefox. But I can connect with Windows10/Edge or with my Android/Firefox browser. Any hope of fixing this to play better with firefox on the pc?

Hello can you provide us the firefox version you are using? Also the issue will be solved if you disable ip hiding for webrtc connections on Firefox.

For those who come to this issue late, as I did, there’s a chrome extension called WebRTC Control that fixes it.