Sending data via USB

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
MBx
Posts: 35
Joined: Sun Mar 22, 2009 12:52 am

Sending data via USB

Post by MBx »

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
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

You obviously don't look very hard now do you...
MBx
Posts: 35
Joined: Sun Mar 22, 2009 12:52 am

Post by MBx »

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?
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

http://svn.ps2dev.org/filedetails.php?r ... rev=0&sc=0

An example of using the ansynchronous pipes with usbhostfs to allow a simple connection between PSP and PC.
MBx
Posts: 35
Joined: Sun Mar 22, 2009 12:52 am

Post by MBx »

tnx man, appreciate it :)
MBx
Posts: 35
Joined: Sun Mar 22, 2009 12:52 am

Post by MBx »

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?
MBx
Posts: 35
Joined: Sun Mar 22, 2009 12:52 am

Post by MBx »

reading some parts of PSPLINK code I've noticed that I have to call:

Code: Select all

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 :(
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Sigh... You do know you need to be running usbhostfs_pc on the PC side otherwise it has nothing to communicate with.
MBx
Posts: 35
Joined: Sun Mar 22, 2009 12:52 am

Post by MBx »

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.
MBx
Posts: 35
Joined: Sun Mar 22, 2009 12:52 am

Post by MBx »

I've read the usbhostfs_pc code and there is message for sure:
"Connected to device\n"
so what is wrong with my approach? :(
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

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.
MBx
Posts: 35
Joined: Sun Mar 22, 2009 12:52 am

Post by MBx »

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.
MBx
Posts: 35
Joined: Sun Mar 22, 2009 12:52 am

Post by MBx »

Post Reply