beremiz笔记chatgpt,部署在Ubuntu:20.04版本
要在 Ubuntu 20.04 上安装 Beremiz,您可以按照以下步骤进行:
-
安装系统依赖项:
打开终端,执行以下命令以安装所需的系统包:sudo apt-get update sudo apt-get install build-essential automake flex bison mercurial \ libgtk-3-dev libgl1-mesa-dev libglu1-mesa-dev \ libpython3.8-dev libssl-dev \ python3.8 virtualenv cmake git
请注意,
libpython3.8-dev
和python3.8
的版本可能需要根据您的系统环境进行调整。 -
获取源代码:
在您的主目录下创建一个名为Beremiz
的目录,并进入该目录:mkdir ~/Beremiz cd ~/Beremiz
然后,使用 Mercurial 克隆 Beremiz 和 MATIEC 的源代码:
hg clone https://hg.beremiz.org/beremiz hg clone https://hg.beremiz.org/matiec #或者,最好有梯子 cd ~/Beremiz git clone https://github.com/beremiz/beremiz git clone https://github.com/beremiz/matiec
如果您的系统未安装 Mercurial,可以使用以下命令安装:
#不知道是干什么的,没有运行这条命令 sudo apt-get install mercurial
-
设置 Python 环境:
创建一个虚拟环境并激活:virtualenv ~/Beremiz/venv source ~/Beremiz/venv/bin/activate
然后,安装所需的 Python 包:
pip install -r ~/Beremiz/beremiz/requirements.txt
使用ubuntu:20.04,部分工具的版本不支持
遇到下面这个问题,更新git,让后再运行一下
sudo apt-get update
sudo apt-get install build-essential libgtk-3-dev
pip install wxPython
pip install -r ~/Beremiz/beremiz/requirements.txt
aiofiles==24.1.0
aiosqlite==0.20.0
asyncua @ git+https://github.com/FreeOpcUa/opcua-asyncio.git@98a64897a2d171653353de2f36d33085aef65e82
attrs==24.2.0
autobahn==23.1.2
Automat==24.8.1
Brotli==1.1.0
cffi==1.17.1
click==8.1.7
constantly==23.10.4
contourpy==1.1.1
cryptography==44.0.0
cycler==0.12.1
erpc @ git+https://git@github.com/beremiz/erpc.git@d8fff72b15274b5f2a8f7895d9bc5c91eef584ec#subdirectory=erpc_python
fonttools==4.55.3
hyperlink==21.0.0
idna==3.10
ifaddr==0.2.0
incremental==24.7.2
kiwisolver==1.4.7
lxml==5.3.0
matplotlib==3.7.5
msgpack==1.1.0
Nevow @ git+https://git@github.com/beremiz/nevow-py3.git@81c2eaeaaa20022540a98a3106f72e0199fbcc1b
numpy==1.24.4
packaging==24.2
pillow==10.4.0
pycountry==24.6.1
pycparser==2.22
pyparsing==3.1.4
python-dateutil==2.9.0.post0
pytz==2024.2
setuptools==75.3.0
six==1.17.0
sortedcontainers==2.4.0
sslpsk @ git+https://git@github.com/beremiz/sslpsk.git@9cb31986629b382f7427eec29ddc168ad21c7d7c
Twisted==24.11.0
txaio==23.1.1
typing_extensions==4.12.2
wxPython==4.2.2
zeroconf==0.136.2
zope.interface==7.2
- 构建 MATIEC 编译器:
进入 MATIEC 目录并构建:cd ~/Beremiz/matiec autoreconf -i ./configure make
问题:
方法:apt-get install bison
apt-get install flex
make的结果
-
(可选)构建其他库:
如果需要支持 CANopen、Modbus 或 BACnet,可以按照以下步骤构建相应的库:- 构建 CanFestival(仅需在需要 CANopen 支持时):
cd ~/Beremiz hg clone http://hg.beremiz.org/canfestival cd ~/Beremiz/canfestival ./configure --can=virtual make
- 构建 Modbus 库(仅需在需要 Modbus 支持时):
cd ~/Beremiz hg clone http://hg.beremiz.org/Modbus cd ~/Beremiz/Modbus make
- 构建 BACnet(仅需在需要 BACnet 支持时):
cd ~/Beremiz svn checkout https://svn.code.sf.net/p/bacnet/code/trunk/bacnet-stack/ BACnet cd BACnet make MAKE_DEFINE='-fPIC' MY_BACNET_DEFINES='-DPRINT_ENABLED=1 -DBACAPP_ALL -DBACFILE -DINTRINSIC_REPORTING -DBACNET_TIME_MASTER -DBACNET_PROPERTY_LISTS=1 -DBACNET_PROTOCOL_REVISION=16' library
- 构建 CanFestival(仅需在需要 CANopen 支持时):
-
启动 Beremiz IDE:
在虚拟环境中,运行以下命令启动 Beremiz IDE:~/Beremiz/venv/bin/python ~/Beremiz/beremiz/Beremiz.py
-
(可选)运行独立的 Beremiz 运行时:
如果需要运行独立的 Beremiz 服务,可以按照以下步骤:mkdir ~/beremiz_runtime_workdir ~/Beremiz/venv/bin/python ~/Beremiz/beremiz/Beremiz_service.py -p 61194 -i localhost -x 0 -a 1 ~/beremiz_runtime_workdir
然后,在 IDE 的项目设置中,将
BeremizRoot/URI_location
设置为PYRO://127.0.0.1:61194
。
请注意,Beremiz 的官方文档可能未完全覆盖 Ubuntu 20.04 的安装细节,您可能需要根据实际情况进行调整。 此外,Beremiz 的开发者邮件列表中有关于在 Ubuntu 20.04 上安装的讨论,您可以参考这些讨论以获取更多信息。 citeturn0search3