How Open Source RUI3 Enhances IoT and Firmware Development through Strategic Modifications
RUI3 becoming open source is a big deal in the Internet of Things (IoT) and firmware development. It's a move that opens up more opportunities for innovation and gives developers more freedom to experiment and improve their projects.
In this blog post, I'll discuss some improvements I've made using RUI3, illustrating the power and potential of open-source software for developers looking to advance their work in IoT.
Getting WDT Working
A crucial aspect in firmware development is system stability and self-recovery. Implementing Watchdog Timer (WDT) support was my first step. WDT acts as a safeguard, resetting the MCU in case of malfunctions. This addition is vital for long-term reliability, ensuring the system recovers autonomously until the next WDT trigger.
Streamlining Command Structure
The dual existence of AT and ATC commands in RUI3 led to a disjointed command structure. I streamlined this by disabling all default AT commands, focusing solely on ATC commands. This approach not only simplifies the command structure but also enhances consistency and efficiency in command processing.
Optimizing UART Timeout
Originally, the UART timeout was set at a lengthy 10 seconds, which contributed to unnecessary power consumption. By reducing this timeout to 5 seconds, the RX over UART is less engaged, conserving power and contributing to a more energy-efficient system.
Expanding Custom AT Command Limit
The initial 32-byte limit on AT commands felt restrictive. Increasing this limit from 64 to 128 was a straightforward yet impactful change, allowing for more complex commands and greater flexibility in communication protocols.
Increasing Timer Support
The original limit of 5 timers was too constraining for robust firmware development. By doubling the number of available timers, I've eliminated the need for delay() calls. This enhancement allows for more responsive and efficient handling of various functions like buzzers, LEDs, and button events, all managed through timers and interrupts.
Enhanced Serial Port Flexibility
On the RAK11720, once Serial1.begin() was called, UART1 was fixed. My modification allows for the reassignment of these pins by disabling the interrupt when Serial1.end() is called. This change provides much-needed flexibility in GPIO usage.
More Aggressive ADR in LoRaWAN®
In LoRaWAN, Adaptive Data Rate (ADR) optimization can be slow. Customizing ADR_ACK_DELAY and LIMIT values allows for a more aggressive approach, enhancing performance and responsiveness in network communication.
Innovative Approach to Reading System VCC Voltage
In many IoT applications, accurately reading the system's VCC voltage is crucial. The standard method recommended by RAK involved using an analog GPIO along with a voltage divider. While functional, this method requires additional components and can occupy valuable GPIO resources.
With the RUI3's BSP (Board Support Package) being open source, I was able to devise a more efficient approach. This method utilizes an internal analog pin that was previously underutilized. By directly reading the system's VCC voltage through this internal pin, I eliminated the need for a voltage divider and external components. This not only simplifies the hardware design but also provides a more accurate reading of the VCC voltage.
Conclusion
Modifying RUI3 has presented both challenges and opportunities for improvement. These enhancements highlight the potential of open-source platforms to be adapted for specific requirements. They underscore the role of community-driven development in technological advancement.