Show page Old revisions Backlinks This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Power Management ====== Before we automate the file transfer process, it might be interesting to have a look at our system's power consumption. A few points must be taken into account here that, in regard to each particular use-case, will help one decide on the most appropriate solution to use. - Does the system require a network (or Internet) connection? - Should the system care about power consumption (running on batteries)? - What is the //value// of the stored data as it is stored on the system? - How much storage space is available on the embedded system? === No Network (or Internet) Access === If your system doesn't have a network, or Internet, connection at all, the question shouldn't even be asked. You'll have to bring back the beast (or at least it's SD card), and use one of the below mentioned methods to access the stored data. The main parameter in this scenario will most probably be the available embedded storage space. For example having a 15sec timelapse running at maximum resolution (Pi Camera v1: 2592x1944), will generate a jpg file weighting about 3MB every 15sec. This would saturate a 16GB SD card in about 16h30m... Way before you battery pack goes out!\\ You could spare some storage space by running a minimal OS on your RasPi, but that's another subject that is covered in [[:os:minibian|this article]]... **Side note**: When the SD card gets saturated, and there is //really// no more space left on it, the OS itself will get inoperable. This is because it requires a minimum amount of storage space to function. For example trying to issue any command on a RasPi's console while running on a saturated SD card will return: <Code:bash> > -bash: cannot create temp file for here-document: No space left on device </Code> At this stage your only option will be to plug the SD card into a reader on another platform and freeing up some space. === "Costly" Internet Access (like GSM 3/4G) === In case you have a "costly" connection, like a GSM stick holding a 3/4G SIM card, you'll probably want to minimize the bandwidth usage. Covering the subject of optimizing Internet access while using a 3/4G GSM connection is outside the scope of this article but a starting point would be the following [[http://www.kinisi.cc/blog/2015/8/9/getting-cellular-gsm-internet-on-your-raspberry-pi-in-15-minutes|Get Cellular (GSM) Internet on your Raspberry Pi in 15 minutes article]]. I'll try to give a more in-depth coverage of this point whenever I get the opportunity to access the required hardware. === Available Network Access === When a network access is available, wired or WiFi, one should consider that it utilizes a noticeable amount of power to operate, one should thus optimize its usage. The following paragraphs will try to present a few possible solutions. ===== Reduce Power Consumption ===== This article assumes we're working on any //Raspberry Pi Model B//, fully equipped with network adapter, USB ports and HDMI. //Pi Zero// and //Model A// are already built in such ways that their power consumption is much lower than Model Bs. ==== Network and USB adapters ==== The power hungry monsters in the Raspberry Pi are certainly the USB and Network Adapters. They were reported to consume as much as 200mA! Turning them off will enhance the system's autonomy when running off a power bank. === USB === To switch the USB bus on a RasPi one can use the following commands: <Code:bash |**Turn off USB** on the Raspberry Pi:> > echo 0x0 > /sys/devices/platform/bcm2708_usb/buspower </Code> When you need to turn it back on: <Code:bash |**Turn on USB** on the Raspberry Pi:> > echo 0x1 > /sys/devices/platform/bcm2708_usb/buspower </Code> === Network Adapter === To switch the network adapter on a RasPi one can use the following commands: <Code:bash |**Turn off Network Adapter** on the Raspberry Pi:> > /etc/init.d/networking stop </Code> When you need to turn it back on: <Code:bash |**Turn on Network Adapter** on the Raspberry Pi:> > /etc/init.d/networking start </Code> Of course, turning off the network adapter will prevent you from accessing the RasPi from any remote workstation.\\ <color darkorange>**Be aware that turning off both the USB and network adapters might lockout your entire RasPi system!**</color> ==== HDMI ==== Referring to [[http://www.pidramble.com/wiki/benchmarks/power-consumption|this article concerning Raspberry's models power consumption]], we observe that HDMI and LED usage are using about 30 mA (for a RasPi 3). Another [[http://www.mikeslab.net/?p=455|interesting article about RasPi's power consumption]] states that turning off HDMI in a "headless" configuration saves about 20mA. To **turn off HDMI** on the RasPi, simply issue this command: <Code:bash |**Turn off HDMI** on the RasPi:> > sudo /opt/vc/bin/tvservice -o </Code> Unfortunately this command won't survive a reboot, so if we known the system is going to be headless we should trigger this on each boot. <Code:bash |Create cron job running at startup to turn off HDMI> TO BE COMPLETED </Code> To **turn HDMI back on**, you'll want to know what GROUP, MODE & DRIVE to use, to discover the available modes in each group use the ''/opt/vc/tvservice'' command with the following options: <Code:bash |Video Groups Modes> > /opt/vc/bin/tvservice --modes=CEA Group CEA has 7 modes: mode 1: 640x480 @ 60Hz 4:3, clock:25MHz progressive mode 2: 720x480 @ 60Hz 4:3, clock:27MHz progressive mode 3: 720x480 @ 60Hz 16:9, clock:27MHz progressive (native) mode 4: 1280x720 @ 60Hz 16:9, clock:74MHz progressive mode 17: 720x576 @ 50Hz 4:3, clock:27MHz progressive mode 18: 720x576 @ 50Hz 16:9, clock:27MHz progressive mode 19: 1280x720 @ 50Hz 16:9, clock:74MHz progressive > /opt/vc/bin/tvservice --modes=DMT Group DMT has 10 modes: mode 4: 640x480 @ 60Hz 4:3, clock:25MHz progressive mode 5: 640x480 @ 72Hz 4:3, clock:31MHz progressive mode 6: 640x480 @ 75Hz 4:3, clock:31MHz progressive mode 8: 800x600 @ 56Hz 4:3, clock:36MHz progressive mode 9: 800x600 @ 60Hz 4:3, clock:40MHz progressive mode 10: 800x600 @ 72Hz 4:3, clock:50MHz progressive mode 11: 800x600 @ 75Hz 4:3, clock:49MHz progressive (prefer) mode 16: 1024x768 @ 60Hz 4:3, clock:65MHz progressive mode 17: 1024x768 @ 70Hz 4:3, clock:75MHz progressive mode 18: 1024x768 @ 75Hz 4:3, clock:78MHz progressive </Code> So when you want to turn the HDMI back on with, lets say, a 1024x768@60Hz screen: <Code:bash | Turning HDMI back on at a specific resolution> > /opt/vc/bin/tvservice -e="DMT 16 HDMI" </Code>