venari / timelapse

A set of tools/scripts to automate the taking and creation of timelapse videos and videos with a Raspberry Pi
MIT License
1 stars 0 forks source link

balena-cam issues #27

Closed leighghunt closed 1 year ago

leighghunt commented 2 years ago

Initially on setting BALENA_HOST_CONFIG_start_x and BALENA_HOST_CONFIG_gpu_mem_256/_512/_1024 fleet configuration variables, pi stopped booting.

Editing the following file on SD card and removing the following lines started it booting again.

vim /Volumes/resin-boot/config.txt

BALENA_HOST_CONFIG_start_x=1
BALENA_HOST_CONFIG_gpu_mem_256=192
BALENA_HOST_CONFIG_gpu_mem_512=256
BALENA_HOST_CONFIG_gpu_mem_1024=448

Then booted, but generated the following log:

02.06.22 16:17:48 (+1200)  balena-cam  Video device is not ready
02.06.22 16:17:48 (+1200)  balena-cam  Trying to load bcm2835-v4l2 driver...
leighghunt commented 2 years ago

Resetting fleet configuration variable BALENA_HOST_CONFIG_start_x = 1

02.06.22 16:25:31 (+1200)  balena-cam  /usr/local/lib/python3.5/dist-packages/aiortc/rtcdtlstransport.py:12: CryptographyDeprecationWarning: Python 3.5 support will be dropped in the next release of cryptography. Please upgrade your Python.
02.06.22 16:25:31 (+1200)  balena-cam    from cryptography.hazmat.backends import default_backend
02.06.22 16:25:32 (+1200)  balena-cam  Video device is ready
02.06.22 16:25:34 (+1200)  balena-cam  
02.06.22 16:25:34 (+1200)  balena-cam  #############################################################
02.06.22 16:25:34 (+1200)  balena-cam  Authorization is disabled.
02.06.22 16:25:34 (+1200)  balena-cam  Anyone can access your balenaCam, using the device's URL!
02.06.22 16:25:34 (+1200)  balena-cam  Set the username and password environment variables 
02.06.22 16:25:34 (+1200)  balena-cam  to enable authorization.
02.06.22 16:25:34 (+1200)  balena-cam  For more info visit: 
02.06.22 16:25:34 (+1200)  balena-cam  https://github.com/balena-io-playground/balena-cam
02.06.22 16:25:34 (+1200)  balena-cam  #############################################################
02.06.22 16:25:34 (+1200)  balena-cam  
02.06.22 16:25:09 (+1200)  wifi-connect  Checking internet connectivity ...
02.06.22 16:25:12 (+1200)  wifi-connect  Your device is already connected to the internet.
02.06.22 16:25:12 (+1200)  wifi-connect  Skipping setting up Wifi-Connect Access Point. Will check again in 120 seconds
02.06.22 16:25:34 (+1200)  balena-cam  ======== Running on http://0.0.0.0:80 ========
02.06.22 16:25:34 (+1200)  balena-cam  (Press CTRL+C to quit)
leighghunt commented 2 years ago

... but making public and then viewing page gives no image, and the following is logged:

02.06.22 16:27:24 (+1200)  balena-cam  /usr/local/lib/python3.5/dist-packages/pyee/_base.py:83: RuntimeWarning: coroutine 'on_iceconnectionstatechange' was never awaited
02.06.22 16:27:24 (+1200)  balena-cam    f(*args, **kwargs)
02.06.22 16:27:24 (+1200)  balena-cam  Task exception was never retrieved
02.06.22 16:27:24 (+1200)  balena-cam  future: <Task finished coro=<RTCPeerConnection.__connect() done, defined at /usr/local/lib/python3.5/dist-packages/aiortc/rtcpeerconnection.py:554> exception=ValueError("'4e663d10-686f-4a1a-aec8-e46086b395b4.local' does not appear to be an IPv4 or IPv6 address",)>
02.06.22 16:27:24 (+1200)  balena-cam  Traceback (most recent call last):
02.06.22 16:27:24 (+1200)  balena-cam    File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
02.06.22 16:27:24 (+1200)  balena-cam      result = coro.send(None)
02.06.22 16:27:24 (+1200)  balena-cam    File "/usr/local/lib/python3.5/dist-packages/aiortc/rtcpeerconnection.py", line 559, in __connect
02.06.22 16:27:24 (+1200)  balena-cam      await iceTransport.start(self.__remoteIce[transceiver])
02.06.22 16:27:24 (+1200)  balena-cam    File "/usr/local/lib/python3.5/dist-packages/aiortc/rtcicetransport.py", line 284, in start
02.06.22 16:27:24 (+1200)  balena-cam      await self._connection.connect()
02.06.22 16:27:24 (+1200)  balena-cam    File "/usr/local/lib/python3.5/dist-packages/aioice/ice.py", line 356, in connect
02.06.22 16:27:24 (+1200)  balena-cam      if (protocol.local_candidate.can_pair_with(remote_candidate) and
02.06.22 16:27:24 (+1200)  balena-cam    File "/usr/local/lib/python3.5/dist-packages/aioice/candidate.py", line 114, in can_pair_with
02.06.22 16:27:24 (+1200)  balena-cam      b = ipaddress.ip_address(other.host)
02.06.22 16:27:24 (+1200)  balena-cam    File "/usr/lib/python3.5/ipaddress.py", line 54, in ip_address
02.06.22 16:27:24 (+1200)  balena-cam      address)
02.06.22 16:27:24 (+1200)  balena-cam  ValueError: '4e663d10-686f-4a1a-aec8-e46086b395b4.local' does not appear to be an IPv4 or IPv6 address
leighghunt commented 2 years ago

Also giving slightly different issue when viewed in Safari rather than firefox

02.06.22 16:30:33 (+1200)  balena-cam  Task exception was never retrieved
02.06.22 16:30:33 (+1200)  balena-cam  future: <Task finished coro=<server_reflexive_candidate() done, defined at /usr/local/lib/python3.5/dist-packages/aioice/ice.py:49> exception=TransactionTimeout()>
02.06.22 16:30:33 (+1200)  balena-cam  Traceback (most recent call last):
02.06.22 16:30:33 (+1200)  balena-cam    File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step
02.06.22 16:30:33 (+1200)  balena-cam      result = coro.throw(exc)
02.06.22 16:30:33 (+1200)  balena-cam    File "/usr/local/lib/python3.5/dist-packages/aioice/ice.py", line 55, in server_reflexive_candidate
02.06.22 16:30:33 (+1200)  balena-cam      response, _ = await protocol.request(request, stun_server)
02.06.22 16:30:33 (+1200)  balena-cam    File "/usr/local/lib/python3.5/dist-packages/aioice/ice.py", line 187, in request
02.06.22 16:30:33 (+1200)  balena-cam      return await transaction.run()
02.06.22 16:30:33 (+1200)  balena-cam    File "/usr/local/lib/python3.5/dist-packages/aioice/stun.py", line 250, in run
02.06.22 16:30:33 (+1200)  balena-cam      return await self.__future
02.06.22 16:30:33 (+1200)  balena-cam    File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
02.06.22 16:30:33 (+1200)  balena-cam      yield self  # This tells Task to wait for completion.
02.06.22 16:30:33 (+1200)  balena-cam    File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
02.06.22 16:30:33 (+1200)  balena-cam      future.result()
02.06.22 16:30:33 (+1200)  balena-cam    File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
02.06.22 16:30:33 (+1200)  balena-cam      raise self._exception
02.06.22 16:30:33 (+1200)  balena-cam  aioice.exceptions.TransactionTimeout: STUN transaction timed out

Plus, adding BALENA_HOST_CONFIG_gpu_mem as 64 - seems to make it not happy again.

leighghunt commented 2 years ago

BALENA_HOST_CONFIG_gpu_mem as 64:

02.06.22 16:58:01 (+1200)  balena-cam  /usr/local/lib/python3.5/dist-packages/aiortc/rtcdtlstransport.py:12: CryptographyDeprecationWarning: Python 3.5 support will be dropped in the next release of cryptography. Please upgrade your Python.
02.06.22 16:58:01 (+1200)  balena-cam    from cryptography.hazmat.backends import default_backend
02.06.22 16:58:01 (+1200)  balena-cam  Video device is ready
02.06.22 16:58:01 (+1200)  balena-cam  VIDIOC_STREAMON: Invalid argument
02.06.22 16:58:01 (+1200)  balena-cam  Failed to open default camera. Exiting...

BALENA_HOST_CONFIG_gpu_mem as 128:

Pi boots, but no services come up.

leighghunt commented 1 year ago

Closing as no longer using Balena