Beamer

From VoidWarranties - Hackerspace Antwerp, Belgium
(Difference between revisions)
Jump to: navigation, search
(Created page with "{{Project |Current=Yes |Category=Coding |Logo=event.png |Participants=Koen, |Locations=Den Bunker, |Short description=We have a new beamer with lot's of cool features including...")
 
(We have syntax highlighting (it would be even better to put the code on github))
 
(One intermediate revision by one user not shown)
Line 10: Line 10:
 
Standig up to push a button went you want to turn on the beamer is a terrible amount of work. Thus having a convient script that can do this from your command line will make your life infinatly better. So here it is. Just download it and chmod it and never leave your couch spot ungarded.  
 
Standig up to push a button went you want to turn on the beamer is a terrible amount of work. Thus having a convient script that can do this from your command line will make your life infinatly better. So here it is. Just download it and chmod it and never leave your couch spot ungarded.  
  
```
+
 
 +
<source lang="bash">
 
#!/bin/bash
 
#!/bin/bash
  
Line 87: Line 88:
 
esac
 
esac
 
exit 0
 
exit 0
```
+
</source>

Latest revision as of 13:01, 2 September 2013


Beamer
What:
We have a new beamer with lot's of cool features including a webinterface. Let's have some fun!
Event.png
Participants:
Koen
Category:
Coding
Locations:
Den Bunker


Standig up to push a button went you want to turn on the beamer is a terrible amount of work. Thus having a convient script that can do this from your command line will make your life infinatly better. So here it is. Just download it and chmod it and never leave your couch spot ungarded.


#!/bin/bash
 
USERNAME=user1
PASSWORD=panasonic
 
ON=0
STANDBY=1
COOLING=2
 
Status=-1
 
StatusHTML=$(curl --silent --user $USERNAME:$PASSWORD "http://192.168.42.77/cgi-bin/proj_ctl.cgi?key=6&lang=e&osd=on")
 
case $StatusHTML in
	*Standby*)
		Status=$STANDBY
		;;
	*ON*)
		Status=$ON
		;;
	*Cooling*)
		Status=$COOLING
		;;
esac
 
case $1 in
	ON|on)
		case $Status in
			$STANDBY)
				echo "Turning beamer ON."
				#beamer on
				curl --silent --user $USERNAME:$PASSWORD "http://192.168.42.77/cgi-bin/proj_ctl.cgi?key=pow_on&lang=e&osd=on" > /dev/null
				;;
			$ON)
				echo "Beamer allready on."
				;;
			$COOLING)
				echo "Cannot turn beamer back on while it is cooling down."
				exit 1
				;;
		esac	
		;;
	OFF|off)
		case $Status in
			$STANDBY|$COOLING)
				echo "Beamer allready turned off."
				;;
			$ON)
				echo "Turning beamer OFF"
				#beamer off
				curl --silent --user $USERNAME:$PASSWORD "http://192.168.42.77/cgi-bin/proj_ctl.cgi?key=pow_off&lang=e&osd=on" > /dev/null
				;;
		esac
		;;
	STATUS|status|Status)
		case $Status in
			$STANDBY)
				echo "Beamer is off"
				;;
			$ON)
				echo "Beamer is on."
				;;
			$COOLING)
				echo "Beamer is cooling down."
				;;
		esac
		;;
	*)
		echo "VoidWarranties beamer control script"
		echo ""
		echo "To turn on the beamer run: ./beamer ON"
		echo "To turn off the beamer run: ./beamer OFF"
		echo "To display current status run: ./beamer STATUS"
		;;
esac
exit 0
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Content Creation
Belgian Spaces