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

Have installed on your pc:
- Python >= 3.7
- Docker and Docker Compose
And an ESP8266.
- Clone the repo
$ git clone https://github.com/ekimdev/espws.git
- Change the macros in firmware/config.h with the network data
- Compile and upload the firmware to your ESP
- Copy the .env.sample as .env and modify the environment variables to your needs
$ cp .env.sample .env
- Start docker services
$ docker-compose up
- Connect your ESP and the listener will start sending data! :)
InfluxDB provides a user interface, you can login to: localhost:8086. You can view and create your own dashboards or use the default
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
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
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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request

