Skip to main content
Visitor II
June 17, 2022
Solved

How to install aiortc (python module) in STM32MP157F-DK2

  • June 17, 2022
  • 1 reply
  • 4370 views

So basically I'm trying to implement WebRTC and seems like aiortc is its python implementation right now:.

Unable to manually install them using pip3 as it requires some dev-packages.

I tried to install it as a layer using pipoe auto-generated recipe, but no luck as it goes on with errors. A working recipe and additions that has to be done to local.conf or CORE_IMAGE_EXTRA_INSTALL variable would be appreciated :smiling_face_with_smiling_eyes:.

    This topic has been closed for replies.
    Best answer by Jean-Marc B

    Hi @Jaison M​ 

    This recipe generates a package that I have successfully installed on my board (stm32mp157c-dk2):

    DESCRIPTION = "aiortc is a library for Web Real-Time Communication (WebRTC) and \
    Object Real-Time Communication (ORTC) in Python."
    HOMEPAGE = "https://github.com/aiortc/aiortc"
    SECTION = "devel/python"
     
    AUTHOR = "Jeremy Laine"
     
    LICENSE = "BSD"
    LIC_FILES_CHKSUM = "file://LICENSE;md5=907b5e856b2e6bcd8a3cc8d338a6166f"
     
    SRC_URI[md5sum] = "3f43e88416113141b0196bdf6c37b444"
    SRC_URI[sha256sum] = "15608d7fcf09502d1b8c19b8a63bc22966090ee0761ac9a755e9f747f46d67ab"
     
    PYPI_PACKAGE = "aiortc"
     
    DEPENDS += " \
     ${PYTHON_PN}-setuptools-scm-native \
     ${PYTHON_PN}-toml-native \
    "
     
    inherit pypi python_setuptools_build_meta
     
    RDEPENDS:${PN} += " \
     ffmpeg \
     libopus \
     libsrtp \
     libvpx \
    "
     
    BBCLASSEXTEND += "native nativesdk"

    I did this quick test with the OpenSTLinux distribution that should be released soon. Results may differ against OpenSTLinux ecosystem 3.1

    Best regards,

    --JM

    1 reply

    ST Employee
    June 20, 2022

    Hi @Jaison M​ 

    This recipe generates a package that I have successfully installed on my board (stm32mp157c-dk2):

    DESCRIPTION = "aiortc is a library for Web Real-Time Communication (WebRTC) and \
    Object Real-Time Communication (ORTC) in Python."
    HOMEPAGE = "https://github.com/aiortc/aiortc"
    SECTION = "devel/python"
     
    AUTHOR = "Jeremy Laine"
     
    LICENSE = "BSD"
    LIC_FILES_CHKSUM = "file://LICENSE;md5=907b5e856b2e6bcd8a3cc8d338a6166f"
     
    SRC_URI[md5sum] = "3f43e88416113141b0196bdf6c37b444"
    SRC_URI[sha256sum] = "15608d7fcf09502d1b8c19b8a63bc22966090ee0761ac9a755e9f747f46d67ab"
     
    PYPI_PACKAGE = "aiortc"
     
    DEPENDS += " \
     ${PYTHON_PN}-setuptools-scm-native \
     ${PYTHON_PN}-toml-native \
    "
     
    inherit pypi python_setuptools_build_meta
     
    RDEPENDS:${PN} += " \
     ffmpeg \
     libopus \
     libsrtp \
     libvpx \
    "
     
    BBCLASSEXTEND += "native nativesdk"

    I did this quick test with the OpenSTLinux distribution that should be released soon. Results may differ against OpenSTLinux ecosystem 3.1

    Best regards,

    --JM

    Jaison MAuthor
    Visitor II
    June 20, 2022

    Ok I tried compiling the layer, but received this error:

    Could not inherit file classes/python_setuptools_build_meta.bbclass

    How do I fix this?

    ST Employee
    June 21, 2022

    Hi @Jaison M​ 

    As said, I didn't check with ecosystem-3.1 so I guess this error may be explained so.

    For ecosystem-3.1, you could try to remove the DEPENDS variable and replace python_setuptools_build_meta inheritance by setuptools3.

    Then, you could also downgrade the aiortc version as the internal build mechanism may not be compatible with ecosystem-3.1 but older versions may be compatible.

    Best regards,

    --JM