Jump to content

Stripped down WiFi test source


Sintax

Recommended Posts

I was stripping down wifi_lib_test and figured I'd give it out to save other people the hassle. Here is extremely basic source which does the minimum to get you connected to an AP and has a simple UDP test. I've also heavily commented it, so developers can have the essentials needed to hopefully get up and running with WiFi code quickly.

 

Download here

 

Everything is all set up, so a simple 'make' command to the unzipped directory should pop out an nds and gba.nds.

Edited by Sintax
Link to comment
Share on other sites

is this supposed to work with udp_test? it does nothing when i try it with my code and neither with this yet the official one works fine.

 

You would probably have to change the internal IP and port. Since I'm protected by WEP here, I recompiled the source with the IP to send to as my outside line, forwarded port 8888, and stole a neighbor's wifi to test, and it seems to work fine. Make sure you aren't mismatching ports somewhere...

Link to comment
Share on other sites

i've done all that though i sent it to 192.168.2.101 (my comp ip) which is the destip on port 8888 but i get nothing.  hmmm i might try send it through the internet see where that gets me.

i've tried everything i can think of but it wont work, i dont get it? i've basically have copied and pasted the original and this code but it wont work

its says dest ip :192.168.2.101 (my comp)

source 192.168.1.189 (ds)

port : 8888

 

but i get no response

if(Stylus.Held) {

if(Stylus.X>208 && (Stylus.Y>144)){

strcpy(sendbuf,text);

 

sain.sin_family=AF_INET;

sain.sin_port=htons(portnum);

sain.sin_addr.s_addr=destip;

sendto(sock,"test",strlen("test"),0,(struct sockaddr *)&sain,sizeof(sain));

 

}

 

that pretty much a copy of sgstairs version but i've hardcoded a message in this case.(it was using a typed version b4)

i noticed that yours says out and stevens says in which is odd but i swapped them and it made no difference.

Link to comment
Share on other sites

is this supposed to work with udp_test? it does nothing when i try it with my code and neither with this yet the official one works fine.

 

You would probably have to change the internal IP and port. Since I'm protected by WEP here, I recompiled the source with the IP to send to as my outside line, forwarded port 8888, and stole a neighbor's wifi to test, and it seems to work fine. Make sure you aren't mismatching ports somewhere...

 

WEP's working ? :D

Link to comment
Share on other sites

i've done all that though i sent it to 192.168.2.101 (my comp ip) which is the destip on port 8888 but i get nothing.  hmmm i might try send it through the internet see where that gets me.

i've tried everything i can think of but it wont work, i dont get it? i've basically have copied and pasted the original and this code but it wont work

its says dest ip :192.168.2.101 (my comp)

source 192.168.1.189 (ds)

port : 8888

 

but i get no response

if(Stylus.Held) {

if(Stylus.X>208 && (Stylus.Y>144)){

strcpy(sendbuf,text);

 

sain.sin_family=AF_INET;

sain.sin_port=htons(portnum);

sain.sin_addr.s_addr=destip;

sendto(sock,"test",strlen("test"),0,(struct sockaddr *)&sain,sizeof(sain));

 

}

 

that pretty much a copy of sgstairs version but i've hardcoded a message in this case.(it was using a typed version b4)

i noticed that yours says out and stevens says in which is odd but i swapped them and it made no difference.

 

Please note that in general you cannot send data from a 192.168.1.* address to a 192.168.2.* without a gateway system configured for the connection between the two seperate networks (I'm willing to bet you don't have such in place)

This isn't rocket science, but it really really helps to have a solid understanding of networking... if you do have further questions, I'm more open to talking on IRC - see #dswifi on EFnet - I'm usually around. (Forums are good for lengthy discussions about topics that most parties understand well, but are not as well suited for teaching, etc - IMO)

 

-Stephen

Link to comment
Share on other sites

i've done all that though i sent it to 192.168.2.101 (my comp ip) which is the destip on port 8888 but i get nothing.  hmmm i might try send it through the internet see where that gets me.

i've tried everything i can think of but it wont work, i dont get it? i've basically have copied and pasted the original and this code but it wont work

its says dest ip :192.168.2.101 (my comp)

source 192.168.1.189 (ds)

port : 8888

 

but i get no response

if(Stylus.Held) {

if(Stylus.X>208 && (Stylus.Y>144)){

strcpy(sendbuf,text);

 

sain.sin_family=AF_INET;

sain.sin_port=htons(portnum);

sain.sin_addr.s_addr=destip;

sendto(sock,"test",strlen("test"),0,(struct sockaddr *)&sain,sizeof(sain));

 

}

 

that pretty much a copy of sgstairs version but i've hardcoded a message in this case.(it was using a typed version b4)

i noticed that yours says out and stevens says in which is odd but i swapped them and it made no difference.

 

Please note that in general you cannot send data from a 192.168.1.* address to a 192.168.2.* without a gateway system configured for the connection between the two seperate networks (I'm willing to bet you don't have such in place)

This isn't rocket science, but it really really helps to have a solid understanding of networking... if you do have further questions, I'm more open to talking on IRC - see #dswifi on EFnet - I'm usually around. (Forums are good for lengthy discussions about topics that most parties understand well, but are not as well suited for teaching, etc - IMO)

 

-Stephen

yes i realised that almost as soon as i posted it. Believe it or not i actually have a degree in internet engineering <_< so now i feel really dumb, i probably should have withdrawn that. You dont need to teach me about it but thanks anyway.

Link to comment
Share on other sites

Haha, ok - well. I'm still around if you do have questions <_<

 

-Stephen

thanks i think i might have found a bug in the wifi since my progs crashing at the mo but i wont bother with it yet since i've yet to do any sort of investigation into the cause and as we all know its far from finished. i've been making a real idiot of myself recently! thats 3 times in row now i've post a question only to realise my mistake about 5mins later lol. You've probably got a point though i probably ought to have a read through my book just to refresh. For now though i'll get someone to independently verify this problem and try and get to the root of it (its probably my fault!) then i'll just leave the wifi part until the lib can mature a bit methinks, i'll c how it goes.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...