Skip to content
Sebastian Pichlmeier edited this page Mar 8, 2014 · 14 revisions

Welcome to the RemoteControlSystem wiki!

The RemoteControlSystem is a System to control severals computers over the network.

The System is basend on a simple rmi implementation. The rmi implementation was needed to run on the android system. Thre rmi registry contains one ControlCenter.

The ControlCenter

ControlCenter overview

Compile and configure the stuff

The RemoteControlSystem consists of several projects, that can be compiled and build with ant. The ant-scrip is in the de.neo.remote.build project. With the jar.destiny property in the scrip you can specify the destination of all jar-files.

To start the system you can use an init-script in your operating system. The following listing shows an example script for a linux machine.

#!/bin/bash
### BEGIN INIT INFO
# Provides:          multimedia_server
# Required-Start:    $local_fs $network
# Required-Stop:     $local_fs $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Mulitmedia Server
# Description:       Start the Multimedia Server
### END INIT INFO

# Global settings
app_directory='/opt/neo'
app_dir_logs='/home/troubadix/Logs'
ip=$(ifconfig | awk -F':' '/inet addr/&&!/127.0.0.1/{split($2,_," ");print _[1]}')

# Registry
registry='java -jar '$app_directory'/registry.jar'
registry_log=$app_dir_logs'/registry.log'

# ControlCenter
control_jar='java -jar '$app_directory'/controlcenter.jar'
control_parameter='--registry '$ip' --config /home/troubadix/controlcenter.xml'
control_log=$app_dir_logs'/controlcenter.log'

# Webcam
webcam_jar='java -jar '$app_directory'/webcamserver.jar'
webcam_parameter=$ip
webcam_log=$app_dir_logs'/webcam.log'

# MediaServer
file_browser='java -jar '$app_directory'/mediaserver.jar'
file_browser_parameter='--location /media/festplatte/ --temp /media/festplatte/Temp/pls/ --name Wohnzimmer --position 2.3,0.5,1.2 --registry '$ip' --type remote'
file_browser_log=$app_dir_logs'/browser.log'

# InternetSwitch
power_jar='java -jar '$app_directory'/gpiopower.jar'
power_arg='--registry '$ip' --config /home/troubadix/gpiosender.xml'
power_log=$app_dir_logs'/gpio_power.log'

case "$1" in
start)
	echo start registry
	$registry &> $registry_log &
	echo start controlcenter
        $control_jar $control_parameter &> $control_log &
	echo start mediaserver
	$file_browser $file_browser_parameter &> $file_browser_log &
	echo start webcam
	unset DISPLAY
	$webcam_jar $webcam_parameter &> $webcam_log &
	echo start gpio power
	sudo -u root ${power_jar} ${power_arg} &> ${power_log} &
;;
stop)
	echo stop registry
	pkill -f "${registry}"
	echo stop browser
	pkill -f "${file_browser}"
	echo stop webcam
	pkill -f "${webcam_jar}"
	echo stop gpio power
	pkill -f "${power_jar}"
	echo stop control center
	pkill -f "${control_jar}"
;;
restart)
	$0 stop
	sleep 5
	$0 start
;;
*)
	echo 'Usage $0 {start|stop|restart}'
esac

The ControlCenter requires a xml-file for '--config' parameter that specifies the environment to control. The environment consists of walls and each wall consists of points. An example of the groundplot.xml looks like the following listing:

<GroundPlot>
	<Wall>
		<Point x="0" y="0" z="0"/>
		<Point x="0" y="0" z="2.4"/>
		<Point x="0" y="4.3" z="2.4"/>
		<Point x="0" y="4.3" z="0"/>
                <Point x="0" y="1.9" z="0"/>
                <Point x="0" y="1.9" z="2"/>
                <Point x="0" y="0.8" z="2"/>
                <Point x="0" y="0.8" z="0"/>
	</Wall>
	<Wall>
		<Point x="0" y="0" z="0"/>
		<Point x="0" y="0" z="2.4"/>
		<Point x="4.8" y="0" z="2.4"/>
		<Point x="4.8" y="0" z="0"/>
	</Wall>
	<Wall>
		<Point x="4.8" y="0" z="0"/>
		<Point x="4.8" y="0" z="2.4"/>
		<Point x="4.8" y="0.7" z="2.4"/>
		<Point x="4.8" y="0.7" z="0"/>
		<Point x="4.8" y="0" z="0"/>
	</Wall>
	<Wall>
		<Point x="4.8" y="0.7" z="0"/>
                <Point x="4.8" y="0.7" z="2.4"/>
                <Point x="6.8" y="0.7" z="2.4"/>
                <Point x="6.8" y="0.7" z="0"/>
                <Point x="6.5" y="0.7" z="0"/>
                <Point x="6.5" y="0.7" z="2"/>
                <Point x="5.65" y="0.7" z="2"/>
                <Point x="5.65" y="0.7" z="0"/>
	</Wall>
	<Wall>
		<Point x="0" y="4.3" z="0"/>
                <Point x="0" y="4.3" z="2.4"/>
                <Point x="6.8" y="4.3" z="2.4"/>
                <Point x="6.8" y="4.3" z="0"/>
                <Point x="4.15" y="4.3" z="0"/>
                <Point x="4.15" y="4.3" z="2"/>
                <Point x="3.1" y="4.3" z="2"/>
                <Point x="3.1" y="4.3" z="0"/>
	</Wall>
</GroundPlot>

The InternetSwitch jar-file also needs a xml-file the specifies all internet switches. The xml-file contains all switches with the corresponding famliy code, switch number and position (relative to the groundplot). Here is an example xml-file.

<Switches>
        <Switch familyCode="xxxxx" switchNumber="3"  name="Verstärker" x="1.5" y="0.5" z="0" type="audio"/>
        <Switch familyCode="xxxxx" switchNumber="1"  name="Bildschirm" x="1.5" y="0.5" z="0" type="video"/>
        <Switch familyCode="xxxxx" switchNumber="2"  name="Stehlampe" x="0.5" y="3.5" z="0" type="floorlamp"/>
        <Switch familyCode="xxxxx" switchNumber="4"  name="Lavalampe" x="-0.5" y="5" z="0" type="lavalamp"/>
        <Switch familyCode="xxxxx" switchNumber="1"  name="Leselampe" x="6" y="5" z="0" type="readinglamp"/>
        <Switch familyCode="xxxxx" switchNumber="2"  name="Leselampe2" x="7" y="5" z="0" type="readinglamp"/>
</Switches>

Currently there are two client implementations, a desktop verison based on java swing and a mobile version based on android 4.0.