Abstract
Minimizing the energy consumption of Linux-based devices is an essential step towards their wide deployment in various IoT scenarios. Energy saving methods such as duty-cycling aim to address this constraint by limiting the amount of time the device is powered on. In this work we study and improve the amount of time a Linux-based IoT device is powered on to accomplish its tasks. We analyze the processes of system boot up and shutdown on two platforms, the Raspberry Pi 3 and Raspberry Pi Zero Wireless, and enhance duty-cycling performance by identifying and disabling time-consuming or unnecessary units initialized in the userspace. We also study whether SD card speed and SD card capacity utilization affect boot up duration and energy consumption. In addition, we propose Pallex, a parallel execution framework built on top of the systemd init system to run a user application concurrently with userspace initialization. We validate the performance impact of Pallex when applied to various IoT application scenarios: (1) capturing an image, (2) capturing and encrypting an image, (3) capturing and classifying an image using the k-nearest neighbor algorithm, and (4) capturing images and sending them to a cloud server. Our results show that system lifetime is increased by 18.3%, 16.8%, 13.9% and 30.2%, for these application scenarios, respectively.
Similar content being viewed by others
Notes
Until October 2012, the RPi platform used a three stage bootloader, with an additional file, loader.bin, executed by the GPU between the bootcode.bin and start.elf stages.
References
Altman NS (1992) An introduction to kernel and nearest-neighbor nonparametric regression. Am Stat 46(3):175–185
Andersen J, Hansen MT (2009) Energy bucket: a tool for power profiling and debugging of sensor nodes. In: Proceedings of third international conference on sensor technologies and applications (SENSORCOMM’09). IEEE, pp 132–138
Baccelli E, Hahm O, Gunes M, Wahlisch M, Schmidt TC (2013) RIOT OS: towards an OS for the Internet of Things. In: IEEE conference on computer communications workshops (INFOCOM Workshops). IEEE, pp 79–80
Baik K, Kim S, Woo S, Choi J (2010) Boosting up embedded linux device: experience on linux-based smartphone. In: proceedings of the Linux symposium, pp 9–18
BCM2835. BCM2835 ARM peripherals (online). https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf. Accessed 2018
Bird TR (2004) Methods to improve bootup time in Linux. In: Proceedings of the Linux symposium
Bovet DP, Cesati M (2005) Understanding the Linux Kernel: from I/O ports to process management. O’Reilly Media
Brodowski D, Golde N, Wysocki RJ, Kumar V. CPU frequency and voltage scaling code in the Linux (TM) kernel (online). https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt. Accessed 2018
C library. C library for Broadcom BCM 2835 (online). http://www.airspayce.com/mikem/bcm2835/. Accessed 2018
Chiang M, Zhang T (2016) Fog and IoT: an overview of research opportunities. IEEE Internet Things J 3(6):854–864
Chu S, Majumdar A (2012) Opportunities and challenges for a sustainable energy future. Nature 488(7411):294
Chung KH, Choi MS, Ahn KS (2007) A study on the packaging for fast boot-up time in the embedded Linux. In: 13th International conference on embedded and real-time computing systems and applications (RTCSA). IEEE, pp 89–94
Cramfs. Cramfs: cram a filesystem onto a small ROM (online). https://www.kernel.org/doc/Documentation/filesystems/cramfs.txt. Accessed 2018
Cypress Semiconductor. CYW43907: IEEE 802.11 a/b/g/n SoC with an embedded applications processor (online). http://www.cypress.com/file/298236/download. Accessed 2018
Delforge P (2016) Slashing energy use in computers and monitors while protecting our wallets, health, and planet. Natural Resources Defense Council
Dezfouli B, Radi M, Whitehouse K, Razak SA, Hwee-Pink T (2015a) DICSA: distributed and concurrent link scheduling algorithm for data gathering in wireless sensor networks. Ad Hoc Netw 25:54–71
Dezfouli B, Radi M, Razak SA, Hwee-Pink T, Bakar KA (2015b) Modeling low-power wireless communications. J Netw Comput Appl 51:102–126
Dezfouli B, Radi M, Chipara O (2017) Rewimo: a real-time and reliable low-power wireless mobile network. ACM Trans Sens Netw (TOSN) 13(3):17
Dezfouli B, Amirtharaj I, Li C-C (2018) EMPIOT: an energy measurement platform for wireless IoT devices. J Netw Comput Appl 121:135–148
Dutta P, Feldmeier M, Paradiso J, Culler D (2008) Energy metering for free: augmenting switching regulators for real-time monitoring. In: Proceedings of the 7th international conference on information processing in sensor networks (IPSN’08), pp 283–294
Eclipse Foundation. Key trends from the IoT Developer Survey (online). https://blogs.eclipse.org/post/benjamin-cabe/key-trends-iot-developer-survey-2018. Accessed 2018
Fisher R, Ledwaba L, Hancke G, Kruger C (2015) Open hardware: a role to play in wireless sensor networks? Sensors 15(3):6818–6844
FreeRTOS. The FreeRTOS Kernel (online). https://www.freertos.org. Accessed 2018
Georgiou S, Kechagia M, Louridas P, Spinellis D (2018) What are your programming language’s energy-delay implications? In: Proceedings of the 15th international conference on mining software repositories (MSR). ACM, pp 303–313
Godard S. iostat (online). http://man7.org/linux/man-pages/man1/iostat.1.html. Accessed 2018
Gomez K, Riggio R, Rasheed T, Miorandi D, Granelli F (2012) Energino: a hardware and software solution for energy consumption monitoring. In: Proceedings of the international workshop on wireless network measurements (WiOpt’12), pp 311–317
Gorauskas J (2015) Managing services in Linux: past, present and future. Linux J 251:2015
Griffiths E, Assana S, Whitehouse K (2018) Privacy-preserving image processing with binocular thermal cameras. Proc ACM Interact Mob Wearable Ubiquitous Technol 1(4):133:1–133:25
Gupta A, Kim Y, Urgaonkar B (2009) DFTL: a flash translation layer employing demand-based selective caching of page-level address mappings. In: Proceedings of the 14th international conference on architectural support for programming languages and operating systems. ACM, pp 229–240
Hao S, Li D, Halfond WG, Govindan R (2012) Estimating android applications’ cpu energy usage via bytecode profiling. In: Proceedings of the first international workshop on green and sustainable software. IEEE, pp 1–7
Haratcherev I, Halkes G, Parker T (2008) PowerBench: a scalable testbed infrastructure for benchmarking power consumption. In: Proceedings of the international workshop on sensor network engineering (IWSNE’08), pp 37–44
Hartung R, Kulau U, Wolf L (2016) Distributed energy measurement in WSNs for outdoor applications, pp 1–9
Hindle A (2015) Green mining: a methodology of relating software change and configuration to power consumption. Empir Softw Eng 20(2):374–409
Hong J, Hong Y-G, Youn J-S. Problem statement of IoT integrated with edge computing (online). https://tools.ietf.org/html/draft-hong-iot-edge-computing-00. Accessed 2018
IMX219PQ. IMX219PQ: diagonal 4.6 mm 8.08M-effective pixel color CMOS image sensor (online). https://www.sony-semicon.co.jp/products_en/new_pro/april_2014/imx219_e.html. Accessed 2018
Jiang X, Dutta P, Culler D, Stoica I (2007) Micro power meter for energy monitoring of wireless sensor networks at scale, p 186
Jo H, Kim H, Jeong J, Lee J, Maeng S (2009) Optimizing the startup time of embedded systems: a case study of digital tv. IEEE Trans Consum Electron 55(4):2242–2247
Joe I, Lee SC (2011) Bootup time improvement for embedded linux using snapshot images created on boot time. In: The 2nd International conference on next generation information technology (ICNIT). IEEE, pp 193–196
Jones D. Python interface to the Raspberry Pi camera module (online). https://picamera.readthedocs.io/en/release-1.13. Accessed 2018
Jones CE, Sivalingam KM, Agrawal P, Chen JC (2001) A survey of energy efficient network protocols for wireless networks. Wirel Netw 7(4):343–358
Kaminaga H (2006) Improving linux startup time using software resume (and other techniques). In: Linux symposium, p 17
Kaup F, Gottschling P, Hausheer D (2014) PowerPi: measuring and modeling the power consumption of the Raspberry Pi. In: 39th Conference on local computer networks (LCN). IEEE, pp 236–243
Kaup F, Hacker S, Mentzendorff E, Meurisch C, Hausheer D (2018) The progress of the energy-efficiency of single-board computers, Tech. Rep. NetSys-TR-2018-01
Kelly R (2016) Internet of things data to top 1.6 zettabytes by 2022. Campus Technol 9:1536
Keranidis S, Kazdaridis G, Passas V, Korakis T, Koutsopoulos I, Tassiulas L (2014) NITOS energy monitoring framework: real time power monitoring in experimental wireless network deployments. SIGMOBILE Mob Comput Commun Rev 18(1):64–74
Levis P, Madden S, Polastre J, Szewczyk R, Whitehouse K, Woo A, Gay D, Hill J, Welsh M, Brewer E et al (2005) TinyOS: an operating system for sensor networks. In: Ambient intelligence. Springer, New York, pp 115–148
Li D, Hao S, Halfond WG, Govindan R (2013) Calculating source line level energy information for android applications. In: Proceedings of the international symposium on software testing and analysis. ACM, pp 78–89
Lim G, young Hwang J, Park K, Suh S-B (2015) Enhancing init scheme for improving bootup time in mobile devices. In: 2015 Eighth international conference on mobile computing and ubiquitous networking (ICMU), pp 149–154
Linux Programmer (2018) Linux Programmer’s Manual, Socket (online). http://man7.org/linux/man-pages/man2/socket.2.html
Love R (2010) Linux kernel development, 3rd edn. Addison-Wesley, Boston
Martinez B, Monton M, Vilajosana I, Prades JD (2015) the power of models: modeling power consumption for IoT devices. IEEE Sens J 15(10):5777–5789
Morabito R (2017) Virtualization on internet of things edge devices with container technologies: a performance evaluation. IEEE Access 5:8835–8850
Naderiparizi S, Parks AN, Parizi FS, Smith JR (2016) \(\mu\) Monitor: in-situ energy monitoring with microwatt power consumption. In: Proceedings of the IEEE international conference on RFID (RFID’16). IEEE, pp 1–8
Nunez-Yanez J, Lore G (2013) Enabling accurate modeling of power and energy consumption in an ARM-based system-on-chip. Microprocess Microsyst 37:319–332
Park C, Kim K, Jang Y, Hyun K (2006) Linux bootup time reduction for digital still camera. In: Linux symposium, p 231
Paul Rubin SK, MacKenzie David. dd: convert and copy a file (online). http://man7.org/linux/man-pages/man1/dd.1.html. Accessed 2018
Pinto G, Castor F, Liu YD (2014) Mining questions about software energy consumption. In: Proceedings of the 11th working conference on mining software repositories. ACM, pp 22–31
Pinto G, Liu K, Castor F, Liu YD (2016) A comprehensive study on the energy efficiency of java’s thread-safe collections. In: IEEE international conference on software maintenance and evolution (ICSME). IEEE, pp 20–31
Procaccianti G, Fernández H, Lago P (2016) Empirical evaluation of two best practices for energy-efficient software development. J Syst Softw 117:185–198
Pötsch A, Berger A, Springer A (2017) Efficient analysis of power consumption behaviour of embedded wireless IoT systems. In: Proceedings of the instrumentation and measurement technology conference (I2MTC), pp 1–6
RPiCam. Camera Module (v2) (online). https://www.raspberrypi.org/documentation/hardware/camera/. Accessed 2018
scikit-learn. scikit-learn: machine learning in python (online). https://scikit-learn.org/. Accessed 2018
Singh G, Bipin K, Dhawan R (2011) Optimizing the boot time of android on embedded system. In: 15th International symposium on consumer electronics (ISCE). IEEE, pp 503–508
Stathopoulos T, McIntire D, Kaiser WJ (2008) The energy endoscope: real-time detailed energy accounting for wireless sensor nodes. In: Proceedings of international conference on information processing in sensor networks (IPSN’08), pp 383–394
systemctl (2017) (online). https://www.freedesktop.org/software/systemd/man/systemctl.html. Accessed 2018
systemd. systemd System and Service Manager (online). https://www.freedesktop.org/wiki/Software/systemd/. Accessed 2018
systemd.unit. (online). https://www.freedesktop.org/software/systemd/man/systemd.unit.html. Accessed 2018
Tektronix. DMM7510 7\(\frac{1}{2}\) digit graphical sampling multimeter (online). https://www.tek.com/tektronix-and-keithley-digital-multimeter/dmm7510. Accessed 2018
The GNU. The GNU Awk User’s Guide (online). https://www.gnu.org/software/gawk/manual/gawk.html. Accessed 2018
ThreadX. ThreadX RTOS real-time operating system (online). https://rtos.com/solutions/threadx/real-time-operating-system/. Accessed 2018
Trathnigg T, Jürgen M, Weiss R (2008) A low-cost energy measurement setup and improving the accuracy of energy simulators for wireless sensor networks. In: Proceedings of the workshop on real-world wireless sensor networks, pp 31–35
Ueki M, Takeuchi K, Yamamoto T, Tanabe A, Ikarashi N, Saitoh M, Nagumo T, Sunamura H, Narihiro M, Uejima K et al (2015) Low-power embedded ReRAM technology for IoT applications. In: Symposium on VLSI technology. IEEE, pp T108–T109
Upton E, Duntemann J, Roberts R, Everard B, Mamtora T (2016) Learning computer architecture with Raspberry Pi. Wiley, New York
Vilajosana X, Wang Q, Chraim F, Watteyne T, Chang T, Pister KS (2014) A realistic energy consumption model for TSCH networks. IEEE Sens J 14(2):482–489
Villegas C (2006) Improve the Debian boot process (online). http://bootdebian.blogspot.com. Accessed 2018
Villegas C, Reinholdtsen P (2006) State-of the-art in the boot process. Google Summer of Code (online). https://pdfs.semanticscholar.org/a171/696ddb41ba8aad53cdcbb6aba1c4547aa80e.pdf. Accessed 2018
Vujovic V, Maksimovic M (2014) Raspberry Pi as a wireless sensor node: performances and constraints. In: 37th International convention on information and communication technology, electronics and microelectronics (MIPRO). IEEE, pp 1013–1018
Wang Q, Hempstead M, Yang W (2006) A realistic power consumption model for wireless sensor network devices. In: 3rd Annual IEEE communications society on sensor and ad hoc communications and networks (SECON’06), vol 1. IEEE, pp 286–295
Wang Z, Liu Y, Sun Y, Li Y, Zhang D, Yang H (2015) An energy-efficient heterogeneous dual-core processor for Internet of Things. In: IEEE international symposium on circuits and systems (ISCAS). IEEE, pp 2301–2304
Wiring Pi. Wiring Pi: GPIO interface library for the Raspberry Pi (online). http://wiringpi.com. Accessed 2018
Zhou R, Xing G (2013) Nemo: a high-fidelity noninvasive power meter system for wireless sensor networks. In: Proceedings of the ACM/IEEE international conference on information processing in sensor networks (IPSN’13), pp 141–152
Zhu N, O’Connor I (2013) Energy measurements and evaluations on high data rate and ultra low power wsn node. In: 10th IEEE international conference on networking, sensing and control (ICNSC), pp 232–236
Zoican S, Vochin M (2012) LwIP stack protocol for embedded sensors network. In: 9th International conference on communications. IEEE, pp 221–224
Acknowledgements
This research has been partially supported by the Santa Clara Valley Water District Research Grant SCWD02. This project involves the development of a flood monitoring system where Linux-based wireless systems, which rely on solar or battery power, capture images for analysis using machine learning to classify and report the debris carried by rivers and streams.
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendix 1: List of units in Raspbian stretch lite (RSL)
Appendix 1: List of units in Raspbian stretch lite (RSL)
In this section, we present an overview of the units available in RSL. All units except those in the EU category can be disabled if they are not necessary for the application scenario being considered.
1.1 1.1 Essential units (EU)
-
boot.mount This unit helps systemd resolve dependency trees for units that depend on mounting /boot before activation.
-
dev-mmcblk0p2.device This unit brings the root partition on the SDC into the scope of systemd so that units that require the root partition’s mount to finish before activation can resolve their dependencies properly.
-
dev-mqueue.mount This unit informs systemd when the POSIX message queues for internal system messages is ready.
-
kmod.service This service contains modprobe, which is used for loading and unloading kernel modules.
-
kmod-static-nodes.service This service creates a list of required static modules for the loaded kernel.
-
run-rpc_pipefs.mount This unit directs systemd on how to mount the RAM-based pipefs, which is used every time a process is forked or a pipe (“|”) is used.
-
sys-kernel-debug.mount Similar to dev-mmcblk0p2.device, this unit helps systemd resolve dependencies correctly. The actual mounting of debugfs occurs within udev, which is the daemon that detects hardware changes.
-
sys-kernel-config.mount This unit prevents the system from reaching sysinit.target until the kernel configuration parameters are fully loaded into the kernel from the Configuration File System (configfs).
-
systemd-fsck@.service and systemd-fsck-root.service These services run fsck on each partition to ensure file system consistency. This is an important step, and does not run every time unless there are problems detected on the SDC.
-
systemd-journald.service Many programs rely on journald for logging output, including the kernel (through kmsg). Therefore, it should not be disabled. However, in order to speed up its initialization, it may be useful to lower the size limit of the journal logs since a dependency, systemd-journal-flush.service, must rotate this log file on initialization.
-
systemd-modules-load.service This service starts early in the userspace initialization phase to load static kernel modules.
-
systemd-remount-fs.service In the beginning of the userspace initialization phase, this service mounts the necessary API filesystems for the kernel (such as /proc, /sys, or /dev) to a RAM disk.
-
systemd-random-seed.service This service loads the random seed and saves it at shutdown to enable the device to generate a new value when the system restarts.
-
systemd-sysctl.service By loading kernel configurations, this service enables systemctl to perform as expected.
-
systemd-udevd.service This service initializes udev, a daemon that listens to kernel uevents and matches them against specified rules, to run scripts. For example, it can load drivers when a new device is attached, or mount a USB drive when it is plugged in.
-
systemd-udev-trigger.service Devices plugged in before the system is powered on might not generate the kernel messages necessary for udev to discover them. This service probes and detects devices that udev would not normally discover.
-
sudo.service This service clears cached sudo privilege escalations to enforce user re-authentication after every reboot.
-
systemd-tmpfiles-setup.service and systemd-tmpfiles-setup-dev.service Mount /tmp and delete the old files. These services also create any files that are specified by user-provided configuration.
-
systemd-rfkill.service This service restores the rfkill state at the beginning of userspace initialization to ensure it matches the status saved before shutdown. Therefore, if the wireless peripherals (typically WiFi or Bluetooth) had rfkill preventing their use before shutdown, they will remain disabled on reboot.
-
systemd-update-utmp.service and systemd-update-utmp-runlevel.service Record and manage the system uptime, the logged-in users, and users’ log-in method (such as ssh, tty, and serial port).
-
systemd-user-sessions.service This service enables user log-in and denies log-in attempts after the shutdown signal has been sent. If a device in the field does not require log-in capabilities, this service does not need to be started automatically. For example, it can be started by a helper program when a GPIO pin is pulled high.
-
systemd-logind.service This service is responsible for tasks such as user session management, processor usage quotas, and device access management.
1.2 1.2 Networking-related services (NRS)
-
avahi-daemon.service This service enables programs to discover and publish services and hosts running on a local network. Note that this service can significantly slow the speed of the ifdown command and therefore the shutdown process if not completely uninstalled. Unless necessary for the user application, avahi-daemon should be uninstalled.
-
bluetoothd.service Daemon for controlling the Bluetooth interface. Bluez, bluetoothctl, and many other Bluetooth-related utilities communicate through this daemon.
-
dhcpcd.service The daemon responsible for managing the DHCP protocol on all targeted network interfaces. This service can be disabled if the device does not require a network connection or is guaranteed a static IP address. The duration of IP allocation depends on external factors including link quality and the load of access point.
-
hciuart.service This is responsible for initializing the HCI bluetooth interface. HCI stands for ”Host-to-Controller-Interface” and it is controlled over a serial UART interface.
-
networking.service Completes the configuration of WiFi and Ethernet interfaces based on the settings available in the /etc/network/interfaces configuration file.
-
nfs-config.service This service, along with nfs-common.service, loads configuration details applicable to Network File Systems (NFS).
-
rsyncd.service Daemon that listens on port 873 for incoming rsync file transfer requests. rsync is used for efficiently transferring and synchronizing files across computer systems.
-
rpcbind.service This service accepts requests for Remote Procedure Calls (RPC) and binds them to TCP ports for access and control.
-
sshd.service This service belongs to the OpenSSH package. It runs in the background to listen for and accept or deny incoming ssh connections according to a user-defined configuration file.
-
systemd-hostnamed.service This service can be used to control the hostname and related metadata by user programs.
-
systemd-networkd.service Brings up the system’s network manager and provides it with discovered networks, both physical and virtual.
-
systemd-resolved.service Provides local DNS resolution for namespaces such as localhost or those added by the user to overlay DNS provided by an external source.
-
systemd-timesyncd.service Used for time synchronization across the network.
1.3 1.3 Memory management services
-
dphys-swapfile.service This service initializes, mounts, unmounts, and deletes swap files on the SDC. If the available RAM is enough for the user application, then disabling this service results in a performance enhancement in terms of faster boot up time and prolonged SDC lifetime. This service is usually required when the user application involves loading large machine learning models and data sets.
1.4 1.4 I/O-related services
-
alsa-utils.service Represents the tools relating to the Advanced Linux Sound Architecture (ALSA).
-
alsa-restore.service Initializes and restores the last state of the RPi’s onboard soundcard.
1.5 1.5 Miscellaneous units
-
fake-hwclock.service This service saves the current time to a file at shutdown and loads it at boot up time. Without this service, the RPi is unaware of the current epoch time until it establishes a network connection. An incorrect epoch value may cause some files to appear as if they are edited in the future.
-
plymouth.service Provides a flicker-free graphical boot up process. Other related services include plymouth-quit.service, plymouth-quit-wait.service, plymouth-start.service, and plymouth-read-write.service.
-
raspi-config.service This service loads configuration changes made by the user such as processor governance, display overscan, and filesystem partition expansions, and applies them on reboot.
-
rsyslog.service Tools for log processing and conversion.
-
console-setup.service Configures the fonts, screen resolution, keyboard layout, etc., for virtual tty terminals.
Rights and permissions
About this article
Cite this article
Amirtharaj, I., Groot, T. & Dezfouli, B. Profiling and improving the duty-cycling performance of Linux-based IoT devices. J Ambient Intell Human Comput 11, 1967–1995 (2020). https://doi.org/10.1007/s12652-019-01197-2
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s12652-019-01197-2