HTML JavaScript Python Shell CSS C
Fetching latest commit…
Cannot retrieve the latest commit at this time.



Environmental Regulation System

Latest version: 6.2.1 Build Status Codacy Badge DOI

Mycodo Manual (PDF, HTML, TEXT)

Mycodo Wiki

Mycodo is an automated monitoring and regulation system that was built to run on the Raspberry Pi (versions Zero, 1, 2, and 3).

Originally designed to cultivate edible mushrooms, Mycodo has grown to include the ability to do much more, including cultivating plants, culturing microorganisms, maintaining honey bee apiary homeostasis, incubating animals and eggs, maintaining aquatic systems, aging cheeses, fermenting foods and tobacco, cooking food (sous-vide), and more.

The system comprises a backend (daemon) and a frontend (user interface). The backend conducts measurements from sensors and devices, then coordinate a diverse set of responses to those measurements, including the ability to modulate outputs (relays, PWM, wireless outlets), regulate environmental conditions with electrical devices under PID control (steady regulation or changing over time), schedule timers, capture photos and stream video, trigger actions when measurements meet certain conditions (modulate relays, execute commands, notify by email, etc.), and more. The frontend is a web interface that enables easy navigation and configuration from any browser-enabled device.

What is PID Control?

A proportional-derivative-integral (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.

PID Animation


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.

Software Features

  • Inputs: Periodically measure devices, such as analog-to-digital converters (ADCs), sensors (temperature, humidity, etc.), or add your own.
  • Outputs: Manipulate the environment by switching GPIO pins High or Low, switching relays, generating PWM signals, email notifications, executing linux commands, and more.
  • PID Controllers: Couple inputs with outputs to create feedback loops in order to regulate environmental conditions.
  • Methods: Change the desired condition over time (useful for reflow ovens, thermal cyclers, mimicking natural environmental changes, etc.)
  • Timers: Schedule the execution of actions at various times and intervals.
  • LCDs: Display measurements and data on 16x2 and 20x4 I2C-enabled LCD displays.
  • I2C Multiplexer Support: Allow multiple devices/sensors with the same I2C address to be used simultaneously.
  • Camera support: Raspberry Pi Camera and USB cameras, to stream live video (only Pi cam), capture still images and video, and create time-lapses.
  • Web Interface: Access using a web browser on your local network or anywhere in the world with an internet connection.
  • Secure Login: High-security login system utilizing the latest encryption and authorization standards.
  • System upgrade: When a new version is released on github, an upgrade can be initiated from the web interface.
  • Languages: English, Español (Spanish), Deutsche (German), Français (French), Russian, and Chinese (Change language under Configure -> Language)

Read the manual for details.

Supported Inputs

All supported Inputs can be found under Sensor Interfaces and Device Setup.


These install procedures have been tested to work with the Raspberry Pi (versions Zero, 1, 2, and 3) following a fresh install of Raspbian (Full or Lite version), with an active internet connection.

Once Raspbian has been installed, follow the guide below to set up the system prior to installing Mycodo.

Configure raspi-config

It's very important that you don't skip the file system expansion and reboot steps! These need to be done before continuing or there won't be enough free disk space to install Mycodo.

After writing Raspbian to an SD card and enabling ssh by creating a file named ssh on the boot partition, insert the SD card into the Pi and power the system. Whether you log in with the GUI or terminal via SSH to your Raspberry Pi's IP address for the first time (user: pi, password: raspberry), issue the following command to start raspi-config and set the following options.

sudo raspi-config

Then change the following settings

  • Change User Password (change the password from the default 'raspberry')
  • Localisation Options -> Change Locale (set and select en_US.UTF-8, if US)
  • Localisation Options -> Change Timezone
  • Interfacing Options -> SSH -> Enable
  • Advanced Options -> Expand Filesystem (*required*)
  • Reboot (*required*)

Install Mycodo

Mycodo will be installed by executing As a part of the installation, you will be prompted with a few options to determine which components to install and configure.

sudo apt-get install -y jq
cd ~
curl -s | \
jq -r '.tarball_url' | wget -i - -O mycodo-latest.tar.gz
mkdir Mycodo
tar xzf mycodo-latest.tar.gz -C Mycodo --strip-components=1
rm -f mycodo-latest.tar.gz
cd Mycodo/install
sudo /bin/bash ./

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

If the install is successful, the web user interface should be accessible by navigating a web browser to, replacing with your Raspberry Pi's IP address. The first time you visit this page, you will be prompted to create an admin user. After creating an admin user, you will be redirected to the login page. Once logged in, make sure the host name and version number at the top left is green, indicating the daemon is running. Red indicates the daemon is inactive or unresponsive. Ensure any java-blocking plugins are disabled for all parts of the web interface to function properly.

Install Notes

If you want write access to the mycodo files, add your user to the mycodo group, changing 'pi' to your user if it differs, then re-log in for the changes to take effect.

sudo adduser pi mycodo

In certain circumstances after the initial install or an upgrade, the mycodo daemon will not be able to start because of a missing or corrupt pip package. I'm still trying to understand why this happens and how to prevent it. If you cannot start the daemon, try to reinstall the required python modules with the following command:

sudo ~/Mycodo/env/bin/pip install -r ~/Mycodo/install/requirements.txt --upgrade --force-reinstall --no-deps

Then reboot

sudo shutdown now -r

If you receive an unresolvable error during the install, please create an issue. If you want to try to diagnose the issue yourself, see 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 other sources will have access to this information. The data collected is mainly how much specific features are used, and other similar statistics. The data that's collected can be viewed from the 'View collected statistics' link in the Settings -> General page or in the file ~/Mycodo/databases/statistics.csv. You may opt out from transmitting this information in the General settings.

Web Server Security

An SSL certificate will be generated (expires in 10 years) and stored at ~/Mycodo/mycodo/mycodo_flask/ssl_certs/ during the install process to allow SSL to be used to securely connect to the web interface. If you want to use your own SSL certificates, replace them with your own.

If using the auto-generated certificate from the install, be aware that it will not be verified when visiting the web interface using the https:// address prefix (opposed to http://). You may continually receive a warning message about the security of your site, unless you add the certificate to your browser's trusted list.


Mycodo can be easily upgraded from the web interface by selecting Upgrade from the configuration menu. Alternatively, an upgrade can be initiated from a terminal with the following command:

sudo /bin/bash ~/Mycodo/mycodo/scripts/ upgrade


The Mycodo Manual may be viewed as Markdown, PDF, HTML, or Plain Text


I have always made Mycodo free, and I don't intend on changing that to make a profit. However, if you would like to make a donation, you can find several options to do so at


Thanks for using and supporting Mycodo, however it may not be 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 or my web site.


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 for more details.

A full copy of the GNU General Public License can be found at

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


By default, mycodo will display the default language set by your browser. You may also force a language in the settings at [Gear Icon] -> Configure -> General -> Language


The native language used in the software.

Deutsche (German)

Mycodo ist ein automatisiertes Überwachungs- und Regelsystem, das auf dem Raspberry Pi (Versionen Zero, 1, 2 und 3) läuft.

Ursprünglich zur Kultivierung von essbaren Pilzen entwickelt, hat Mycodo die Fähigkeit, viel mehr zu tun, einschließlich der Kultivierung von Pflanzen, Kultivierung von Mikroorganismen, Aufrechterhaltung der Imkerei-Homöostase, Inkubation von Tieren und Eiern, Aufrechterhaltung aquatischer Systeme, Alterung von Käse, Fermentierung von Lebensmitteln und Tabak, Kochen Essen (sous-vide) und mehr.

Das System umfasst ein Backend (Daemon) und ein Frontend (Benutzerschnittstelle). Das Backend führt Messungen von Sensoren und Geräten durch und koordiniert dann verschiedene Reaktionen auf diese Messungen, einschließlich der Fähigkeit, Ausgänge (Relais, PWM, drahtlose Ausgänge) zu modulieren, Umgebungsbedingungen mit elektrischen Geräten unter PID-Kontrolle zu regulieren (stetige Regelung oder Umschaltung) Zeit), Timer planen, Fotos aufnehmen und Videos streamen, Aktionen auslösen, wenn Messungen bestimmte Bedingungen erfüllen (Relais modulieren, Befehle ausführen, per E-Mail benachrichtigen usw.) und vieles mehr. Das Frontend ist eine Webschnittstelle, die eine einfache Navigation und Konfiguration von jedem browserfähigen Gerät ermöglicht.

Español (Spanish)

Mycodo es un sistema de control remoto y automatizado con un enfoque en la modulación de las condiciones ambientales. Fue construido para ejecutarse en el Raspberry Pi (versiones Zero, 1, 2 y 3) y tiene como objetivo ser fácil de instalar y operar.

El sistema central coordina un conjunto diverso de respuestas a las mediciones de sensores, incluyendo acciones tales como grabación de cámara, notificaciones por correo electrónico, activación / desactivación de relés, regulación con control PID y más.

Mycodo se ha utilizado para cultivar hongos gourmet, cultivar plantas, cultivar microorganismos, mantener la homeostasis del apiario de abejas, incubar huevos de serpiente y animales jóvenes, envejecer quesos, fermentar alimentos, mantener sistemas acuáticos y mucho más.

Français (French)

Mycodo est un système de surveillance à distance et de régulation automatisée, axé sur la modulation des conditions environnementales. Il a été construit pour exécuter dans le Raspberry Pi (versions Zero, 1, 2 et 3) et vise à être facile à installer et à utiliser.

Le système de base coordonne un ensemble divers de réponses aux mesures de capteurs, y compris des actions telles que l'enregistrement de caméra, les notifications par courrier électronique, l'activation / désactivation de relais, la régulation avec contrôle PID, et plus encore.

Mycodo a été utilisé pour cultiver des champignons gourmands, cultiver des plantes, cultiver des micro-organismes, entretenir l'homéostasie du rucher des abeilles, incuber les œufs de serpent et les jeunes animaux, vieillir les fromages, fermenter les aliments, entretenir les systèmes aquatiques et plus encore.


Первоначально разработанный для выращивания съедобных грибов, Mycodo вырос, чтобы включать в себя способность делать гораздо больше, в том числе выращивать растения, культивировать микроорганизмы, поддерживать гомеостаз медоносной пчелы, инкубировать животных и яйца, поддерживать водные системы, стареющие сыры, ферментировать продукты и табак, готовить еда (sous-vide) и многое другое.

Система содержит бэкэнд (демон) и интерфейс (пользовательский интерфейс). Бэкэнд выполняет измерения от датчиков и устройств, затем координирует разнообразные ответы на эти измерения, в том числе возможность модулировать выходы (реле, ШИМ, беспроводные розетки), регулировать условия окружающей среды с помощью электрических устройств под ПИД-регулированием (устойчивое регулирование или изменение время), расписание таймеров, сбор фотографий и потоковое видео, триггерные действия, когда измерения соответствуют определенным условиям (модулировать реле, выполнять команды, уведомлять по электронной почте и т. д.) и многое другое. Интерфейс - это веб-интерфейс, который обеспечивает удобную навигацию и настройку с любого устройства с поддержкой браузера.


Mycodo最初设计用于种植可食用的蘑菇,已经发展到能够做更多的工作,包括种植植物, 培养微生物,维持蜂蜜蜂房稳态,孵化动物和鸡蛋,维持水生系统,陈年奶酪, 发酵食品和烟草,烹饪食物(sous-vide)等等。

该系统包括后端(守护进程)和前端(用户界面)。后端从传感器和设备进行测量, 然后协调对这些测量的各种响应,包括调制输出(继电器,PWM,无线插座)的能力, 通过PID控制的电气设备调节环境条件(稳定调节或转换时间),安排计时器,捕获照片和流视频, 在测量满足特定条件时触发动作(调制继电器,执行命令,通过电子邮件通知等) 等等。前端是一个Web界面,可以从任何支持浏览器的设备轻松导航和配置。