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 

Problem to make a stable Wifi client on the PSP

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



Joined: 07 Sep 2005
Posts: 37

PostPosted: Mon Sep 19, 2005 12:41 pm    Post subject: Problem to make a stable Wifi client on the PSP Reply with quote

I am using the pspnet lib from pspkrazy's ftpd client to make a small wifi client which connects to a small tcp server running on my PC, the server prints out everything it receives.

I am trying to transfer 256k of text as a test.

Sometimes, it works completely, sometimes, the PSP hangs in the middle.

Also, it sometimes happens that the PSP is hanging when i try to connect to the server with:

sceNetInetConnect(sock, &addrListen, sizeof(addrListen));

even if the server perfectly runs ...

Did some of you experience such random problems ?

I was wondering if there was a timeout problem during the transfer ...
Any idea on how to set the timeout for the socket ?

i did not succeed to do it by using ( with 0 for r, w, o )
int sceNetInetSelect(SOCKET s, fd_set *r, fd_set *w, fd_set *o, struct timeval *timeout);

Also, how can i set the socket to be blocking/non-blocking ?
Back to top
View user's profile Send private message Visit poster's website
reakt



Joined: 06 May 2005
Posts: 22
Location: Basingstoke, UK

PostPosted: Mon Sep 19, 2005 7:01 pm    Post subject: Reply with quote

Regarding setting the blocking / non-blocking, and connection timeouts. This was asked (and answered) last week. See this thread: http://forums.ps2dev.org/viewtopic.php?t=3360
Back to top
View user's profile Send private message
F9zDark



Joined: 02 Apr 2005
Posts: 127

PostPosted: Tue Sep 20, 2005 3:51 am    Post subject: Reply with quote

Also, if it is of any help, I saw an article a while back showing users how to replace the PSP's WiFi antenna with a more efficient one purchased online. The author's tests showed that the PSP's antenna is abhorrently inefficient and suffers from alot of noise.

The upgraded antenna reduced the noise to almost 0 and increased the operating range. Might be something to think about. (if I can find the link I will post it here. the method isn't practical, since it requires taking the PSP apart...)
Back to top
View user's profile Send private message AIM Address
AudioMonster



Joined: 07 Sep 2005
Posts: 37

PostPosted: Tue Sep 20, 2005 4:00 am    Post subject: Reply with quote

Yes i've seen that one, and i would prefer not taking my PSP apart :-P
My biggest problem is the fact that it stops in the middle of the transfert, randomly.

The interesting thing is, if i brutally stop my server when the PSP seems to be freezed, sceNetInetSend(sock,ss,1024,0); unblocks and returns -1... ( which is expected ).

But why is it blocking then ? I would think it's because the server hasn't received all the data sent by the PSP ( or at least the PSP did not receive acknowledgment ) and PSP's send-buffer is already full, so it blocks waiting some acknowledgment ... maybe my wifi router is also the cause of this ?
Back to top
View user's profile Send private message Visit poster's website
F9zDark



Joined: 02 Apr 2005
Posts: 127

PostPosted: Tue Sep 20, 2005 8:48 am    Post subject: Reply with quote

This may be a stupid question, but did you turn off WiFi Power Save in the system settings?

That is certainly a killer when it comes to using the WiFi(makes it almost unuseable...)

I got sick of using the Wipeout browser, so I really do not know of how it handles itself for extended periods of time without Power Save on.
Back to top
View user's profile Send private message AIM Address
AudioMonster



Joined: 07 Sep 2005
Posts: 37

PostPosted: Wed Sep 21, 2005 2:05 am    Post subject: Reply with quote

In my settings, the WiFi Power Save is on. I am not sure this is really the problem (?)

Yesterday i tried to use a non-blocking socket to send data to my server. There is a point where the sceNetInetSend function returns -1... i can retry and retry .... it always returns -1 ( i send 100 bytes per call ).

So i tried to do a kind of handshaking mecanism, it would probably slow-down the transfer...

So, the PSP sends 4 bytes saying the number of bytes it is going to send, then sends those bytes, then waits for 4 bytes from the server, then continue...
The server gets the 4 bytes, reads that number of bytes and sends back those 4 bytes to the PSP as an ack.

And i still have the same problem ! :( There is a random point where the PSP will block during the transfer.

Because i use only very low level PSP functions, i have no clue how to solve this :(
Back to top
View user's profile Send private message Visit poster's website
PspPet



Joined: 30 Mar 2005
Posts: 210

PostPosted: Wed Sep 21, 2005 2:32 am    Post subject: Reply with quote

> maybe my wifi router is also the cause of this ?...
> Yesterday i tried to use a non-blocking socket to send data to my server...
If you can, try a different WiFi card (either direct to the PC, or a different WiFi access point/router)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
AudioMonster



Joined: 07 Sep 2005
Posts: 37

PostPosted: Wed Sep 21, 2005 2:35 am    Post subject: Reply with quote

OK i'll try that ( My PC is a laptop with integreated WiFi. ).

I'll try using an other router and plug the PC directly on it via RJ45.

But don't you think i should find a solution to make it work with my current setup ?
Back to top
View user's profile Send private message Visit poster's website
F9zDark



Joined: 02 Apr 2005
Posts: 127

PostPosted: Wed Sep 21, 2005 1:26 pm    Post subject: Reply with quote

Turn off WLAN Power Save. I don't know exactly how its supposed to work, but it doesn't work as one would hope. It drops connection constantly. Try it with Power Save off and see what happens.
Back to top
View user's profile Send private message AIM Address
AudioMonster



Joined: 07 Sep 2005
Posts: 37

PostPosted: Thu Sep 22, 2005 1:57 am    Post subject: Reply with quote

Ok, so i tried various things.

First i now have "Power save for WLAN" set to OFF.
I tried with a different WiFi router, that i've directly plugged to my laptop via RJ45. Also, i have disabled WEP encryption.

And i still had the same problem.

I tried to play with the send buffer size, reducing it and sending less bytes at each call of sceNetInetSend... and it also end-up to hang.

I have the feeling that i tried everything without success :(
Back to top
View user's profile Send private message Visit poster's website
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