-
Notifications
You must be signed in to change notification settings - Fork 0
11 ‐ Modifying the Source Code
There may be situations where you wish to make a small change to the firmware. This might be to use a diffent GPIO pin for a peripheral, or maybe to change a maximum permissible or other default value.
Obviously if you are looking to make a major change like using a different sensor or display type or to change overall functionality, it is assumed that you are an experienced C++ and Arduino IDE user, so these instructions are probably not needed.
But even if you are not a C++ user... or a programmer at all... you can make small changes to the source code. Complete instructions is beyond the scope of this wiki, but the following video has complete instructions on installing the Arduino IDE, configuring it for use with the ESP32 (and ESP8266), installing libraries, compiling, and using the Arduino OTA method for uploading:
Arduino IDE: ESP32/ESP8266 Basics for Non-Coders
The source code is well documented if you just need to make some minor changes:
From this point forward, it will be assumed that you've made the desired changes and successfully verified the code. The remainder of this section will focus on uploading those changes to the controller using the Arudino OTA method.
Putting the Controller in Arduino OTA Mode
Before you can send the update over-the-air from the Arduino IDE to the controller, the controller must be placed in Arduino OTA mode. This option can be found under the Controller commands section of the web settings page. It is recommended that you stop any active races (timer stopped) before using the OTA method.
As soon as you click the Arduino OTA button and the system responds, the timer will show 'Upload' and the LEDs, if used, will change to alternating red and green LEDs.
The web page will also tell you that you should start the upload from the Arduino IDE.
IMPORTANT: The controller will only remain in OTA update mode for approximately 20 seconds.
If it does not begin to receive an update within this time, it will exit OTA mode and return to normal operation, entering the 'Ready' stage. Depending on the speed of your computer and other factors, it might take longer than 20 seconds for the Arduino IDE to compile your code and begin transmitting.
If you find that the controller is exiting the OTA mode before the Arduino IDE starts sending the code, then the solution is to first start the upload/compile process on the IDE and watch the progress bar.
When the progress bar reaches approximately 50-75% complete, then click the Arduino OTA button on the web settings page. The IDE should complete and begin sending the updated code before the controller exits OTA mode. Again, this is somewhat dependent upon the speed of the computer, whether the code has been compiled previously, etc. After a couple of attempts, you will soon get a feel for when you should launch the OTA mode from the web settings page.
After the upload completes, the controller will reboot and execute your new code. If something doesn't work correctly, you can always reflash the original firmware using any of the firmware update methods described under the Firmware upgrade section of this wiki.
PLEASE DO NOT REQUEST CODE CHANGES OR FEATURE ENHANCEMENTS VIA THE ISSUES SECTION OF THIS REPO!
As mentioned, this project was created for a very special purpose and provide here as a source for your own projects. If you have a change or enhancement you'd like to have considered, please use the Discussions section.