farmbot v6.4.1 API Reference

Modules

Supervises the individual modules that make up the Farmbot Application. This is the entry point of the application

Hello Phoenix

The current device. Should only ever be one of these. If not there is a huge problem probably higher up the stack

FarmEvent’s are events that happen on a schedule. When it is time for the event to execute one of several things may happen

A GenericPointer is just a normal pointer with no special stuff

Peripherals are descriptors for pins/modes

A Point is a location in the planting bed as denoted by X Y and Z

A Regimen is a schedule to run sequences on

Sensors are descriptors for pins/modes

A Sequence is a list of CeleryScript nodes

A Tool is an item that lives in a ToolSlot

A ToolSlot is the Point to a Tool

Background worker that refreshes a token every 30 minutes

Functionality responsible for getting a JWT

Handles uploading and downloading of Farmbot OS and Firmware configs

Bootstraps the application

Central bot state that gets pushed out over transports.

  • JSON Serializable
  • Global
  • Scary

Interface for job progress

AMQP Bot State Transport

RESTful API for accessing internal Farmbot state

Plug for authorizing local REST access

Underlying router for HTTP Transport

Utility functions for handling bot_state data

CeleryScript is the scripting language that Farmbot OS understands

Handy functions for turning various data types into Farbot Celery Script Ast nodes

CeleryScript Argument

A heap-ish data structure required when converting canonical CeleryScript AST nodes into the Flat IR form. This data structure is useful because it addresses each node in the CeleryScript tree via a unique numerical index, rather than using mutable references. MORE INFO: https://github.com/FarmBot-Labs/Celery-Slicer

CeleryScript Node

ORIGINAL IMPLEMENTATION HERE: https://github.com/FarmBot-Labs/Celery-Slicer Take a nested (“canonical”) representation of a CeleryScript sequence and transofrms it to a flat/homogenous intermediate representation which is better suited for storage in a relation database

Protocol to be implemented by any struct that can be executed by Farmbot.FarmEvent.Manager

Manages execution of FarmEvents

Farmware is Farmbot’s plugin system. Developing a farmware is simple. You will need 3 things:

  • A manifest.json hosted on the internet somewhere.
  • A zip package of your farmware

Handles installation of Farmwares and syncronization of Farmware Repos

A Repository is a way of enabling multiple farmware’s at a time

An entry in the Repository

Init module for installing first party farmware repo. Requires internet

Metadata about a Farmware

Handles execution of a Farmware

Allows communication with the firmware

Structured data to be sent to the Firmware

Module responsible for timing emails about E stops

Firmware paramaters

Any module that implements this behaviour should be a GenStage

Stubs out firmware functionality when you don’t have an arduino

Handles communication between farmbot and uart devices

Init module for configuring a UART handler. Here’s what it does

Each message is one line. This framer appends and removes newline sequences as part of the framing. Buffering is performed internally, so users can get the complete messages under normal circumstances. Attention should be paid to the following

Helpful utilities for working with Firmware data

A three position vector

Wraps an HTTP Adapter

Behaviour for a Farmbot HTTP adapter implementation

Farmbot HTTP adapter for accessing the world and farmbot web api easily

Helpful stuff

Watches a directory on the File System and uploads images

HTTP Response

Host implementation for Farmbot.System

Functions for dealing with the Farmbot JSON Web Token

Helper Functions/Macros for common things

Farmbot Log Object

Log messages to Farmot endpoints

Farmbot project config

Manages a Regimen

Provides global names for running regimens as started by the RegimenSupervisor

JSON Formatters truncate .0 on floats

Stores JSON as :text data type

Custom Ecto.Type for changing a string to a module

Custom Ecto.Type for changing a string field to one of [“Sequence”, “Regimen”]

Custom Ecto.Type for changing a string field to one of [“GenericPointer”, “ToolSlot”, “Plant”]

Event system for receiving inserts, updates, or deletions of assets

Handles syncing and caching of HTTP data

Common functionality that should be implemented by a system

Repo for storing config data

Handles dispatching config changes

Union between device (linux) pin and Farmbot Sequence

A persistent regimen is a join between a started farm event and the regimen it is set to operate on. These are stored in the database to persist reboots, crashes etc

describes an update to a API resource

Supervisor for Various debugging modules

Handles GPIO inputs

Behaviour for GPIO handlers to implement

Stub for handling GPIO

Lets write init.d in Elixir!

Init module for bringup and teardown of ecto

Loads kernel modules at boot

Farmbot System Global Registry

Supervises Platform specific stuff for Farmbot to operate

Behaviour for setting up OTA updates

Handles over the air updates

Helper functions for working with time

Exceptions

Error executing a Farmware

Some Farmbot HTTP Adapter error

Mix Tasks

Sign a firmware

Upload a firmware to slack

Generate a CeleryScript Node

Build a production firmware image file