Skip to content

Commit

Permalink
easypot1 docs update, reference guide structure created
Browse files Browse the repository at this point in the history
  • Loading branch information
ogghst committed Jan 17, 2022
1 parent 3153586 commit 52000bd
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 53 deletions.
21 changes: 11 additions & 10 deletions components/grownode/boards/gn_easypot1.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,17 @@

gn_leaf_config_handle_t moist, temp, led_moist, led_temp;

double moist_min, moist_max, moist_last, temp_min, temp_max, temp_last;
double moist_last, temp_last;

double blink_time_high = 1000;
double blink_time_low = 300;
//sets the tresholds
const double moist_min = 1;
const double moist_max = 3;
const double temp_min = 15;
const double temp_max = 28;

//milliseconds to blink for low and high values
const double blink_time_high = 300;
const double blink_time_low = 2000;

void moisture_callback(const gn_leaf_config_handle_t moist) {

Expand Down Expand Up @@ -97,13 +104,7 @@ void temp_callback(const gn_leaf_config_handle_t temp) {
void gn_configure_easypot1(gn_node_config_handle_t node) {

//leaves
esp_log_level_set("gn_leaf_led", ESP_LOG_DEBUG);

//sets the tresholds
moist_min = 1;
moist_max = 3;
temp_min = 15;
temp_max = 28;
//esp_log_level_set("gn_leaf_led", ESP_LOG_INFO);

//creates the moisture sensor
moist = gn_leaf_create(node, "moist", gn_capacitive_moisture_sensor_config,
Expand Down
46 changes: 43 additions & 3 deletions docs/boards_easypot1.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Goal of this board is to introduce you to GrowNode platform, using super common
- Temperature detection
- Access to online tracking system to track your growing progress

The board is equipped with LED showing the need to water your plant, excess light and temperature out of target
The board is equipped with LED showing the need to water your plant, excess light and temperature out of target. They will start to blink fast when the parameters are exceeding a treshold, and low when getting lower than this.

##Bill of Material

Expand All @@ -34,8 +34,48 @@ final configuration will look like:

##Code

The configuration code is contained in `components\grownode\boards\easypot1.c`.
The configuration code, other than `main\main.c` is contained in `components\grownode\boards\easypot1.c`. The code is meant to be basic in order to give you some training to basic features.

### The Main

You just need to 'load' the board into the firmware

- add an `include "easypot1.h"` directive on the header declarations
- change the configuration row from the standard `gn_configure_blink(node)` to `gn_configure_easypot1(node)`

This will tell the compiler to load the easypot1 code into the firmware upon the next build.

### The Board

On top of `easypot1.c` you have some configuration parameters:

```
...
//sets the tresholds
const double moist_min = 1;
const double moist_max = 3;
const double temp_min = 15;
const double temp_max = 28;
...
```

Those are setting the tresholds where the board shall start warning you with LED blinking

There is also the possibility to configure the blinking time in msec

```
...
//milliseconds to blink for low and high values
const double blink_time_high = 300;
const double blink_time_low = 2000;
...
```

##Controlling the pot

todo
If you enable networking, you will start receiving MQTT messages to your broker. For a detailed explanation, see [Reference Guide](reference.md).
What you can do is
- Receive updates over moisture and temperature sensors
- Monitor LED statuses
- Enable/disable the sensor updates
- Manually turn on/off LEDs
78 changes: 39 additions & 39 deletions docs/platform.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
# A quick look into GrowNode systems
# Reference Guide

This page describes how the GrowNode platform is structured and the technology behind it.
## Node

## Architecture
### Responsibilites
todo

A full GrowNode system architecture is composed by
### Configuration
todo

- one or more grownode boards (called nodes)
- each board is connected to several sensors (called leaves)
- a messaging server where each board talks using MQTT
- an automation server - like openhab, home assistant - that orchestrate the node operations
- several clients to display and manage nodes
- other systems, like home automation, gardening, that works together with grownode
### Examples
todo

<p align="center">
<img src="../img/grownode_net.png">
</p>

## Working tools
## Leaves

GrowNode aims to use most common development tools. Actual release is composed by:
### Responsibilites
todo

### Hardware
### Configuration
todo

- [ESP32](https://www.espressif.com/en/products/socs/esp32) and above microcontrollers
- Common sensors and actuators (relay, PWM output, temperature probes, capacitance sensors..) with any esp-idf compatible libraries

- (optional) Various displays tested (ILI9341) with touch screen (tested XPT2046) capabilities
- (optional) A server like a raspberry to host the server side components in case you want to develop a network solution

### Examples
todo

### Software Components
## Parameters

- ESP-IDF (release 4.4) programming environment

- (optional) MQTT broker as a messaging system - if you want to exchange info between boards and servers
- (optional) LVGL as display library - if you want to attach a screen to display your sensor values
- (optional) OpenHab/Home Assistant as a controller
### Responsibilites
todo

## Functionalities
### Configuration
todo

Grownode provides functionalities that lets you kickstart your projects in minutes:
### Examples
todo

## MQTT Protocol

todo

### Leaf - Server messaging

todo

### Leaf - leaf messaging

todo


## Display Configuration

todo

- SoftAP/Bluetooth Provisioning to join and change your wireless network without any hardcode configuration through a mobile app
- High level device configuration through makefile
- Firmware update Over The Air
- NTP clock sync
- Persistent storage of parameters
- Sensor and Actuators configuration abstracting the hardware level
- Transparent networking protocol (presentation, keepalive, logging)
- Client/Server and Client/Client parameter retrieval and update through MQTT

53 changes: 53 additions & 0 deletions docs/reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# A quick look into GrowNode systems

This page describes how the GrowNode platform is structured and the technology behind it.

## Architecture

A full GrowNode system architecture is composed by

- one or more grownode boards (called nodes)
- each board is connected to several sensors (called leaves)
- a messaging server where each board talks using MQTT
- an automation server - like openhab, home assistant - that orchestrate the node operations
- several clients to display and manage nodes
- other systems, like home automation, gardening, that works together with grownode

<p align="center">
<img src="../img/grownode_net.png">
</p>

## Working tools

GrowNode aims to use most common development tools. Actual release is composed by:

### Hardware

- [ESP32](https://www.espressif.com/en/products/socs/esp32) and above microcontrollers
- Common sensors and actuators (relay, PWM output, temperature probes, capacitance sensors..) with any esp-idf compatible libraries

- (optional) Various displays tested (ILI9341) with touch screen (tested XPT2046) capabilities
- (optional) A server like a raspberry to host the server side components in case you want to develop a network solution


### Software Components

- ESP-IDF (release 4.4) programming environment

- (optional) MQTT broker as a messaging system - if you want to exchange info between boards and servers
- (optional) LVGL as display library - if you want to attach a screen to display your sensor values
- (optional) OpenHab/Home Assistant as a controller

## Functionalities

Grownode provides functionalities that lets you kickstart your projects in minutes:

- SoftAP/Bluetooth Provisioning to join and change your wireless network without any hardcode configuration through a mobile app
- High level device configuration through makefile
- Firmware update Over The Air
- NTP clock sync
- Persistent storage of parameters
- Sensor and Actuators configuration abstracting the hardware level
- Transparent networking protocol (presentation, keepalive, logging)
- Client/Server and Client/Client parameter retrieval and update through MQTT

1 change: 1 addition & 0 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ void app_main(void) {
//creates a new node
gn_node_config_handle_t node = gn_node_create(config, "node");

//the board to start
gn_configure_blink(node);

//finally, start node
Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ nav:
- Platform: 'platform.md'
- Install: 'start.md'
- Play: 'workflow.md'
- Boards: 'boards.md'
- Ready Made Boards: 'boards.md'
- Reference Guide: 'reference.md'
- Tutorials: 'tutorials/index.md'
- Story: 'story.md'
- API: 'html/index.html'
Expand Down

0 comments on commit 52000bd

Please sign in to comment.