Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
connect two remote computers

Subject: connect two remote computers

From: Konst

Date: 14 Sep, 2012 16:13:08

Message: 1 of 7

So I need to connect two remote computers via wireless internet. I need to have the full control of the second pc (change its clock, set it to reboot after certain time etc) but I also want to transfer data files. That is, to connect to the second pc let's say every 5 minutes and collect its recorded data and save them.
I need a general direction here because I have no idea what I'm doing and what I'll need. Also is there a risk of loosing data on the way through the transfer? Which version of Matlab is more fitting?
Thanks in advance and I'd really appreciate any help you could give me.

Subject: connect two remote computers

From: Maxx Chatsko

Date: 14 Sep, 2012 16:53:07

Message: 2 of 7

"Konst " <konstance1@hotmail.com> wrote in message <k2vl2k$gti$1@newscl01ah.mathworks.com>...
> So I need to connect two remote computers via wireless internet. I need to have the full control of the second pc (change its clock, set it to reboot after certain time etc) but I also want to transfer data files. That is, to connect to the second pc let's say every 5 minutes and collect its recorded data and save them.
> I need a general direction here because I have no idea what I'm doing and what I'll need. Also is there a risk of loosing data on the way through the transfer? Which version of Matlab is more fitting?
> Thanks in advance and I'd really appreciate any help you could give me.

I created a distributed computing system last year, but it was all connected to a localized internet (so I could control the IP addresses of each node). Still, it should be similar to your problem or at least a place to look to get started.

If you know the IP address of the node computers you're trying to communicate with from a central machine (master machine) you can use:

[~,pingInfo] = dos(['ping ' IPaddress]);

if length(pingInfo)<390
    %node is offline
end

If the node is online then 'pingInfo' will be a message greater than 390 characters. If the node is offline then 'pingInfo' will be a message much shorter than 390 characters. I know its kind of cheesy, but it is an easy way to tell if the machine has a stable internet connection (the first step to successfully sending data).

You can easily send files over an internet connection to a centrally located (network) folder, as long as each machine has access to it. Just save it to the folder with one machine and open it with another.

You should be able to access command prompt for each computer to do the other things you are looking to do.

Hope that at least gets some wheels turning...

Subject: connect two remote computers

From: Konst

Date: 15 Sep, 2012 14:35:07

Message: 3 of 7

"Maxx Chatsko" wrote in message <k2vndj$pnn$1@newscl01ah.mathworks.com>...
> "Konst " <konstance1@hotmail.com> wrote in message <k2vl2k$gti$1@newscl01ah.mathworks.com>...
> > So I need to connect two remote computers via wireless internet. I need to have the full control of the second pc (change its clock, set it to reboot after certain time etc) but I also want to transfer data files. That is, to connect to the second pc let's say every 5 minutes and collect its recorded data and save them.
> > I need a general direction here because I have no idea what I'm doing and what I'll need. Also is there a risk of loosing data on the way through the transfer? Which version of Matlab is more fitting?
> > Thanks in advance and I'd really appreciate any help you could give me.
>
> I created a distributed computing system last year, but it was all connected to a localized internet (so I could control the IP addresses of each node). Still, it should be similar to your problem or at least a place to look to get started.
>
> If you know the IP address of the node computers you're trying to communicate with from a central machine (master machine) you can use:
>
> [~,pingInfo] = dos(['ping ' IPaddress]);
>
> if length(pingInfo)<390
> %node is offline
> end
>
> If the node is online then 'pingInfo' will be a message greater than 390 characters. If the node is offline then 'pingInfo' will be a message much shorter than 390 characters. I know its kind of cheesy, but it is an easy way to tell if the machine has a stable internet connection (the first step to successfully sending data).
>
> You can easily send files over an internet connection to a centrally located (network) folder, as long as each machine has access to it. Just save it to the folder with one machine and open it with another.
>
> You should be able to access command prompt for each computer to do the other things you are looking to do.
>
> Hope that at least gets some wheels turning...


Thanks for your answer, it definately is a start. But when I try it I get the followin error:
??? [~,pingInfo] = dos(['ping ' IPaddress]);
      |
Error: Expected a variable, function, or constant, found ",".
Also why 390?
I think I know how to use shared folders but it's not exactly what I need. I need to open a data file that exists in one pc and view it in my own pc using a matlab session so that I can process the data (plot etc)
Thanks though for your time!

Subject: connect two remote computers

From: Bruno Luong

Date: 15 Sep, 2012 14:49:08

Message: 4 of 7

"Konst " <konstance1@hotmail.com> wrote in message <k323mr$ff8$1@newscl01ah.mathworks.com>...

>
> Thanks for your answer, it definately is a start. But when I try it I get the followin error:
> ??? [~,pingInfo] = dos(['ping ' IPaddress]);
> |
> Error: Expected a variable, function, or constant, found ",".

Looks like you run old MATLAB version. Please try:

 [dummy,pingInfo] = dos(['ping ' IPaddress]);

Bruno

Subject: connect two remote computers

From: Konst

Date: 15 Sep, 2012 15:03:06

Message: 5 of 7

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <k324h4$i1j$1@newscl01ah.mathworks.com>...
> "Konst " <konstance1@hotmail.com> wrote in message <k323mr$ff8$1@newscl01ah.mathworks.com>...
>
> >
> > Thanks for your answer, it definately is a start. But when I try it I get the followin error:
> > ??? [~,pingInfo] = dos(['ping ' IPaddress]);
> > |
> > Error: Expected a variable, function, or constant, found ",".
>
> Looks like you run old MATLAB version. Please try:
>
> [dummy,pingInfo] = dos(['ping ' IPaddress]);
>
> Bruno

Ok so I replace '~' with a variable, let's say 'dummy'. Why no matter which Ip address I use it always returns the same result, i.e. length(pingInfo)=104?
Thank you

Subject: connect two remote computers

From: Konst

Date: 17 Sep, 2012 12:58:08

Message: 6 of 7

This is what I thought so far: create a VPN with a program like LogMeIn and then use windows' Remote Desktop Connection. Once I connect to the computer I want to control, I open Matlab and load the data files I need to share so then I can do whatever I want with them eg plot, shave them in a different format etc. The question is everything I save (graphs, new data files etc) will be saved to my computer too or only to the remote one so I'll lost them again when I turn the VPN down?
Thanks!

Subject: connect two remote computers

From: John

Date: 7 Oct, 2013 09:16:06

Message: 7 of 7

I would recommend using GoSupportNow remote support tool for remotely accessing computers. It allows remote access, file transfer etc.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us