WLan disconnects

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
wombot
Posts: 5
Joined: Tue Jan 10, 2006 10:37 am

WLan disconnects

Post by wombot »

Hi there, I seem to be having a bit of an interesting problem with the wlan module. I'm using it to send control data from my psp to pc, but am having problems with sockets disconnecting after about 30 seconds.

I have no problem connecting, and the first run of my lua script after starting luaplayer seems to work fine, and remains connected as long as I want. On subsequent runs after that it will only remain connected for 30 sec - 1 min. If I completely restart lua player then is will run stably again...

I have wireless power save mode off, and I run socket:close() and wlan.term() before the script ends.

Is it possible that something isn't being cleaned up properly after ending the script??

Any suggestions are welcome, thanks!
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

Yeah, one suggestion is to terminate & restart the connection every minute with a timer.
Yes I'm serious.
It would be nice to see a cleaner way.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Are you doing anything like calling scePowerTick() on a regular basis? I've found with the psplink wlan stuff if you leave the psp on for a while (maybe 5-10 minutes) without doing anything at all the wifi connection seems to totally drop out. Though it does sound slightly different in your case.
wombot
Posts: 5
Joined: Tue Jan 10, 2006 10:37 am

Post by wombot »

Yep, I've tried that and it doesn't seem to effect anything.

I also tried it on a couple different computers on different networks, so I'm pretty sure it's not something to do with my network configuration or pc.

Thanks for the suggestion though!
Elxx
Posts: 16
Joined: Wed Dec 07, 2005 4:48 pm
Contact:

Post by Elxx »

This is an issue that I've been having as well with my LuaPlayer-powered web server. Same thing as you...if, within the script, I close the WLAN connection and start it up again, it will only work for around 20 seconds before refusing any further requests. The WLAN light on the PSP blinks consistently whenever I try to send a request, but it ignores it and no data ever makes it back.

The only way to get past this, it seems, is to completely reload your script every time you want to make a new WLAN connection. We need to figure out the problem here, I suspect it's something in the LuaPlayer code...
wombot
Posts: 5
Joined: Tue Jan 10, 2006 10:37 am

Post by wombot »

Well it's at least good to know that I'm not the only one with this problem.
If it is a problem with luaplayer, hopefully it's an easy fix.
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

Elxx wrote:if, within the script, I close the WLAN connection and start it up again, it will only work for around 20 seconds before refusing any further requests. The WLAN light on the PSP blinks consistently whenever I try to send a request, but it ignores it and no data ever makes it back.
I think this is a problem in the PSPSDK: looks like pspSdkInetTerm doesn't work, or I'm doing something wrong in Lua Player.
Elxx
Posts: 16
Joined: Wed Dec 07, 2005 4:48 pm
Contact:

Post by Elxx »

I'll mess around with it and tell you if I can figure anything out.

EDIT:
Okay, one workaround that I've found working for my server, at least, is not doing Wlan.init() and Wlan.term() each time I want to reconnect to the access point. What I did was add a disconnectAP() function to my LuaPlayer core that calls just sceNetApctlDisconnect();. This kills the network connection, but allows you to use useConnectionConfig again to reconnect to the access point, without the connection dying on that second attempt. Also, any sockets I have opened can be kept open through this whole thing, they will still receive data.

So this does indeed look like a problem with Wlan.term(). I suspect that my workaround only works for standalone Lua apps, and probably not with Lowser. But that's what I've been able to do.
liquid8d
Posts: 66
Joined: Thu Jun 30, 2005 6:29 am

Post by liquid8d »

any news on these wlan issues? I have this issue, as well as downloading files do not always finish.

I haven't taken a look at the stuff for the SDK, or the Lua Player src, but prior to, using the wifi src in C, I have had no issues.

It seems as though something is off. It would be nice too if the sockets would close as they should.

Can't wait for the next version.... because that's when my project will most likely be released :P

liquid8d
modsyn
Posts: 28
Joined: Tue Sep 27, 2005 6:02 am

Post by modsyn »

i had problems with the wifi stopping too until i put in the power tick
command during my download loop. after that it didn't happen anymore.
Post Reply