myems/myems-bacnet
13621160019@163.com 635fa307dd updated README 2021-03-31 12:30:34 +08:00
..
.gitignore udpated gitignore files 2021-02-20 20:18:31 +08:00
LICENSE merged myems-cleaning 2021-02-19 12:11:42 +08:00
README.md updated README 2021-03-31 12:30:34 +08:00
acquisition.py merged myems-bacnet 2021-02-19 11:21:43 +08:00
config.py merged myems-bacnet 2021-02-19 11:21:43 +08:00
main.py merged myems-bacnet 2021-02-19 11:21:43 +08:00
myems-bacnet.service merged myems-bacnet 2021-02-19 11:21:43 +08:00
myems_application.py merged myems-bacnet 2021-02-19 11:21:43 +08:00
test.py merged myems-bacnet 2021-02-19 11:21:43 +08:00

README.md

MyEMS BACnet Service

Introduction

This service is a component of MyEMS to acquire data from BACnet devices

Prerequisites

bacpypes

mysql.connector

Installation

Download and install MySQL Connector:

    $ cd ~/tools
    $ wget https://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python-8.0.20.tar.gz
    $ tar xzf mysql-connector-python-8.0.20.tar.gz
    $ cd ~/tools/mysql-connector-python-8.0.20
    $ sudo python3 setup.py install

Download and install bacpypes library

    $ cd ~/tools
    $ git clone https://github.com/pypa/setuptools_scm.git
    $ git clone https://github.com/pytest-dev/pytest-runner.git
    $ git clone https://github.com/JoelBender/bacpypes.git
    $ cd ~/tools/setuptools_scm/
    $ sudo python3 setup.py install
    $ cd ~/tools/pytest-runner/
    $ sudo python3 setup.py install
    $ cd ~/tools/bacpypes
    $ sudo python3 setup.py install
    $ sudo ufw allow 47808

Install myems-bacnet service

    $ cd ~
    $ git clone https://github.com/MyEMS/myems.git
    $ cd myems
    $ git checkout master (or the latest release tag)
    $ sudo cp -R ~/myems/myems-bacnet /myems-bacnet

Edit the config

    $ sudo nano /myems-bacnet/config.py

Setup systemd service:

    $ sudo cp myems-bacnet.service /lib/systemd/system/

Enable the service:

    $ sudo systemctl enable myems-bacnet.service

Start the service:

    $ sudo systemctl start myems-bacnet.service

Monitor the service:

    $ sudo systemctl status myems-bacnet.service

View the log:

    $ cat /myems-bacnet.log

Add Data Sources and Points in MyEMS Admin

Data source protocol:

bacnet-ip

Data source connection example:

{"host": "192.168.0.3", "port": 47808}

Point address example:

{"object_id":3002786,"object_type":"analogValue","property_array_index":null,"property_name":"presentValue"}

References

[1]. http://myems.io

[2]. http://bacnet.org

[3]. https://github.com/JoelBender/bacpypes