Giter Site home page Giter Site logo

breathe-fw's Introduction

Breathe

Breathe is an open source project for air quality monitoring. To detect air pollution this project uses a pms5003 sensor; detected data will be sent via mqtt to a cloud service for further analysis and storage. Temperature and humidity will be recorded too using a DHT22 sensor.

The project is based on Espressif IDF v4.1
Follow this link to configure your environment: esp idf v4.1

This repo depends on a library of mine as git submodule:

Refer to this library readme file for sensor pinout and connection.

To clone this project use git clone --recursive https://github.com/pgatti86/breathe-fw.git

Configurations

Before flashing the app you will need to configure the device with idf.py menuconfig

App settings

Enter "Breathe config" menu to configure the application (defaults values applies)

  • BROKER_URL: defaults to mqtts://breathe.gatti.dev:8883

  • SNTP_SERVER: defaults to "pool.ntp.org"

  • DHT_GPIO: gpio connected to DHT22 sensor, defaults to 21

  • FW_UPDATE_URL: firmware OTA URL

Partition Table

The app uses a custom partition table defined in partitions.csv file:

In "Partition table" menù select "Partition Table" sub-menù. Check the "custom partition table CSV" option. As file name use partitions.csv

Flash size

You also need to change the embedded flash size: In "Serial flasher" menù enter "Flash size" sub-menù and select the memory size that match your module. The minimum flash size required is 4MB.

OTA

You must allow firmware OTA update to run using http instead of https. In Component config -> ESP HTTPS OTA, enable allow HTTP for OTA so the URI without TLS is accepted

Save and exit menuconfig.

Device UID and certificates

Download the device configuration bundle at the following URL: Once downloaded unzip and copy config.json file into device_config folder.

Look for device_config folder in project, it contains a config.json sample file. At flashing time this file will be automatically copied into device flash memory.

MQTT connection require clients to use ssl certificate files. You need the certificate and key files along with the CA file.

  • ca.pem
  • client.pem
  • client.key

Copy certificate files downloaded in previous step into device_certs folder

At flashing time those files will be automatically copied into device flash memory.

NB: don't change those file names

Enrollment

This device use TI smart-config. To connect the device to your WiFi network you must use one of those app:

I will soon provide an app for device enroll and data visualization

Reset

You can reset the device by pressing and holding the esp32 BOOT button for 3s. If your board does't have such button you can wire a button to any GPIO. Configure the selected GPIO as show in main.c file. After reset you need to reconfigure the WiFi as detailed in Enrollment section. Certificate and configuration file are not deleted. Only WiFi settings will be cleared.

breathe-fw's People

Contributors

pgatti86 avatar

Watchers

 avatar

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.