Mycodo:Raspberry Pi 环境调控系统,支持传感器输入、设备控制与自动化管理

An environmental monitoring and regulation system

分支15Tags318
文件最后提交记录最后更新时间
10 个月前
1 年前
10 个月前
10 个月前
3 年前
4 个月前
5 个月前
3 年前
5 个月前
5 个月前
9 年前
8 个月前
1 年前
1 年前

Mycodo

环境调控系统

最新版本:8.16.2

Mycodo 是一款适用于树莓派的开源软件,它能以有趣的方式将输入与输出相结合,实现对环境的感知与调控。

|Build Status| |Codacy Badge| |Translation Badge| |DOI|

.. contents:: 目录 :depth: 1

快速安装

前提条件:基于 Debian 的 Linux 操作系统(已在 Raspberry Pi OS 13 Trixie 上测试)。

推荐配置:带有通用输入输出(GPIO)引脚的单板计算机(SBC)。

安装命令:

.. code:: bash

curl -L https://kizniche.github.io/Mycodo/install | bash

更多详细信息,请参见 安装 Mycodo 部分。

支持

文档


[Mycodo Manual](https://kizniche.github.io/Mycodo)

[Mycodo API](https://kizniche.github.io/Mycodo/mycodo-api.html) (Version: v1)

[Mycodo Wiki](https://github.com/kizniche/Mycodo/wiki)

[Mycodo Custom Module Repository](https://github.com/kizniche/Mycodo-custom)

Discussion
~~~~~~~~~~

[Mycodo Issues (Bug Reports/Feature Requests)](https://github.com/kizniche/Mycodo/issues)

[Mycodo Forum](https://forum.radicaldiy.com)

[Mycodo Discord](https://discord.gg/kmDNky4ZHZ)

Bug in the Mycodo Software

如果您认为Mycodo软件中存在错误,请先查看github上的“Issues”(https://github.com/kizniche/Mycodo/issues),确认您的问题是否已在近期被讨论或解决。如果您的问题是新出现的,或者与类似问题相比有明显的时效性差异,您可以创建一个“New Issue”(https://github.com/kizniche/Mycodo/issues/new)。创建新Issue时,请务必阅读Issue模板中的所有信息并按照说明操作。将模板文本替换为所需的具体信息(例如,“Steps to Reproduce the issue”下的“step 1”应替换为复现该问题的实际步骤)。您提供的信息越详细,就越容易复现和诊断问题。如果因信息不足而无法复现问题,可能会延误甚至阻碍问题的解决。

捐赠

我一直将Mycodo免费提供给大家,并且不打算改变这一点。但是,如果您觉得Mycodo对您有用,并希望支持其持续开发,请考虑通过github.com/sponsors/kizniche(https://github.com/sponsors/kizniche)成为赞助者,或通过kylegabriel.com/donate(https://kylegabriel.com/donate)进行捐赠。

功能特点

.. image:: https://kylegabriel.com/projects/wp-content/uploads/sites/3/2020/06/Screenshot_2020-04-25-hydra-Default-Dashboard-Mycodo-8-4-0-dashboard_2.png :target: https://kylegabriel.com/projects/wp-content/uploads/sites/3/2020/06/Screenshot_2020-04-25-hydra-Default-Dashboard-Mycodo-8-4-0-dashboard_2.png

图:“Automated Hydroponic System Build”(自动化水培系统搭建)(https://kylegabriel.com/projects/2020/06/automated-hydroponic-system-build.html)


用途

Mycodo 最初是为了培育可食用蘑菇而开发的,如今其功能已得到极大扩展。以下是 Mycodo 的一些应用案例:

Kyle Gabriel(核心开发者)的项目


-  [Mushroom Cultivation Automation](https://kylegabriel.com/projects/2021/09/mushroom-cultivation-automation.html) ([Archive](https://archive.is/HUtdp))
-  [Hydroponic System Automation](https://kylegabriel.com/projects/2020/06/automated-hydroponic-system-build.html) ([Archive](http://archive.is/mB2zc))
-  [Mushroom cultivation](https://kylegabriel.com/projects/2015/04/mushroom-cultivation-revisited.html) ([Archive](http://archive.is/J92Xa))
-  [Ground-based plant cultivation](https://www.youtube.com/watch?v=QNCx_VE7D-8)
-  [Maintaining honey bee apiary homeostasis](https://kylegabriel.com/projects/2015/12/environmentally-controlled-apiary.html) ([Archive](http://archive.is/RLo6n))
-  [Maintaining humidity in an underground artificial bat cave](https://kylegabriel.com/projects/2015/10/artificial-bat-cave.html) ([Archive](http://archive.is/QIJ5G))
-  [Remote radiation monitoring and mapping](https://kylegabriel.com/projects/2019/08/remote-radiation-monitoring.html) ([Archive](http://archive.is/PF44Z))
-  [Cooking sous-vide](https://hackaday.io/project/11997-mycodo-environmental-regulation-system/log/45733-sous-vide-pid-tuning-and-the-unexpected-electrical-fire) ([Archive](http://archive.is/Mx52U))
-  [Maintaining a light schedule and regulating humidity](https://fieldstation.kennesaw.edu/summer-days-2020.php#2020_07_16_gabriel_chestnut), ramping from 90 % to 50 % over a 4 week period to acclimatize micropropagated American chestnut plantlets from laboratory to ambient outdoor conditions ([Archive](http://archive.is/Jp60P))

Featured Projects
~~~~~~~~~~~~~~~~~

.. image:: https://kylegabriel.com/projects/wp-content/uploads/sites/3/2021/09/MushroomCultivation_512x288.jpg
   :target: https://www.youtube.com/watch?v=z41Wy5ZF4O8

.. image:: https://kylegabriel.com/projects/wp-content/uploads/sites/3/2020/07/VID_PROJ_HYDRO_512x288.jpg
   :target: https://www.youtube.com/watch?v=nyqykZK2Ev4

Projects by Others
~~~~~~~~~~~~~~~~~~

-  Maintaining aquatic systems (e.g. fish, hydroponic, aquaponic)
-  Maintaining terrarium, herpetarium, and vivarium environments
-  Incubating young animals and eggs
-  Aging cheese
-  Dry-aging, curing, and smoking meat ([Link 1](http://www.charcuterie-worst.nl/forum/index.php/topic,425.0.html) ([Archive](http://archive.is/NHKqp)), [Link 2](https://www.floriske.nl/wordpress/2019/06/meat-curing-cabinet/) ([Archive](https://archive.ph/57ouJ)))
-  Fermenting beer, food, and tobacco
-  Controlling reflow ovens
-  Culturing microorganisms
-  [Treating agricultural waste water](https://projects.sare.org/project-reports/gne17-158/) ([Archive](http://archive.is/enJQs), [Publication](https://pubs.acs.org/doi/pdf/10.1021/acsestwater.0c00234))
-  ...and more

[Let me know](https://kylegabriel.com/contact/) how you use Mycodo and I may include it on this list.

Screenshots
-----------

Visit the [Screenshots](https://github.com/kizniche/Mycodo/wiki/Screenshots) page of the Wiki.

Install Mycodo
--------------

Prerequisites
~~~~~~~~~~~~~

Required:

-  Debian-based operating system (tested with Raspberry Pi OS 13 Trixie)
-  An active internet connection

Recommended:

-  [Raspberry Pi](https://www.raspberrypi.org) single-board computer: 3, 4, or 5 (Zero, 1, and 2 are no longer recommended)
-  [Raspberry Pi Operating System](https://www.raspberrypi.com/software/) flashed to a micro SD card or SSD

Mycodo has been tested to work with Raspberry Pi OS 13 (Trixie release), Lite and Desktop, 32-bit and 64-bit.

Install Command
~~~~~~~~~~~~~~~

Once you have the Raspberry Pi booted, log in and run the following command in a terminal to initiate the Mycodo install to /opt/Mycodo:

.. code:: bash

    curl -L https://kizniche.github.io/Mycodo/install | bash


Install Notes
~~~~~~~~~~~~~

Make sure the install script finishes without errors. A log of the output will be created at ``/opt/Mycodo/install/setup.log``.

If the install is successful, the web user interface should be accessible by navigating a web browser to ``https://127.0.0.1/``, replacing ``127.0.0.1`` with the IP address of the computer you installed on. Upon your first visit, you will be prompted to create an admin user before being redirected to the login page. Once logged in, check that the time is correct at the top left of the page. Incorrect time can cause a number of issues with measurement storage and retrieval in a time-series database. Also ensure the host name and version number at the top left of the page is green, indicating the daemon is running. If it's red, it indicates the daemon is inactive or unresponsive. Last, ensure any java-blocking plugins of your browser are disabled for all parts of the web interface to function properly.

If you receive an error during the install that you believe is preventing your system from operating, please [create an issue](https://github.com/kizniche/Mycodo/issues) with the install log attached. If you would first like to attempt to diagnose the issue yourself, see [Diagnosing Issues](#diagnosing-issues).

A minimal set of anonymous usage statistics are collected to help improve development. No identifying information is saved from the information that is collected and it is only used to improve Mycodo. No one other than the development team will have access to this information and it will never be sold. The data collected is mainly what and how many features are used, and other similar information. The data that's collected can be viewed from the 'View collected statistics' link in the ``Settings -> General`` page. There is an opt out option on the General Settings page if you want to turn this functionality off.

Measurement Database
~~~~~~~~~~~~~~~~~~~~

Mycodo currently supports InfluxDB as the time-series database used to store measurements. Both versions 1.x (for 32-bit systems) and 2.x (for 64-bit systems) are supported. During the install, you will be prompted to install 1.x, 2.x, or none (if you wish to set up your own, either locally or remotely). The settings for the database can be reconfigured after install.

Docker
~~~~~~

Docker support is experimental, but if you want to try it, read the docker [README.md](https://github.com/kizniche/Mycodo/blob/master/docker/README.md). There is also a [Docker Issue (#637)](https://github.com/kizniche/Mycodo/issues/637) on github for those that wish to help with development.

REST API
--------

The latest API documentation can be found here: [API Information](https://kizniche.github.io/Mycodo/API/) and [API Endpoint Documentation](https://kizniche.github.io/Mycodo/mycodo-api.html).

About PID Control
-----------------

A [proportional–integral–derivative (PID) controller](https://en.wikipedia.org/wiki/PID_controller) is a control loop feedback mechanism used throughout industry for controlling systems. It efficiently brings a measurable condition, such as temperature, to a desired state (setpoint). A well-tuned PID controller can raise to a setpoint quickly, have minimal overshoot, and maintain the setpoint with little oscillation.

.. figure:: docs/images/PID-Animation.gif
   :alt: PID Animation


|Mycodo|

The top graph visualizes the regulation of temperature. The red line is the desired temperature (setpoint) that has been configured to change over the course of each day. The blue line is the actual recorded temperature. The green vertical bars represent how long a heater has been activated for every 20-second period. This regulation was achieved with minimal tuning, and already displays a very minimal deviation from the setpoint (±0.5° Celsius). Further tuning would reduce this variability further.

See the [PID Controller](https://kizniche.github.io/Mycodo/Functions/#pid-controller) and [PID Tuning](https://kizniche.github.io/Mycodo/Functions/#pid-tuning) sections of the manual for more information.

Supported Inputs and Outputs
----------------------------

All supported Inputs, Outputs, and other devices can be found under the [Supported Devices](https://kizniche.github.io/Mycodo/Supported-Inputs-By-Measurement/) section of the manual.

Custom Inputs, Outputs, Functions, Actions, and Widgets
-------------------------------------------------------

Mycodo supports importing custom Input, Output, Function, Action, and Widget modules. you can find more information about each in the manual under [Custom Inputs](https://kizniche.github.io/Mycodo/Inputs/#custom-inputs), [Custom Outputs](https://kizniche.github.io/Mycodo/Outputs/#custom-outputs), [Custom Functions](https://kizniche.github.io/Mycodo/Functions/#custom-functions), [Custom Actions](https://kizniche.github.io/Mycodo/Functions/#custom-actions), and [Custom Widgets](https://kizniche.github.io/Mycodo/Data-Viewing/#custom-widgets).

If you would like to add to the list of supported Inputs, Outputs, Functions, Actions, and Widgets, submit a pull request with the module you created or start a [New Issue](https://github.com/kizniche/Mycodo/issues/new?assignees=&labels=&template=feature-request.md&title=).

Additionally, I have another github repository devoted to custom modules that do not necessarily fit with the built-in set and are not included by default with Mycodo, but can be imported. These can be found at [kizniche/Mycodo-custom](https://github.com/kizniche/Mycodo-custom).

Links
-----

Thanks for using and supporting Mycodo, however depending where you found this documentation, you may not have the latest version or it may have been altered, if not obtained through an official distribution site. You should be able to find the latest version on github.

https://github.com/kizniche/Mycodo

https://KyleGabriel.com

https://RadicalDIY.com

License
-------

See [License.txt](https://github.com/kizniche/Mycodo/blob/master/LICENSE.txt)

Mycodo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Mycodo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [GNU General Public License](http://www.gnu.org/licenses/gpl-3.0.en.html) for more details.

A full copy of the GNU General Public License can be found at http://www.gnu.org/licenses/gpl-3.0.en.html

This software includes third party open source software components. Please see individual files for license information, if applicable.

Languages
---------

Mycodo has been translated to several languages. Weblate is now used so anyone can contribute to translations. However, due to an increasing number of new languages being added and not translated, only languages that are at least 50% complete will be included in Mycodo as a translation option.

|Translation Table|

-  Native: [English](https://kizniche.github.io/Mycodo/)
-  [Dutch](https://kizniche.github.io/Mycodo/index.nl/),
   [German](https://kizniche.github.io/Mycodo/index.de/),
   [French](https://kizniche.github.io/Mycodo/index.fr/),
   [Indonesian](https://kizniche.github.io/Mycodo/index.id/),
   [Italian](https://kizniche.github.io/Mycodo/index.it/),
   [Norwegian](https://kizniche.github.io/Mycodo/index.nn/),
   [Polish](https://kizniche.github.io/Mycodo/index.pl/),
   [Portuguese](https://kizniche.github.io/Mycodo/index.pt/),
   [Russian](https://kizniche.github.io/Mycodo/index.ru/),
   [Serbian](https://kizniche.github.io/Mycodo/index.sr/),
   [Spanish](https://kizniche.github.io/Mycodo/index.es/),
   [Swedish](https://kizniche.github.io/Mycodo/index.sv/),
   [Turkish](https://kizniche.github.io/Mycodo/index.tr/),
   [Chinese](https://kizniche.github.io/Mycodo/index.zh/).

The install script will prompt you to select a language. This will be the set language when you first open the web user interface. You may change this at a later time on the settings page at ``[Gear Icon] -> Configure -> General -> Language``.

If you would like to contribute to the translations, you can do so at [http://translate.kylegabriel.com](https://translate.kylegabriel.com/engage/mycodo/). Please read [How To Contribute to Language Translations in Mycodo](https://forum.radicaldiy.com/t/how-to-contribute-to-language-translations-in-mycodo/1162/2) for more information.

Thanks
------

Mycodo is made possible, in part, by the many fine open source libraries, below.

-  [Alembic](https://alembic.sqlalchemy.org)
-  [Argparse](https://pypi.org/project/argparse)
-  [Bcrypt](https://pypi.org/project/bcrypt)
-  [Bootstrap](https://getbootstrap.com)
-  [Daemonize](https://pypi.org/project/daemonize)
-  [Date Range Picker](https://github.com/dangrossman/daterangepicker)
-  [Distro](https://pypi.org/project/distro)
-  [Email_Validator](https://pypi.org/project/email_validator)
-  [Filelock](https://pypi.org/project/filelock)
-  [Flask](https://pypi.org/project/flask)
-  [Flask_Accept](https://pypi.org/project/flask_accept)
-  [Flask_Babel](https://pypi.org/project/flask_babel)
-  [Flask_Compress](https://pypi.org/project/flask_compress)
-  [Flask_Limiter](https://pypi.org/project/flask_limiter)
-  [Flask_Login](https://pypi.org/project/flask_login)
-  [Flask_Marshmallow](https://pypi.org/project/flask_marshmallow)
-  [Flask_Profiler](https://github.com/muatik/flask-profiler)
-  [Flask_RESTX](https://pypi.org/project/flask_restx)
-  [Flask_Session](https://pypi.org/project/flask_session)
-  [Flask_SQLAlchemy](https://pypi.org/project/flask_sqlalchemy)
-  [Flask_Talisman](https://pypi.org/project/flask_talisman)
-  [Flask_WTF](https://pypi.org/project/flask_wtf)
-  [FontAwesome](https://fontawesome.com)
-  [Geocoder](https://pypi.org/project/geocoder)
-  [gridstack.js](https://github.com/gridstack/gridstack.js)
-  [Gunicorn](https://gunicorn.org)
-  [Highcharts](https://www.highcharts.com)
-  [importlib_metadata](https://github.com/python/importlib_metadata)
-  [InfluxDB](https://github.com/influxdata/influxdb)
-  [influxdb](https://github.com/influxdata/influxdb-python)
-  [influxdb_client](https://github.com/influxdata/influxdb-client-python)
-  [jQuery](https://jquery.com)
-  [Marshmallow_SQLAlchemy](https://pypi.org/project/marshmallow_sqlalchemy)
-  [Pyro5](https://github.com/irmen/Pyro5)
-  [SQLAlchemy](https://www.sqlalchemy.org)
-  [SQLite](https://www.sqlite.org)
-  [toastr](https://github.com/CodeSeven/toastr)
-  [Werkzeug](https://palletsprojects.com/p/werkzeug/)
-  [WTForms](https://pypi.org/project/wtforms)


.. |Build Status| image:: https://github.com/kizniche/Mycodo/actions/workflows/main.yml/badge.svg
   :target: https://github.com/kizniche/Mycodo/actions/workflows/main.yml
.. |Codacy Badge| image:: https://app.codacy.com/project/badge/Grade/bb5ffc43e4444231b813ca6e81359336
   :target: https://www.codacy.com/gh/kizniche/Mycodo/dashboard?utm_source=github.com&utm_medium=referral&utm_content=kizniche/Mycodo&utm_campaign=Badge_Grade
.. |Translation Badge| image:: https://translate.kylegabriel.com/widget/mycodo/git-translation/svg-badge.svg
   :target: https://translate.kylegabriel.com/engage/mycodo/
.. |Translation Table| image:: https://translate.kylegabriel.com/widget/mycodo/git-translation/multi-auto.svg
   :target: https://translate.kylegabriel.com/engage/mycodo/
.. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.824199.svg
   :target: https://doi.org/10.5281/zenodo.824199
.. |Mycodo| image:: https://kylegabriel.com/projects/wp-content/uploads/sites/3/2016/05/Mycodo-3.6.0-tango-Graph-2016-05-21-11-15-26.png
   :target: https://kylegabriel.com/projects/