balena-labs-projects / balena-cam

Network Camera with Raspberry Pi and WebRTC. Tutorial:
https://balena.io/blog/build-a-raspberry-pi-based-network-camera/
MIT License
175 stars 77 forks source link

Error with Raspberry Pi 4 & Camera Module v2 #87

Closed SteeveGL closed 3 years ago

SteeveGL commented 3 years ago

I tested with the code on master 344e824 on my Raspberry Pi 4 with Noir Camera Module V2 . I got the error AttributeError: module 'lib' has no attribute 'SSL_OP_NO_TLSv1_3'

[Logs]    [12/2/2020, 6:25:21 PM] [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.
[Logs]    [12/2/2020, 6:25:21 PM] [balena-cam]   from cryptography.hazmat.backends import default_backend
[Logs]    [12/2/2020, 6:25:21 PM] [balena-cam] Traceback (most recent call last):
[Logs]    [12/2/2020, 6:25:21 PM] [balena-cam]   File "/usr/src/app/server.py", line 5, in <module>
[Logs]    [12/2/2020, 6:25:21 PM] [balena-cam]     from aiortc import RTCPeerConnection, RTCSessionDescription, VideoStreamTrack, RTCIceServer, RTCConfiguration
[Logs]    [12/2/2020, 6:25:21 PM] [balena-cam]   File "/usr/local/lib/python3.5/dist-packages/aiortc/__init__.py", line 7, in <module>
[Logs]    [12/2/2020, 6:25:21 PM] [balena-cam]     from .rtcdtlstransport import (RTCCertificate, RTCDtlsFingerprint,  # noqa
[Logs]    [12/2/2020, 6:25:21 PM] [balena-cam]   File "/usr/local/lib/python3.5/dist-packages/aiortc/rtcdtlstransport.py", line 18, in <module>
[Logs]    [12/2/2020, 6:25:21 PM] [balena-cam]     from OpenSSL import crypto
[Logs]    [12/2/2020, 6:25:21 PM] [balena-cam]   File "/usr/local/lib/python3.5/dist-packages/OpenSSL/__init__.py", line 8, in <module>
[Logs]    [12/2/2020, 6:25:21 PM] [balena-cam]     from OpenSSL import crypto, SSL
[Logs]    [12/2/2020, 6:25:21 PM] [balena-cam]   File "/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py", line 149, in <module>
[Logs]    [12/2/2020, 6:25:21 PM] [balena-cam]     OP_NO_TLSv1_3 = _lib.SSL_OP_NO_TLSv1_3
[Logs]    [12/2/2020, 6:25:21 PM] [balena-cam] AttributeError: module 'lib' has no attribute 'SSL_OP_NO_TLSv1_3'
[Logs]    [12/2/2020, 6:25:15 PM] Service exited 'balena-cam sha256:a78972a03272c409def44de92adac55debb38ddd1732780f6dc2ea6ef89c778d'

Any ideal? I guess I have to update a library...

SteeveGL commented 3 years ago

I replaced the line balena-cam/Dockerfile.aarch64#L34 by

RUN pip3 install aiohttp aiohttp_basicauth==0.1.3 aioice==0.6.10 aiortc==0.9.11 numpy==1.15.4 opencv-python==3.4.4.19 pyOpenSSL==19.1.0 --index-url https://www.piwheels.org/simple

A package has a dependency to pyOpenSSL > 19.1.0, and that cause that error.

Now I get Video device is not ready. Sound like a progression.