/* */ Networking

Networks

Serial Between MicroControllers and MultiMedia Machines

Serial connections form the backbone of local communication. Through various serial protocols it is possible to connect countless local devices. Files and charts below will give examples to get you started.

Using the Web

[WAN connections]

We will look at several strategies for exploiting the web capabilities of the platforms we are using. Establishing web connections is superficially similar to making local serial connections. Both sides need to agree on how a connection is to be made and where to look for incoming data. Most of the protocols and direct data handling is taken care of by objects within the software. You need to know the PORT and IP of sending and receiving machines.

MAX

MAX can be extended with two objects -- [netsend] and [netreceive]. Both are free and are available from Olaf Matthes. Platform specific copies of these objects need to be placed in your externals folder (find the cycling74 folder and look inside it for [externals]). Our machines should have the objects installed. Help files are also available.

Versions of MAX later than 4.5 downloads with proprietary networking objects. These objects provide a lot of flexibility but do NOT appear to be stable when used with Olaf's objects. Not all of our systems have the new network objects so for the sake of stability we will stick with Olaf's objects. I have not tested the objects on multiple machines and the error could be something local to my system -- this would be a good test for people to try on their own.

cycling74 has a couple of good discussions on networking that relate specifically to their objects but can be generalized to any platform. The cycling objects are java based.
[basics] | [indepth]

[netreceive] | [netsend]

The [netreceive] object should be thought of as a server. Servers await connection requests from clients -- in this case a [netsend]. The [netreceive] object takes the PORT on which it will listen as an attribute. [netsend] will attempt connections at the IP and PORT passed to it in the form of a message. The port cannot be changed on the fly -- without scripting the object.

[grab MAX netsend / netreceive patches]


Processing / JAVA


Processing (java) based projects can also be connected to MAX. By implementing CLIENT/SERVER protocols using TCP data can be streamed between the platforms.

There are a few details to watch for:

1) Set the IP and PORT in the code. AS BEFORE -- DO NOT PUBLICIZE YOUR PORTS ETC. Share them with your group but not beyond.

2 )When sending to NETRECEIVE objects in MAX from another app -- it is necessary to end lines with "\n;" I have not tested this with the jit.networking objects. They may not have the same constraint.


  myClient = new Client(this, "127.0.0.1", 10003); // (this, IP, PORT)
  
  // Say hello
  
  myClient.write("Hi there"+ "\n;");
	

The code block: "\n;" must be included in write statements. IF you attempt the following, the systems will appear to hang (or worse).



  
  myClient.write("Hi there"); // THIS WILL NOT WORK
	

3) Search the WEB lots of people are gluing things together. There are many examples.

[grab Processing Files]



FTP and HTTP -- these objects have not been updated for INTEL macs.

The last strategy we can employ is FTP / HTTP and EMAIL calls. I will show these from MAX.

These are not real time events but suggest a lot of different possibilities. As non-real time they do not experientially collapse space in the same way as streams. They do open the door to drawing data from any web site or other data source.

FTP communication is handled with a jitter object called [jit.uldl] for jit.upload / download. It is a standard part of the jitter install.

URL handling is achieved with an added external called [launchURL].

[grab MAX FTP, HTTP]


(This Page Last Updated: January 28, 2008 )