Skip to content

ekimdev/espws

Repository files navigation

CI black Open Source Love MIT Licence


ESP8266 Weather Station


Report Bug · Request Feature

Weather Station powered by ESP8266, Python, Docker, MQTT, FastAPI and InfluxDB diagram

Getting Started

Prerequisites

Have installed on your pc:

  • Python >= 3.7
  • Docker and Docker Compose

And an ESP8266.

Installation

  1. Clone the repo
$ git clone https://github.com/ekimdev/espws.git
  1. Change the macros in firmware/config.h with the network data
  2. Compile and upload the firmware to your ESP
  3. Copy the .env.sample as .env and modify the environment variables to your needs
$ cp .env.sample .env
  1. Start docker services
$ docker-compose up
  1. Connect your ESP and the listener will start sending data! :)

Usage

InfluxDB provides a user interface, you can login to: localhost:8086. You can view and create your own dashboards or use the default

API

Use:

import requests

response = requests.get("http://localhost:8000/")
response.json()
Out: {'temperature': 23.4, 'humidity': 49.0}

# You can also bring the data separately
response_temperature = requests.get("http://localhost:8000/temperature")
response_temperature.json()
Out: {'temperature': 23.4}

Interactive API docs by FastAPI:

Now go to localhost:8000

You will see the automatic interactive API documentation

Developers

Run pip install -r requirements.txt to install all dependencies used by the development environment.

Check the make command for useful tasks such as lint.

$ make
flake8           Execute flake8
format           Execute black formatter
format-check     Execute black check formatter

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors