write sensor data to file successfully