08 September 2010 ..:: Forum ::.. Register
Login

You must be registered and logged in to post to this forum.

 Forum Minimize
SearchForum Home
  Discussions  Developers  Connect via Mat...
 Connect via Matlab
 
 23/04/2010 20:36:57
patrikanderss
1 posts


Connect via Matlab

 Hi all, 

I am in need of some basic help. 
I don't know if anyone here is familiar with the Matlab environment, but since you seem to be way more into these things than I am you might be able to help anyway. smile 
I want to connect and control Spykee from Matlab, but I run into problems right away. 
Shortly, what I have done is (I run Vista if that is important): 
1. Connected via wifi to the spykee ip. 
2. Create the tcpip-object to port 9000: 
   t = tcpip('172.17.6.1',9000); 
3. Open the port: 
   fopen(t); 
4. The port status is now: 
    ByteOrder = bigEndian 
    BytesAvailable = 0 
    BytesAvailableFcn = 
    BytesAvailableFcnCount = 48 
    BytesAvailableFcnMode = terminator 
    BytesToOutput = 0 
    ErrorFcn = 
    InputBufferSize = 512 
    Name = TCPIP-172.17.6.1 
    ObjectVisibility = on 
    OutputBufferSize = 512 
    OutputEmptyFcn = 
    RecordDetail = compact 
    RecordMode = overwrite 
    RecordName = record.txt 
    RecordStatus = off 
    Status = closed 
    Tag = 
    Timeout = 10 
    TimerFcn = 
    TimerPeriod = 1 
    TransferStatus = idle 
    Type = tcpip 
    UserData = [] 
    ValuesReceived = 7 
    ValuesSent = 5 

    TCPIP specific properties: 
    LocalHost = 
    LocalPort = 63417 
    LocalPortMode = auto 
    ReadAsyncMode = continuous 
    RemoteHost = 172.17.6.1 
    RemotePort = 9000 
    Terminator = LF 
    TransferDelay = on 
5. Send first line (login: admin, passw: oporodo): 
   fwrite(t,['PK' char(10) char(0) char(5+7+2)],'uchar'); 
   No problem so far! 
6. Send second line: 
   fwrite(t,[char(5); 'admin'; char(7); 'oporodo'],'uchar'); 
Now I get an error: 
??? Error using ==> icinterface.fwrite at 191 
Connection closed by RemoteHost. Use FOPEN to connect to RemoteHost. 

If anyone can help me I would be extremely grateful! 

Cheers, 
Patrik

  Discussions  Developers  Connect via Mat...

SearchSearch  Forum HomeForum Home    Print   
Copyright 2007 by spykee.org   Terms Of Use  Privacy Statement