This is the repository for the code for the Washr sensor to detect if a washing machine is on. The Washr sensor uses an ESP32C3. It currently supports both the Seeed Studio board developer board and the custom Washr board. It updated the code architecture to use c++ files to break the functions into separate files to make the code more readable. It also updated the code to use the PlatformIO IDE instead of the Arduino IDE.
The repository also contains old code and demos for the Raspberry Pi Pico W and ESP32C3 stored in the Archive folder.
Please read all the ABOUT.md
files in the respective folders for more information on how to set up the code and how to use it.
- Install a C/C++ IDE which supports PlatformIO (e.g. Visual Studio Code, CLion).
- Install PlatformIO as an extension in your IDE.
- Open the
Washr
folder in your IDE. - Open the PlatformIO Home from the PlatformIO extension in your IDE.
- Make sure to select the environment which corresponds to the board you are using (e.g.
custom-board
for our custom board). - Build the project using the PlatformIO build button.
- Upload the project to the ESP32C3 board using the PlatformIO upload button.
- Open the serial monitor to view the output of the ESP32C3 board. (If using Clion, don't use the upload and monitor button, instead use the Clion Serial Monitor Plugin)
- Make changes to the code and test them on the ESP32C3 board.
- If you are going to add new libraries to the project, add them to the
platformio.ini
file. - Make sure that you develop your changes in a separate branch in Git
TODO
Make sure that any changes which are specific to a board are inside a #ifdef block.
Please write a brief decription of what your code changed, and why you made those changes. Set yourself as the assignee, and assign Robbie (leslier7) as the reviewer. Do not merge your code until Robbie has reviewed it and given approval.
Please make sure to change the firmware version in the globals.cpp file before creating a pull request. The version will be reviewed before it is merged. Once the code has been merged please make sure to build the firmware, rename it to the correct version, and commit it to the backend-go repository in the correct folder.
In order to connect the board to WiFi, please follow the steps below:
- Create a new file named
wifi_secrets.h
in theinclude
directory. - Copy and paste the following code into the
wifi_secrets.h
file:
#ifndef WIFI_SECRETS_H
#define WIFI_SECRETS_H
#define WIFI_SSID "your_ssid"
#define WIFI_PASSWORD "your_password"
#define CLIENT_NAME "your_client_name"
#define CLIENT_KEY "your_client_key"
#endif //WIFI_SECRETS_H
- Replace
your_ssid
with your actual Wi-Fi network name (SSID). - Replace
your_password
with your actual Wi-Fi password (with the quotation marks still). - Replace
your_client_name
with your client name from the backend. - replace
your_client_key
with your client key that was generated by the backend during onboarding.
Please ensure that you do not share your wifi_secrets.h
file publicly or commit it to version control, as it contains sensitive information.