public Sensor(String sensorTypeInput, String fileNameInput){
		this.sensorType = sensorTypeInput;
		this.fileName = fileNameInput;
		
		// initialize RPC
		server = new SensorPseudoRPCServerStub(elvinURL, this);
		controller = new SensorPseudoRPCClientStub(elvinURL, this);
		
		// if it's a location sensor, we need to register user first to notify the home manager server stub
		if (sensorType.equals(Message.TYPE_LOCATION)) {
			setUserNameFromFileName(fileName);
		}
		
		// initialize tempSensorMode
		if (sensorType.equals(Message.TYPE_TEMPERATURE)) {
			this.tempSensorMode = Message.PERIODIC;
		}
		
		scheduler = Executors.newScheduledThreadPool(NUM_THREADS);
		// open the data file to stream
		try {
			fr = new FileReader(fileName);
			br = new BufferedReader(fr);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}