Difference between revisions of "Software:Solar Power"

From HiveTool
Jump to: navigation, search
(smsc95xx_up)
Line 1: Line 1:
 +
These scripts should save significant power by shutting down the Ethernet and USB ports. 
 +
 +
 
==smsc95xx_up==
 
==smsc95xx_up==
  

Revision as of 08:51, 28 January 2014

These scripts should save significant power by shutting down the Ethernet and USB ports.


smsc95xx_up

Turns on the Ethernet and USB ports. Sets up networking.

echo 0x1 > /sys/devices/platform/bcm2708_usb/buspower                                                                                                                               
sleep 3                                                                                                                                                                             
/sbin/ifconfig wlan0 down                                                                                                                                                           
echo "search domain_not_set.invalid                                                                                                                                                 
nameserver 166.102.165.11                                                                                                                                                           
nameserver 68.238.112.12" > /etc/resolv.conf                                                                                                                                        
                                                                                                                                                                                    
/sbin/ifconfig wlan0 192.168.0.11 up                                                                                                                                                
/sbin/iwconfig wlan0 mode Managed                                                                                                                                                   
/sbin/iwconfig wlan0 essid dlink                                                                                                                                                    
/sbin/route add default gw 192.168.0.1 wlan0                                                                                                                                        

smsc95xx_down

/sbin/ifconfig wlan0 down                                                                                                                                                           
echo 0x0 > /sys/devices/platform/bcm2708_usb/buspower                                                                                                                               


sync_clock.sh

Syncs the clock. Call by cron and rc.local.

/home/hivetool/smsc95xx_up                                                                                                                                                          
timeout 20 /usr/sbin/ntpd -qg                                                                                                                                                       
/home/hivetool/smsc95xx_down                                                                                                                                                        

rc.local

Sets the clock on boot up.

timeout 60 /home/hivetool/sync_clock.sh