From 947af0dd4d2965f3a3ea317390da2f48a169648a Mon Sep 17 00:00:00 2001 From: DeltaLima Date: Tue, 22 Oct 2024 03:11:38 +0200 Subject: [PATCH] Update README.md add some instructions for cangrow.sh --- Arduino/CanGrow/README.md | 54 ++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/Arduino/CanGrow/README.md b/Arduino/CanGrow/README.md index 3eed107..5e63c99 100644 --- a/Arduino/CanGrow/README.md +++ b/Arduino/CanGrow/README.md @@ -1,10 +1,52 @@ -# CanGrow - Arduino Code +# CanGrow - An OpenSource grow controller firmware -Here the Code for CanGrow is contained. -A ESP8266 with Arduino Firmware is used (should most times be the standard already). +## Build environment +The helper script `cangrow.sh` is written for a Debian 12 system. + +To install all dependencies you need for building the firmware, run the cangrow.sh setup: + +```sh +$ ./cangrow.sh help +./cangrow.sh [setup|build|upload|webupload|monitor] +setup: setup build environment, download arduino-cli, install all dependencies for arduino ide +build: build firmware binary. will be saved into build/ +upload: upload firmware by serial connection /dev/ttyUSB0 +webupload: upload firmware with webupload to 192.168.4.20 +monitor: serial monitor /dev/ttyUSB0 + +# Install all dependencies for build environment +$ ./cangrow.sh setup +``` + +The script installs [arduino-cli](https://github.com/arduino/arduino-cli) to `~/.local/bin/arduino-cli`. + +## Compile + +```sh +# compile and output to build/CanGrow_v0.2...bin +# Default Target is ESP8266 D1 Mini +$ ./cangrow.sh build + +# Compile for ESP32 D1 Mini +$ export BOARD="esp32:esp32:d1_mini32" +$ ./cangrow.sh build + +# Build and webupload to IP +$ export IP="192.168.4.69" +$ ./cangrow.sh build # need to make .bin first +$ ./cangrow.sh webupload # upload + +# listen to serial monitor on /dev/ttyUSB2 +$ export TTY="/dev/ttyUSB2" +./cangrow.sh monitor +``` + +I wrote this project using [Geany IDE. ](https://www.geany.org/). The Geany Projectfile is also included, just run +``` +$ git clone https://git.la10cy.net/DeltaLima/CanGrow +$ cd CanGrow/Arduino/CanGrow +$ geany CanGrow.geany +``` -I wrote this project using [Geany IDE. ](https://www.geany.org/). The Geany Projectfile is also included. -Compiling is done with [arduino-cli](https://github.com/arduino/arduino-cli). It is supposed to be in -`~/.local/bin/arduino-cli`. **F8 compiles** the project, **F9 uploads** firmware to /dev/ttyUSB0. You can change these settings for .ino and .h files in Project -> Settings -> Create/Make.