Skip to content

A rewrite of another project of mine (which was written in the arduino framework using platformio - private repo at this point). The goal is to have it running more efficiently and robustly in ESP-IDF as practice as well as for the real-world benefits for me.

License

Notifications You must be signed in to change notification settings

wolffshots/esp32-warm-water

Repository files navigation

warm water in esp-idf

Platform: ESP-IDF GitHub Docs Workflow Status GitHub CodeQL Workflow Status GitHub GitHub code size in bytes GitHub repo size Lines of code GitHub tag (latest by date)

esp-idf implementation of temperature controlled relay to switch a heating element to maintain water in a specific temperature range. A webserver is used to interface with the system and change the goal temperature, range from the goal and the relay state (forced on or off).

employs wifi, onewire and a relay to control the temperature of a body of water for the purpose of film development primarily. other uses include cooking and general chemistry.

the main motivation to do this project was to be able to better process c41 colour film.

how to use project

this project is built using the Visual Studio Code esp-idf plugin.

configure it from command line using idf.py or by using the cog in the plugin.

once it is configured, select the correct port of your ESP32 module and build and upload to it.

an explanation of the hardware setup will come at a later stage.

frontend files

the files in the front/build directory are for displaying via the webserver and are sort of a separate entity from the rest of the code.

they automatically get made into an image but don't seem to flash with the vscode extension buttons (as a result you may need to run idf.py -p PORT flash for changes to persist).

the frontend can be coded in whatever framework you want as long as you can get it built into a flat file structure (all in one directory without subdirectories). i am partial to vanilla html, css and javascript but there are plenty of lightweight frameworks (like svelte and preact).

any file in front/build should get flashed to /spiffs but ensure that the front/build directory doens't exceed the size of the /spiffs partition (default 960KB).

  • / - the root path which serves index.html
  • @todo add more reserved locations here
  • any other path should attempt to be read from spiffs and 404 if not found

dependencies

folder contents

the project esp32-warm-water contains one source file in C language main.c. the file is located in folder main.

esp-idf projects are build using cmake. the project build configuration is contained in CMakeLists.txt files that provide set of directives and instructions describing the project's source files and targets (executable, library, or both).

below is short explanation of remaining files in the project folder.

├── components                  the extra components employed in this project
|   ├── esp32-ds18b20           used to interface with the temperature sensor (includes wrapper)
|   ├── esp32-gpio              little gpio wrapper to simplify setup
|   ├── esp32-owb               enables use of the one wire bus protocol
|   ├── esp32-ssd1306           led interface library
|   ├── esp32-utility           some extra helper functions for debugging and qol
|   └── esp32-wifi              some wrappers for the esp wifi functions
├── main                        main component
│   ├── CMakeLists.txt          specific component cmake file
│   ├── component.mk            component make file
│   ├── Kconfig.projbuild       kconfig description file to add build time vars
│   └── main.c                  core src file of the project (client code)
├── .gitignore                  describes what files and folders git should ignore
├── .gitmodules                 describes the sources and paths of the modules used in `/components`
├── CMakeLists.txt              base project cmake file
├── LICENSE.md                  MIT license file
├── Makefile                    makefile used by legacy GNU Make
└── README.md                   this file

for more information on structure and contents of esp-idf projects, please refer to Section Build System of the esp-idf programming guide.

documentation

automatically generated API documentation (doxygen) is available here.

license

the code in this project is licensed under the MIT license - see LICENSE for details.

troubleshooting

  • program upload failure

    • hardware connection is not correct: run idf.py -p PORT monitor, and reboot your board to see if there are any output logs.
    • the baud rate for downloading is too high: lower your baud rate in the menuconfig menu, and try again.

helpful commands

  • git submodule update --remote --recursive - updates the checked out modules to the most recent commit to their main branch
  • git push all - as setup with https://jigarius.com/blog/multiple-git-remote-repositories

acknowledgements

  • a big thank you to David Antliff for providing his fantastic onewire and ds18b20 libraries on github under the MIT license
  • thanks to Shirkybooi for pushing me to use esp-idf
  • last but not least, thanks to Grabt234 for helping me get into this field
  • "1-Wire" is a registered trademark of Maxim Integrated.
  • brian-lough for this simple but helpful post and linked to this for boot mode selection

todo

About

A rewrite of another project of mine (which was written in the arduino framework using platformio - private repo at this point). The goal is to have it running more efficiently and robustly in ESP-IDF as practice as well as for the real-world benefits for me.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks