ROBOTC.net forums
http://www.robotc.net/forums/

NXT2WIFI using WEP connection
http://www.robotc.net/forums/viewtopic.php?f=1&t=5050
Page 1 of 1

Author:  Lego Geek [ Wed Oct 31, 2012 11:37 pm ]
Post subject:  NXT2WIFI using WEP connection

Hello:

I am trying to use Xander's sample code for the NXT2WIFI (benedettelli-nxt2wifi-test3.c) and made the following changes from:
Code:
     // SSID to connect to
     N2WsetSSID("YOURWIFINETWORK");
     wait1Msec(100);
     // The passphrase to use
     N2WSecurityWPA2Passphrase("YOURWIFIPASSPHRASE");

to:
Code:
     // SSID to connect to
     N2WsetSSID("Pickles");
     wait1Msec(100);
     // The passphrase to use
     string code = "8899077ae151f03cf464893785";
     N2WSecurityWEP104(code);


I still cannot connect to my wireless acess point. Are there other changes I need to make?

Mike

Author:  MHTS [ Thu Nov 01, 2012 5:05 am ]
Post subject:  Re: NXT2WIFI using WEP connection

I am not sure if that's the culprit but the string type can only hold up to 19 characters and your passphrase is longer than 19 characters.

Xander,
You should really get rid of the string type and use char array instead. :)

Author:  Lego Geek [ Thu Nov 01, 2012 9:26 am ]
Post subject:  Re: NXT2WIFI using WEP connection

Xander did not supply the line: string code = "value";

That was my lack of understanding. How should the string value be entered?

Are there other changes I need to make?

Mike,

Author:  MHTS [ Thu Nov 01, 2012 5:11 pm ]
Post subject:  Re: NXT2WIFI using WEP connection

Lego Geek wrote:
Xander did not supply the line: string code = "value";

That was my lack of understanding. How should the string value be entered?

Are there other changes I need to make?

Mike,

No, I am referring to the implementation of Xander's driver on N2WSecurityWPA2Passphrase where it takes one argument of type "string". Your call to that function is fine but my understanding is that the string type only supports up to 19 characters. So I am suspecting your password got truncated. I don't have RobotC in front of me. You can probably do an experiment to find out. Run the code below and make sure myString is not truncated. Caveat: since I don't have RobotC in front of me, the following code is written from memory. I think the strlen function takes the "string" type not just "char *". I also think writeDebugStream will take string type. Feel free to modify the code appropriately.
Code:
void Func1(string myString)
{
    writeDebugStreamLine("len=%d", strlen(myString));
    writeDebugStreamLine("str=%s", myString);
}

task main()
{
    string bigString = "123456789012345678901234567890";

    Func1(bigString);
}

Author:  Lego Geek [ Thu Nov 01, 2012 9:54 pm ]
Post subject:  Re: NXT2WIFI using WEP connection

My programming skills are very limited. I understand that the 19 character limitation. How do I pass the 26 character passcode if it will only recognize the first 19 characters?

Mike

Author:  MHTS [ Fri Nov 02, 2012 1:32 am ]
Post subject:  Re: NXT2WIFI using WEP connection

That's why Xander needs to change his code to accept a char pointer instead of a string. That will remove the limit of 19 characters on string.
BTW, I just tried the test code I recommended you to try. It indeed confirms that it truncated your string to only 19 characters. Therefore, you should try to change your WiFi router's password to 19 character or less and you shall be successful connecting to it.

Author:  mightor [ Fri Nov 02, 2012 4:27 pm ]
Post subject:  Re: NXT2WIFI using WEP connection

Hey there,

There is still a lot of work I need to do to make the NXT2WIFI driver more flexible, now that we have pointers and other nice things. Rest assured that I am working hard on it!

- Xander

Author:  Lego Geek [ Wed Nov 07, 2012 11:03 pm ]
Post subject:  Re: NXT2WIFI using WEP connection

Okay.... So I now have a wireless router that supports WPA2 format. The laptop says the the wireless connection is:
SSID: pickles
security type: WPA2-personal
encryption type: AES
network security key: littlebob

I then made the required changes to the benedettelli-nxt2wifi-test3.c code sample:

Code:
     // SSID to connect to
     N2WsetSSID("pickles");
     wait1Msec(100);
     // The passphrase to use
     N2WSecurityWPA2Passphrase("littlebob");


The NXT shows:
Stat: connecting
0.0.0.0
-----------
RX/TX 0/0

The debug stream shows:
hallo daar

The NXT will not connect to the wireless. What am I missing?

Mike

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/