Page 1 of 2

ap_search example problems

Posted: Fri Mar 16, 2012 12:17 pm
by sverx
I correctly compiled the ap_search dswifi lib example, TTBOMK, but it doesn't seem to work on my DS (Lite) :|
If I understand correctly, the function

Code: Select all

Wifi_InitDefault(false);
should turn on the wi-fi hardware, and the green led should start blinking, right?

Well, I get no blinking on my DS, upper screen turns white and lower one black, nothing written on it. Of course wi-fi is working fine on my DS, and dkA is updated to ver. 36, dswifi is 0.3.13.

Any idea? :?:

Re: ap_search example problems

Posted: Tue Mar 20, 2012 9:22 am
by sverx
I tried updating dkA & libnds & everything... no luck.
Then completely disinstalled and reinstalled everything from scratch... again, nothing changed. :x

Is that example supposed to work, actually? Somebody can confirm it works on his setup? Sorry to bother, but I'd really like to start experimenting with dswifi lib...

Re: ap_search example problems

Posted: Tue Mar 20, 2012 6:52 pm
by vuurrobin
Are you sure that there are AP close by that aren't locked? I'm not sure if they should show up, but any AP that has security higher than WEP won't be able to connect with the DS anyway.

Re: ap_search example problems

Posted: Wed Mar 21, 2012 1:36 am
by elhobbs
The ap also needs to be 802.11b compatible - b/g will usually work but I am not sure if n aps will work.

Re: ap_search example problems

Posted: Wed Mar 21, 2012 10:18 am
by sverx
vuurrobin & elhobbs: Thanks! :)

There are lots of unprotected/WEP/WPA/etc. networks around, I can see them with DSOrganize for instance. But I'm really not even trying to connect to them, just 'discover' them would be ok for this test. Looks like the DS doesn't even turn wifi on... for instance, as I said, the led doesn't even start blinking.

Did you tried compiling and testing the ap_search example? Does it work on your DS?

Anyway I am running some tests, hopefully I'll find what's going wrong...

Re: ap_search example problems

Posted: Wed Mar 21, 2012 9:15 pm
by orp
Well, pls. have a look at template.c,
be sure that the first while loop does not look like this:

Code: Select all

 while(1);
{ 
This is a non terminating loop!
You have to remove the ";". Rebuild the .nds file and the AP search should work ...

Re: ap_search example problems

Posted: Wed Mar 21, 2012 11:44 pm
by sverx
It really looks like the arm9 code is working correctly, but seems that the arm7 doesn't, or maybe the two CPUs aren't communicating properly. :x I thought maybe the arm9 code did start using the FIFO system too early, when the arm7 program wasn't yet ready to receive, so i added a huge delay (3 sec.s) before the wifi init function... well, nothing changed.
Any idea on how to check what's going wrong there? I wonder if I'm really the only one that cannot run this example :x

Re: ap_search example problems

Posted: Thu Mar 22, 2012 2:44 am
by elhobbs
the while loop in main has a semicolon after it (on line 100) like so

Code: Select all

while(1);
this causes it to loop forever on that line. it needs to be removed like this

Code: Select all

while(1)

Re: ap_search example problems

Posted: Thu Mar 22, 2012 10:17 am
by sverx
elhobbs wrote:the while loop in main has a semicolon after it (on line 100) like so

Code: Select all

while(1);
:oops: :oops: didn't really notice that! I'm going to remove it and see if everything works correctly...

Re: ap_search example problems

Posted: Thu Mar 22, 2012 11:44 am
by elhobbs
It worked on my ds. I did not notice for a while either. I started chopping out all the wifi code in the sample and it still wasn't working. I started putting prints everywhere and looking to see where it stopped. I looked at the diff on the svn and it looks like it was added when the keyboard event handler was commented out - I am not sure why.