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 

sceNetApctlConnect and DHCP

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



Joined: 26 Aug 2005
Posts: 7
Location: Stockholm

PostPosted: Tue Aug 30, 2005 4:56 pm    Post subject: sceNetApctlConnect and DHCP Reply with quote

Hi,

I'm building a wifi lib around the sceNetApctlXXX APIs and have run into the same thing as others have. Namely that the PSP have trouble obtaining an IP using DHCP.

I've compared the network traffic generated when connecting using the "Test Connection" option in the network settings menu with the traffic generated from connecting through a call to sceNetApctlConnect. When using the PSP network settings menu a full DHCPDISCOVER-> DHCPACK sequence is performed. When using sceNetApctlConnect the sequence stops after the DHCPOFFER, i.e. the PSP does not issue a DHCPREQUEST to the server.

Has anyone successfully connected to a DHCP enabled access point using sceNetApctlConnect?
Any ideas of what to test in order to get this working?
Back to top
View user's profile Send private message
pspkrazy



Joined: 04 Jul 2005
Posts: 49

PostPosted: Tue Aug 30, 2005 7:23 pm    Post subject: not the right way Reply with quote

I ve managed to disasm wipeout wireless connection code and using sceNetApctlConnect is not the right way.

Wipeout never calls sceNetApctlConnect.

It uses sceUtilityNetconf dialog boxes with parameters that configures the dialog to allow only "Connect" function when a network is selected.

In fact, it is psp's os that connect not wipeout.

Wipeout only add one handler (sceNetApctlAddHandler method) to know when the connection is established (the pspftp handler may be usefull).

Sorry for my english... :)

If only i can speak french i would be more precise.

If you manage to make sceUtilityNetconf dialogs to work, you're done.

I gave up.
Back to top
View user's profile Send private message
wedoi



Joined: 26 Aug 2005
Posts: 7
Location: Stockholm

PostPosted: Tue Aug 30, 2005 9:34 pm    Post subject: Reply with quote

I've only tested the sceUtilityNetconf API briefly but without any luck (all I got was error codes. Can't remember which right now though). I'm not sure if I missed an API call or if the PSP needs to be set in a specific graphics mode for the dialogs to appear...
I guess I have to take a look at Wipeout and find out ;)

I'll post back if I get something going... :)
Back to top
View user's profile Send private message
pspkrazy



Joined: 04 Jul 2005
Posts: 49

PostPosted: Tue Aug 30, 2005 9:54 pm    Post subject: error code Reply with quote

In my test i received no error code but nothing happened.

Maybe you have to be in kernel mode ?

I know that u have to call sceUtilityNetconfUpdate in a loop.

Be in a specific graphic mode may be the right way.

Sorry but i can't help here!
Back to top
View user's profile Send private message
Arwin



Joined: 12 Jul 2005
Posts: 426

PostPosted: Tue Aug 30, 2005 10:29 pm    Post subject: Re: not the right way Reply with quote

pspkrazy wrote:
If only i can speak french i would be more precise


Go ahead and speak French, I'll translate.
Back to top
View user's profile Send private message
PspPet



Joined: 30 Mar 2005
Posts: 210

PostPosted: Wed Aug 31, 2005 12:45 am    Post subject: Reply with quote

re: DHCP problem theory
My theory is the combination of module and thread trickery is screwing up the DHCP handler.
This is not a regular "game". My WiFi sample program is using kernel memory module flags and kernel threads to get the flash0: prxs to load. Even regular user entry thunks aren't working in this configuration.

If you connect to a Access Point and ask for a DHCP address, the system creates is a DHCP thread and semaphore created (both named "SceNetDhcpClient")
But it appears the DHCP thread ends prematurely. The sempahore is still around when it gets back to your code.

Suggestion #1: disassemble the DHCP client handler code (pspnet_apctl.prx) and figure out a workaround
Suggestion #2: reimplement the standard DHCP protocol yourself (using UDP and broadcast - may also be tricky)

I started going down path #1 - but IMHO for the very specialized uses of WiFi on the PSP, I think requiring a static IP isn't too inconvenient
[and all-but-essential for apps where the PSP is a server]
-----
> Wipeout never calls sceNetApctlConnect.
FWIW: I've seen several different ways of connecting.
The "sceNetApctlConnect" is in the bowels of the "ApDialogDummyConnection" function. There look to be a few other configuration options depending on the way the game works (Adhoc and Infrastructure, Adhoc only)

This is very trial-and-error. Not only are we dealing with undocumented initialization sequences, but also running in a tricky configuration. If you find a combination that works better, go for it !
Back to top
View user's profile Send private message Send e-mail Visit poster's website
pspkrazy



Joined: 04 Jul 2005
Posts: 49

PostPosted: Wed Aug 31, 2005 4:04 am    Post subject: theory Reply with quote

Maybe the DCHP thread is created with user flag and then can't access modules created in our kernel thread ?

Quote:
Suggestion #2: reimplement the standard DHCP protocol yourself (using UDP and broadcast - may also be tricky)

does broadcasting work ?

Quote:
My WiFi sample program is using kernel memory module flags and kernel threads to get the flash0: prxs to load. Even regular user entry thunks aren't working in this configuration.


I've tried loadmodule patches from pspsdk to start modules (either flash ones and wipeout ones) in user mode and they started but i got errors ("module not imported" something like that) when i wanted to init them.


If only we find a way to use sockets and dhcp easily, a lot a great apps would arrive.

:(
Back to top
View user's profile Send private message
wedoi



Joined: 26 Aug 2005
Posts: 7
Location: Stockholm

PostPosted: Thu Sep 01, 2005 1:06 am    Post subject: Reply with quote

Quote:
Suggestion #2: reimplement the standard DHCP protocol yourself (using UDP and broadcast - may also be tricky)

Is there a way to configure the PSP to use the settings?
Back to top
View user's profile Send private message
*eyelash



Joined: 10 Jan 2007
Posts: 3

PostPosted: Wed Jan 17, 2007 10:54 am    Post subject: Reply with quote

somebody discovered?
_________________
*eyelash
PSP TA-082 with FW 3.03 OE-A2
Back to top
View user's profile Send private message
PspPet



Joined: 30 Mar 2005
Posts: 210

PostPosted: Thu Jan 18, 2007 3:17 am    Post subject: Reply with quote

[apparently they fixed their problem, but for anyone else researching this topic]

This is very old information. This thread should be closed.
The "DHCP" problem was fixed over a year ago (Fall 2005!)

DHCP will work if you start the modules in the proper modes (some in user mode, some in kernel mode)

My WiFi .03 sample (http://www.aibohack.com/psp/wifitest.htm ), the pspsdk samples as well as all other WiFi derived apps do it the proper way.
If DHCP isn't working for you, you probably don't have your access point set up correctly, or you are porting/adapting a WiFi app and changed the module initialization.
Back to top
View user's profile Send private message Send e-mail 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