forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sending data via USB

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
MBx



Joined: 22 Mar 2009
Posts: 35

PostPosted: Sun Mar 22, 2009 12:56 am    Post subject: Sending data via USB Reply with quote

Dear PSP Developers,

how is it possible to send data via USB from PSP to PC?

I searched the forum and found some information on usbhostfs and remotejoy but no sample code.

tnx,
MBx
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sun Mar 22, 2009 4:53 am    Post subject: Reply with quote

You obviously don't look very hard now do you...
Back to top
View user's profile Send private message
MBx



Joined: 22 Mar 2009
Posts: 35

PostPosted: Sun Mar 22, 2009 7:24 am    Post subject: Reply with quote

I did my bets searching, sorry if it was not enough.

BTW, it seems that I must rewrite my question.
actually I found some thing about loading files and view directories and ... via usb, but I'm looking for something like "ports" or "piping".
I need to establish between a program in PC and one in PSP.

any help?
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sun Mar 22, 2009 10:20 am    Post subject: Reply with quote

http://svn.ps2dev.org/filedetails.php?repname=psp&path=%2Ftrunk%2Fpsplinkusb%2Ftools%2Fecho%2Fmain.c&rev=0&sc=0

An example of using the ansynchronous pipes with usbhostfs to allow a simple connection between PSP and PC.
Back to top
View user's profile Send private message
MBx



Joined: 22 Mar 2009
Posts: 35

PostPosted: Sun Mar 22, 2009 7:05 pm    Post subject: Reply with quote

tnx man, appreciate it :)
Back to top
View user's profile Send private message
MBx



Joined: 22 Mar 2009
Posts: 35

PostPosted: Mon Mar 23, 2009 3:25 am    Post subject: Reply with quote

Unfortunately, I still have problem with this USB thing.

I'm loading "usbhostfs.prx" first and then I'm trying to register a USB connection.
the psp allocates the channel and then stops at "usbWaitForConnect()".

is this the place where PC should do something or what?

my guess was that the pc program must connect a tcp socket to localhost:10004 but trying this I get the following exception:
"No connection could be made because the target machine actively refused it 127.0.0.1:10004"

I'm using windows vista coding in C# (don't be silly please :D, I'm using this just for tests!).
another thing to mention is that I've installed usblib on windows.

any help?
Back to top
View user's profile Send private message
MBx



Joined: 22 Mar 2009
Posts: 35

PostPosted: Mon Mar 23, 2009 5:45 am    Post subject: Reply with quote

reading some parts of PSPLINK code I've noticed that I have to call:
Code:
sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0);
sceUsbStart(HOSTFSDRIVER_NAME, 0, 0);
sceUsbActivate(0x1C9);

is this correct?

now the program do not wait for the connection, but I still have no idea about the PC side :(
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Mon Mar 23, 2009 6:13 am    Post subject: Reply with quote

Sigh... You do know you need to be running usbhostfs_pc on the PC side otherwise it has nothing to communicate with.
Back to top
View user's profile Send private message
MBx



Joined: 22 Mar 2009
Posts: 35

PostPosted: Mon Mar 23, 2009 8:26 am    Post subject: Reply with quote

tnx again TyRaNiD, it seems that u r the only man here, tnx.

So, I did tun the usbhostfs_pc.exe and my PC program connected to it successfully, but it's not still able to receive anything from PSP.
I think that usbhostfs_pc.exe is not connected to PSP since I do not see or feel any difference when I run or not my PSP program!
is there any message or something if usbhostfs_pc.exe connects to PSP?

if yes, what is the problem u think?
is there any thing more I need to setup than the functions above?

tnx again.
Back to top
View user's profile Send private message
MBx



Joined: 22 Mar 2009
Posts: 35

PostPosted: Mon Mar 23, 2009 8:43 am    Post subject: Reply with quote

I've read the usbhostfs_pc code and there is message for sure:
"Connected to device\n"
so what is wrong with my approach? :(
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Mon Mar 23, 2009 3:53 pm    Post subject: Reply with quote

I guess try and geting psplink to work, that would at least rule out whether it is a general problem or your code. Tbh there are a few machines that for what ever reason just do not work with usbhostfs but it is rare.
Back to top
View user's profile Send private message
MBx



Joined: 22 Mar 2009
Posts: 35

PostPosted: Mon Mar 23, 2009 9:09 pm    Post subject: Reply with quote

Nice one TyRaNiD

OK, I tried PSPLink 3.0 and it was not working.
fooling around I've found out that it was an unknown problem with libusb. I removed the device and installed it again and everything works as pie.

running PSPLink I told myself why not use this great tool to continue development? trying to run the "sprite" sample from pspsh I get the following error:
"Failed to Load/Start module 'host0:/sprite.elf' Error: 0x80020148"
what's wrong?

I'm on phat PSP fw 5.0 M33-4 with LEDA installed.
Back to top
View user's profile Send private message
MBx



Joined: 22 Mar 2009
Posts: 35

PostPosted: Mon Mar 23, 2009 9:11 pm    Post subject: Reply with quote

OK, the answer is already here:
http://forums.ps2dev.org/viewtopic.php?t=11193&start=0&postdays=0&postorder=asc&highlight=80020148
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group