How to connect 2 devices over home local network?

Hi,

I would like to know how to connect 2 iOS devices using my local home network, I know OSC can do the job but I need to transfer video from one device to the other, so I wonder if there is a better way of doing that.

Any help will be much appreciated

I’ve used this for transferring files. From an iOS device to desktop.
It sets up a web server and shares the apps documents folder.

https://github.com/face/MongooseDaemon

  
   
MongooseDaemon    *mongooseDaemon;  
  
void testApp::setup(){      
    mongooseDaemon = [[MongooseDaemon alloc] init];  
    [mongooseDaemon startMongooseDaemon:@"8080"];  
}  
  
void testApp::exit(){  
    [mongooseDaemon stopMongooseDaemon];  
    [mongooseDaemon release];  
}  
  

Then for pulling the files down

  
  
void testApp::downloadDirectory(string ip, string path){  
	string url = "[http://"](http://") + ip + ":8080/Documents/" + path + "/";  
	  
	ofDirectory::createDirectory(path, true, true);  
	  
	cout << "attempting to save url " << url << "file.wav to " << path << endl;   
	cout << "attempting to save url " << url << "data.txt to " << path << endl;   
	  
	ofSaveURLTo(url + "file.wav", path + "/file.wav");  
	ofSaveURLTo(url + "data.txt", path + "/data.txt");  
  
}  
  

This should work for iOS too though the downloads path will need to be the app’s document folder.
On the receiving end you’ll need to know the ip of the server. I’ve used osc to do this.

1 Like

That looks great!

I want to stream video from one device to the other, is it possible using MongooseDaemon?

Maybe actually - if you can get video over http: working in OF on IOS.
Looking at the iPhone video code in OF - I think it could work with a url as well as a file path.

You just need to make sure the video is in a supported format ( usually m4v / h264 mp4 )

I was thinking streaming live video from the iPad to the iPhone, is it doable?