Giter VIP home page Giter VIP logo

edge's Introduction

Plantbuddy-edge

Build License

Introduction

Plantbuddy is a solution for monitoring your plants. This is the repository containing the aggregator Firmware for the ESP32C3. Is is responsible for collecting data from the sensors and sending it to the esp-gateway via ESP-Now to ensure long range communication. It is written in bare-metal Rust running via esp-hal and embassy.

Getting Started

Prerequisites

Installation

  1. Clone the repository
git clone https://github.com/plantineers/edge.git
  1. Install Rust nightly and the required target
rustup toolchain install nightly
rustup target add riscv32imc-unknown-none-elf
rustup component add rust-src
  1. Install cargo-espflash
cargo install espflash --git https://github.com/esp-rs/espflash/
  1. After plugging in the ESP32C3, allow access to the serial port and flash the firmware
sudo chmod a+rw /dev/<serial-port> # To permanently allow access, add your user to the dialout or uucp group depending on the distro
cargo run --release --features "<features, comma, seperated>" # See below for available features

Features

For every sensor there is a feature that can be enabled to include it in the build. The following features are available:

Feature Description Output
tsl2591 Enable the TSL2591 light sensor {"light": <lux>}
hw390 Enable the HW390 soil moisture sensor {"soil-moisture": <percentage>}
dht11 Enable the DHT11 temperature and humidity sensor {"temperature": <celsius>, "humidity": <percentage>}
dht22 Enable the DHT22 temperature and humidity sensor {"temperature": <celsius>, "humidity": <percentage>}

The dht11 and dht22 features are mutually exclusive. Only one of them can be enabled at a time.

edge's People

Contributors

nereuxofficial avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

edge's Issues

Sleep modes?

Saving power when the device is not in use for multiple minutes is very worthwhile. We could use the built-in sleep modes of the esp to wake it up after a time interval saving massive amounts of power. Also we could use rtc memory to store data that is persistent during even deep sleep.

Unfortunately light/deep sleep doesn't seem supported in esp-hal yet. We could also use esp-idf, which would no longer use the pure rust bindings.

Program the Gateway

Make a simple Gateway to forward the ESP-Now Requests to HTTP for the server

FreeRTOS/Tockos?

The most common RTOS to develop applications with on the esp32c3 is FreeRTOS. This has Rust bindings and would probably support deep/light sleep and give us higher level abstractions, however the project would no longer be bare-metal.

Timing fixes

Currently we have the problem that esp-now is screwing up timings. While this is fine for I2C and the tsl2591 it screws up the timings on pretty much all sensors needing a delay. Since the esp32c3 doesn't have a second core we cannot just switch to another core.

We have two ways really here and both seem hard and time-intensive:

  • Rewrite the project for an ESP with multiple cores(the original ESP32 comes to mind but i haven't had luck with spawning something on the other CPU core while wifi is running so a quick PoC would be necessary in order to justify the attempt)(takes less time)(useful link)
  • Get some way to have more accuracy despite having wifi started on the same CPU(I doubt this is possible and do not know how to even attempt this...)
  • Turn wifi on and off(have to look into if that is even possible but would be the easiest way)

Sensors to evaluate

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.