Skip to content

Instantly share code, notes, and snippets.

@novemberalpha
novemberalpha / pfc1-potted-tomato-recipe.json
Last active June 25, 2018 05:14
A PFC1 recipe for potted tomatoes!
{
"_id": "pfc1-potted-tomatoes-72days",
"format": "phased",
"version": "1.0",
"optimization": [
"general purpose"
],
"date_created": "2017-05-14",
"author": "openag",
"operations": [
@novemberalpha
novemberalpha / pfc1-recipe_generator.py
Created May 18, 2017 18:49
A recipe generator version to create recipes for the PFC1
import json
import operator
### Set parameters #############################################################
recipe_name = 'Tangerine-air-flush-cooling-2'
recipe_format = 'simple'
cycles = 7 # cycles
day_length = 12 # hours
light_intensity = 1 # 1 for on, 0 for off
night_length = 12 # hours
{
"_id": "Air-flush-cooling",
"format": "simple",
"operations": [
[
0,
"light_intensity",
1
],
[
{
"_id": "pfc1-general_greens",
"format": "phased",
"version": "1.0",
"optimization": [
"general purpose"
],
"date_created": "2017-05-14",
"author": "openag",
"operations": [
@novemberalpha
novemberalpha / install_openag_ui.md
Last active May 18, 2017 21:22
How to build and deploy the openag_ui on a OpenAg compliant device.

How To Install and Deploy the latest openag_ui as a couchapp

Run all the shell commands inside the Raspberry Pi.

Optional: install nodejs/npm

tl;dr: Installing Node.js via package manager

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -

sudo apt-get install -y nodejs

NGROK OPENAG

Installing a ngrok tunnel on your openag_brain will allow you to access it from anywhere in the world.

Follow these steps:

  1. Create an account at ngrok.com (it's free)
  2. Download ngrok onto your Raspberry Pi
    • wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip
  3. Unzip the ngrok app in your home folder
  • unzip ngrok-stable-linux-arm.zip
Step 1: Create new autologin.conf file
sudo nano /etc/systemd/system/[email protected]/autologin.conf
Step 2: Add these lines
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin pi --noclear %I 38400 linux
Step 3: Save file with ctrl-x
@novemberalpha
novemberalpha / dht22-firmware-module.json
Last active April 17, 2017 04:18
OpenAg DHT22 Firmware JSON
{
"_id": "dht22_1",
"type": "dht22",
"environment": "environment_1",
"arguments": [
2
],
"outputs": {
"air_temperature": {
"variable": "air_temperature"