Pages: [1]   Go Down
Author Topic: Sendind same data from Arduino to Processing and MAX/MSP via USB  (Read 720 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi There,
I am running a arduino uno which generates a serial data stream (via USB).  This is read by a processing application to visualize the data. Seperately I have developed a max/msp patch which generates a MIDI sound stream based on the same arduino output. The problem is that I would like to run both these apps at the same time, and use the same data. Both Applications would have to read the same COM port (no writing is needed). Is there any way I can do this without thinking of rewriting the programmes, i.e by something like a COM port emulator / data cloner etc. Under normal circumstances, once an app opens the port, no other application can lock onto it.

Thanks in advance!
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 173
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi There,
I am running a arduino uno which generates a serial data stream (via USB).  This is read by a processing application to visualize the data. Seperately I have developed a max/msp patch which generates a MIDI sound stream based on the same arduino output. The problem is that I would like to run both these apps at the same time, and use the same data. Both Applications would have to read the same COM port (no writing is needed). Is there any way I can do this without thinking of rewriting the programmes, i.e by something like a COM port emulator / data cloner etc. Under normal circumstances, once an app opens the port, no other application can lock onto it.

Thanks in advance!

Is this of any help to you? If it doesn't help you with your current project, it may be of use in the future.

http://www.maxuino.org/
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 50
Posts: 1761
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi There,
I am running a arduino uno which generates a serial data stream (via USB).  This is read by a processing application to visualize the data. Seperately I have developed a max/msp patch which generates a MIDI sound stream based on the same arduino output. The problem is that I would like to run both these apps at the same time, and use the same data. Both Applications would have to read the same COM port (no writing is needed). Is there any way I can do this without thinking of rewriting the programmes, i.e by something like a COM port emulator / data cloner etc. Under normal circumstances, once an app opens the port, no other application can lock onto it.

Thanks in advance!
Well obviously both programs have to be capable of running in the same Arduino (i.e. you have enough space for both, you use different named global variables and functions, etc.

I could imagine writing your own class FakeSerial (or some such) that provides the Serial functions you use for input.  One of the FakeSerial is the master, and is assumed to always read the input first.  The master FakeSerial then reads from the normal Serial, stores the data read in a hidden buffer, and then returns it.  The slave FakeSerial would then look at the hidden buffer, and return information from it.  You would use the standard Serial for output.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks I am a newcomer to Max, so for the moment I had two seperate apps. But I will check out your link. As for my project I got it to work by using a COM port duplicator software (so that the USB mapped to COM4 was copied as COM5,COM6). I will post the software info soon to this link for anyone else to use. Note however that it is not freeware. It worked fine as the both apps only read data from the COM port. (as opposed to writing data to the Arduino)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

FYI in my case I ran a program on Arduino to generate the serial data, and two seperate apps on the PC (Processing, MAX) to read the data sent via COM(Serial Port)
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 50
Posts: 1761
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

FYI in my case I ran a program on Arduino to generate the serial data, and two seperate apps on the PC (Processing, MAX) to read the data sent via COM(Serial Port)
Ah, I thought you wanted to do two separate things on the Arduino side of things.

Under Linux it is fairly simple, you have a reader that reads from the terminal and writes to two pipes, fifos, or ptys (which you use depends on whether you can start the process from the reader [pipes], or each of the processes are started independently [fifos], or whether the programs need to issue serial control commands [ptys]).

I would imagine there are ways to do it under Windows or Mac, but since I don't use them, you would need to ask elsewhere.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 173
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks I am a newcomer to Max, so for the moment I had two seperate apps. But I will check out your link. As for my project I got it to work by using a COM port duplicator software (so that the USB mapped to COM4 was copied as COM5,COM6). I will post the software info soon to this link for anyone else to use. Note however that it is not freeware. It worked fine as the both apps only read data from the COM port. (as opposed to writing data to the Arduino)

I tried using COM0COM, which contains another program called hub??? something.
It is supposed to allow you to make multiple connections to 1 com port under windows.
It is free- but I was not able to make the multiple connections work.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I used the following software (not free)..it works fine.

http://www.eltima.com/products/serialsplitter/
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 173
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I used the following software (not free)..it works fine.

http://www.eltima.com/products/serialsplitter/

Thanks. I don't care if it's not free, as long as it's reliable.

Here's the one I mentioned, it is free.
http://com0com.sourceforge.net/
If you get the com port splitting to work, please let me know

Logged

Pages: [1]   Go Up
Jump to: