Update README.md

add some instructions for cangrow.sh
This commit is contained in:
DeltaLima 2024-10-22 03:11:38 +02:00
parent 4a14629e48
commit 947af0dd4d

View file

@ -1,10 +1,52 @@
# CanGrow - Arduino Code # CanGrow - An OpenSource grow controller firmware
Here the Code for CanGrow is contained. ## Build environment
A ESP8266 with Arduino Firmware is used (should most times be the standard already). 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 **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. in Project -> Settings -> Create/Make.