Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions yocto_recipes/meta-beremiz/conf/layer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_COLLECTIONS += "meta-beremiz"
BBFILE_PATTERN_meta-beremiz = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-beremiz = "9"

LAYERDEPENDS_meta-beremiz = "core"
LAYERSERIES_COMPAT_meta-beremiz = "honister"
35 changes: 35 additions & 0 deletions yocto_recipes/meta-beremiz/instructions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# meta-beremiz
Yocto layer for beremiz_runtime : Below is the procedure to get started.

Please leave a message if you would like to add new feature or request a new feature. We would be happy to know.

This is Yocto layer for building an Yocto based image for raspberry pi which contains beremiz runtime. When this layer is included in yocto build then the resulting image is having all dependencies and runtime files necessary for beremiz runtime.

Steps :

Prerequisites : This is tested on Ubuntu 20.0 and Yocto branch of honister on Host. Target was raspberry-pi4 64 bit image

In first step User has to have a Yocto build setup which can build successful image for e.g core-image-base, and it should boot properly on raspberry pi4. This procedure on how to setup Yocto is out of scope of this article.

User has to clone this repository i.e meta-beremiz on host machine

Then user can add this layer to his yocto build using command bitbake-layers add-layer ../sources/meta-<custom_layer> Use the path where the repo is cloned.

User has to clone beremiz repository from git clone https://github.com/beremiz/beremiz

From the cloned repository, This Layer will automatically pickup all necessary runtime files

Open the local.conf file: at yocto/build/conf/local.conf and add the line IMAGE_INSTALL_append += " meta-beremiz"

build the image using command bitbake core-image-base

Once build is sucessful, Burn the SD card and boot this image.

Login to raspberrypi4 using root user and no password

To start runtime set the IP address of your choice and give below command
python3 /usr/bin/Beremiz/Beremiz_service.py -p 61194 -i 10.91.20.222 -x 0 -a 1 /usr/bin/beremiz_runtime_workdir

Your runtime should start and now you can use beremiz IDE to write sample program and upload to raspberry pi4

To do for future - Autostart runtime on power cycle, add preemp-rt patch to web browser in kiosk mode for GUI support.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
SUMMARY = "Python Remote Objects"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=c1c9ccd5f4ca5d0f5057c0e690a0153d"

SRC_URI[md5sum] = "477f4d5befa49ff39b225c894ad8bb4b"
SRC_URI[sha256sum] = "64fdce137b0fe532e88614d246b7c98bbe0a4f426786c524539acdc5e694086a"

PYPI_PACKAGE = "Pyro5"

inherit pypi setuptools3

RDEPENDS:${PN} += " \
${PYTHON_PN}-serpent \
${PYTHON_PN}-wheel \
"
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
SUMMARY = "A console-only image for raspberrypi4 with beremiz_runtime."

LICENSE = "MIT"

inherit core-image
require recipes-core/images/core-image-base.bb

IMAGE_FEATURES += "ssh-server-openssh"

RDEPENDS_${PN} = "\
python3-pip \
python3-autobahn \
python3-ifaddr \
python3-msgpack \
python3-nevow-py3 \
python3-pyro5 \
python3-zeroconf \
python3-zope.interface \
"
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
DESCRIPTION = "Beremiz Runtime python based"
SECTION = "Runtime for PLC"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "git://github.com/Nabeel3007/python-beremiz.git;protocol=https;branch=master"

SRCREV = "${AUTOREV}"

S = "${WORKDIR}/git"

do_install:append () {
install -d ${D}${bindir}/beremiz_runtime_workdir
install -d ${D}${bindir}/Beremiz
install -m 0755 beremiz/Beremiz_service.py ${D}${bindir}/Beremiz
install -m 0755 beremiz/version.py ${D}${bindir}/Beremiz
install -d ${D}${bindir}/Beremiz/images
install -m 0755 beremiz/images/brz.png ${D}${bindir}/Beremiz/images
install -m 0755 beremiz/images/icoplay24.png ${D}${bindir}/Beremiz/images
install -m 0755 beremiz/images/icostop24.png ${D}${bindir}/Beremiz/images
install -d ${D}${bindir}/Beremiz/runtime
install -m 0755 beremiz/runtime/__init__.py ${D}${bindir}/Beremiz/runtime
install -m 0755 beremiz/runtime/loglevels.py ${D}${bindir}/Beremiz/runtime
install -m 0755 beremiz/runtime/monotonic_time.py ${D}${bindir}/Beremiz/runtime
install -m 0755 beremiz/runtime/NevowServer.py ${D}${bindir}/Beremiz/runtime
install -m 0755 beremiz/runtime/PLCObject.py ${D}${bindir}/Beremiz/runtime
install -m 0755 beremiz/runtime/PlcStatus.py ${D}${bindir}/Beremiz/runtime
install -m 0755 beremiz/runtime/PyroServer.py ${D}${bindir}/Beremiz/runtime
install -m 0755 beremiz/runtime/ServicePublisher.py ${D}${bindir}/Beremiz/runtime
install -m 0755 beremiz/runtime/spawn_subprocess.py ${D}${bindir}/Beremiz/runtime
install -m 0755 beremiz/runtime/Stunnel.py ${D}${bindir}/Beremiz/runtime
install -m 0755 beremiz/runtime/typemapping.py ${D}${bindir}/Beremiz/runtime
install -m 0755 beremiz/runtime/WampClient.py ${D}${bindir}/Beremiz/runtime
install -m 0755 beremiz/runtime/webinterface.css ${D}${bindir}/Beremiz/runtime
install -m 0755 beremiz/runtime/webinterface.js ${D}${bindir}/Beremiz/runtime
install -m 0755 beremiz/runtime/Worker.py ${D}${bindir}/Beremiz/runtime
install -m 0755 beremiz/runtime/xenomai.py ${D}${bindir}/Beremiz/runtime
install -d ${D}${bindir}/Beremiz/util
install -m 0755 beremiz/util/__init__.py ${D}${bindir}/Beremiz/util
install -m 0755 beremiz/util/paths.py ${D}${bindir}/Beremiz/util
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
SUMMARY = "Web Application Construction Kit"
HOMEPAGE = "https://github.com/beremiz/nevow-py3"
LICENSE = "CLOSED"

LIC_FILES_CHKSUM = "file://LICENSE;md5=50ad7cdebd8c5f7f1362c4adb8856265"

SRC_URI = "git://github.com/beremiz/nevow-py3.git;protocol=https"
SRC_URI[sha256sum] = "3b1a0cdada1d47b896cfb3f5ee27aae5fd7a3896c6feb69c8406802cac9f2a86"

SRCREV = "${AUTOREV}"

S = "${WORKDIR}/git"

inherit setuptools3




Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

SUMMARY = "Timeout context manager for asyncio programs"
HOMEPAGE = "https://github.com/aio-libs/async-timeout"
AUTHOR = "Andrew Svetlov <andrew.svetlov@gmail.com> <andrew.svetlov@gmail.com>"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=4fa41f15bb5f23b6d3560c5845eb8d57"

SRC_URI = "https://files.pythonhosted.org/packages/87/d6/21b30a550dafea84b1b8eee21b5e23fa16d010ae006011221f33dcd8d7f8/async-timeout-4.0.3.tar.gz"
SRC_URI[md5sum] = "9bf7b764a7310cb063c1c261c21342e4"
SRC_URI[sha256sum] = "4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f"

S = "${WORKDIR}/async-timeout-4.0.3"

RDEPENDS_${PN} = ""

inherit pypi setuptools3
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
DESCRIPTION = "Simple decorator to set attributes of target function or class in a DRY way"
HOMEPAGE = "https://github.com/denis-ryzhkov/attr"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=5e55731824cf9205cfabeab9a0600887"

SRC_URI[md5sum] = "6623fed7ffa22261ba25fccaf4d99539"
SRC_URI[sha256sum] = "6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"

inherit pypi setuptools3
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
DESCRIPTION = "WebSocket client & server library, WAMP real-time framework"
HOMEPAGE = "http://crossbar.io/autobahn"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3e2c2c2cc2915edc5321b0e6b1d3f5f8"

SRC_URI = "https://files.pythonhosted.org/packages/92/ee/c3320c326919394ff597592549ff5d29d2f7bf12be9ddaa9017caff1a170/autobahn-23.1.2.tar.gz"

SRC_URI[md5sum] = "55cd275bc3d9c7e354f4b6a87b87f466"
SRC_URI[sha256sum] = "c5ef8ca7422015a1af774a883b8aef73d4954c9fcd182c9b5244e08e973f7c3a"

inherit pypi setuptools3

RDEPENDS:${PN} += " \
${PYTHON_PN}-async-timeout \
${PYTHON_PN}-asyncio \
${PYTHON_PN}-txaio \
${PYTHON_PN}-six \
"

BBCLASSEXTEND = "nativesdk"
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

SUMMARY = "Self-service finite-state machines for the programmer on the go."
HOMEPAGE = "https://github.com/glyph/Automat"
AUTHOR = "Glyph <glyph@twistedmatrix.com>"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=4ad213bcca81688e94593e5f60c87477"

SRC_URI = "https://files.pythonhosted.org/packages/7a/7b/9c3d26d8a0416eefbc0428f168241b32657ca260fb7ef507596ff5c2f6c4/Automat-22.10.0.tar.gz"
SRC_URI[md5sum] = "b8064994239aabb172748f984489ce75"
SRC_URI[sha256sum] = "e56beb84edad19dcc11d30e8d9b895f75deeb5ef5e96b84a467066b3b84bb04e"

S = "${WORKDIR}/Automat-22.10.0"

RDEPENDS_${PN} = " \
${PYTHON_PN}-attrs \
${PYTHON_PN}-six \
"

inherit pypi setuptools3
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

SUMMARY = "Foreign Function Interface for Python calling C code."
HOMEPAGE = "http://cffi.readthedocs.org"
AUTHOR = "Armin Rigo, Maciej Fijalkowski <python-cffi@googlegroups.com>"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=5677e2fdbf7cdda61d6dd2b57df547bf"

SRC_URI = "https://files.pythonhosted.org/packages/68/ce/95b0bae7968c65473e1298efb042e10cafc7bafc14d9e4f154008241c91d/cffi-1.16.0.tar.gz"
SRC_URI[md5sum] = "0bcaed453da3004d0bea103038345c1e"
SRC_URI[sha256sum] = "bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0"

S = "${WORKDIR}/cffi-1.16.0"

RDEPENDS_${PN} = " \
"

inherit pypi setuptools3
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

SUMMARY = "Symbolic constants in Python"
HOMEPAGE = ""
AUTHOR = " <>"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e393e4ddd223e3a74982efa784f89fd7"

SRC_URI = "https://files.pythonhosted.org/packages/4d/6f/cb2a94494ff74aa9528a36c5b1422756330a75a8367bf20bd63171fc324d/constantly-23.10.4.tar.gz"
SRC_URI[md5sum] = "c090579309b2b34be04385b54b0a5a85"
SRC_URI[sha256sum] = "aa92b70a33e2ac0bb33cd745eb61776594dc48764b06c35e0efd050b7f1c7cbd"

S = "${WORKDIR}/constantly-23.10.4"

RDEPENDS_${PN} = ""

inherit pypi setuptools3
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

SUMMARY = "cryptography is a package which provides cryptographic recipes and primitives to Python developers."
HOMEPAGE = ""
AUTHOR = " <The Python Cryptographic Authority and individual contributors <cryptography-dev@python.org>>"
LICENSE = ""
LIC_FILES_CHKSUM = "file://LICENSE;md5=8c3617db4fb6fae01f1d253ab91511e4"

SRC_URI = "https://files.pythonhosted.org/packages/ce/b3/13a12ea7edb068de0f62bac88a8ffd92cc2901881b391839851846b84a81/cryptography-41.0.7.tar.gz"
SRC_URI[md5sum] = "c06f01c4bc95327c2e4378589ed5a193"
SRC_URI[sha256sum] = "13f93ce9bea8016c253b34afc6bd6a75993e5c40672ed5405a9c832f0d4a00bc"

S = "${WORKDIR}/cryptography-41.0.7"

RDEPENDS_${PN} = " \
${PYTHON_PN}-cffi \
${PYTHON_PN}-pycparser \
"

inherit pypi setuptools3
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

SUMMARY = "A featureful, immutable, and correct URL for Python."
HOMEPAGE = "https://github.com/python-hyper/hyperlink"
AUTHOR = "Mahmoud Hashemi and Glyph Lefkowitz <mahmoud@hatnote.com>"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=6dc5b4bd3d02faedf08461621aa2aeca"

SRC_URI = "https://files.pythonhosted.org/packages/3a/51/1947bd81d75af87e3bb9e34593a4cf118115a8feb451ce7a69044ef1412e/hyperlink-21.0.0.tar.gz"
SRC_URI[md5sum] = "6285ac13e7d6be4157698ad7960ed490"
SRC_URI[sha256sum] = "427af957daa58bc909471c6c40f74c5450fa123dd093fc53efd2e91d2705a56b"

S = "${WORKDIR}/hyperlink-21.0.0"

RDEPENDS_${PN} = ""

inherit pypi setuptools3
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

SUMMARY = "Internationalized Domain Names in Applications (IDNA)"
HOMEPAGE = ""
AUTHOR = " <Kim Davies <kim+pypi@gumleaf.org>>"
LICENSE = ""
LIC_FILES_CHKSUM = "file://LICENSE.md;md5=dbec47b98e1469f6a104c82ff9698cee"

SRC_URI = "https://files.pythonhosted.org/packages/bf/3f/ea4b9117521a1e9c50344b909be7886dd00a519552724809bb1f486986c2/idna-3.6.tar.gz"
SRC_URI[md5sum] = "70f4beef4feb196ac64b75a93271f53c"
SRC_URI[sha256sum] = "9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca"

S = "${WORKDIR}/idna-3.6"

RDEPENDS_${PN} = ""

inherit pypi setuptools3
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
DESCRIPTION = "Cross-platform network interface and IP address enumeration \
library"
HOMEPAGE = "https://pypi.org/project/ifaddr/"
LICENSE = "MIT"

LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=8debe8d42320ec0ff24665319b625a5e"

SRC_URI[md5sum] = "b1cac02b5dc354d68dd6d853bc9565a7"
SRC_URI[sha256sum] = "cc0cbfcaabf765d44595825fb96a99bb12c79716b73b44330ea38ee2b0c4aed4"

inherit pypi setuptools3

RDEPENDS:${PN} += " \
"
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

SUMMARY = ""A small library that versions your Python projects.""
HOMEPAGE = "https://github.com/twisted/incremental"
AUTHOR = " <>"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=6ca9b07f08e2c72d48c74d363d1e0e15"

SRC_URI = "https://files.pythonhosted.org/packages/86/42/9e87f04fa2cd40e3016f27a4b4572290e95899c6dce317e2cdb580f3ff09/incremental-22.10.0.tar.gz"
SRC_URI[md5sum] = "9fffa2490ca649550c79a78e85ef2eef"
SRC_URI[sha256sum] = "912feeb5e0f7e0188e6f42241d2f450002e11bbc0937c65865045854c24c0bd0"

S = "${WORKDIR}/incremental-22.10.0"

RDEPENDS_${PN} = ""

inherit pypi setuptools3
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

pytest
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
SUMMARY = "MessagePack (de)serializer"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://COPYING;md5=cd9523181d9d4fbf7ffca52eaa2a5751"

PYPI_PACKAGE = "msgpack"

inherit pypi setuptools3

SRC_URI[md5sum] = "da12a9f0a65a803ec005219f6095d0a3"
SRC_URI[sha256sum] = "c075544284eadc5cddc70f4757331d99dcbc16b2bbd4849d15f8aae4cf36d31c"

RDEPENDS:${PN}:class-target += "\
${PYTHON_PN}-io \
"

BBCLASSEXTEND = "native nativesdk"

do_install_ptest() {
install -d ${D}${PTEST_PATH}/test
cp -rf ${S}/test/* ${D}${PTEST_PATH}/test/
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
SUMMARY = "Interface definitions for Zope products"
HOMEPAGE = "https://github.com/beremiz/nevow-py3"
LICENSE = ""

LIC_FILES_CHKSUM = "file://LICENSE;md5=c433166efeddc545cf06b0677ffa79ee"

SRC_URI = "https://github.com/beremiz/nevow-py3.git;branch=master"
SRC_URI[sha256sum] = "8452c8986b5090ffb4c204f0bddc7e8700ed6fd5"

SRCREV = "8452c8986b5090ffb4c204f0bddc7e8700ed6fd5"

S = "${WORKDIR}/git"

RDEPENDS_${PN} = ""

inherit setuptools3



Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

SUMMARY = "The PyPA recommended tool for installing Python packages."
HOMEPAGE = "https://pip.pypa.io/"
AUTHOR = "The pip developers <distutils-sig@python.org>"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=63ec52baf95163b597008bb46db68030"

SRC_URI = "https://files.pythonhosted.org/packages/b7/06/6b1ad0ae8f97d7a0d6f6ad640db10780578999e647a9593512ceb6f06469/pip-23.3.2.tar.gz"
SRC_URI[md5sum] = "38dd5f7ab301167df063405c7fc16c84"
SRC_URI[sha256sum] = "7fd9972f96db22c8077a1ee2691b172c8089b17a5652a44494a9ecb0d78f9149"

S = "${WORKDIR}/pip-23.3.2"

RDEPENDS_${PN} = ""

inherit pypi setuptools3
Loading