{'fraction_non_alphanumeric': 0.03240391861341371, 'fraction_numerical': 0.0015071590052750565, 'mean_word_length': 5.205607476635514, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
OPCIO: Optimizing Power Consumption for Embedded Devices via GPIO Configuration

Battery lifetime is one of the main challenges that impedes the deployment of energy-constrained wireless networks, such as unattended Internet-of-Things (IoT) systems. To prolong battery lifetime, the duty-cycle mode is utilized in many IoT systems, especially in environment monitoring Wireless Sensor Networks (WSN) and Low-Power Wide-Area Networks (LPWAN). In duty-cycle mode, devices transmit packets during the active phase, which lasts for a short time, and sleeps the rest of the time. Prior research mainly focuses on energy efficiency in the active phase; energy consumption during the sleep phase, however, is always ignored, as it is assumed to have little margin to be optimized. In this work, we reveal that sleep phase can become a significant battery consumer due to the misconfiguration of General-Purpose Input/Output (GPIO) pins of micro-controllers. We propose OPCIO, which incorporates a genetic algorithm to obtain energy-efficient GPIO configurations automatically to squeeze the energy waste during the sleep phase. We prototype OPCIO on offthe-shelf devices and evaluate it on two ARM devices. Experiment results show that OPCIO can effectively find multiple low-power configurations that prolong the lifespans up to 10×.