View unanswered posts | View active topics It is currently Sat Jul 26, 2014 1:14 pm






Reply to topic  [ 8 posts ] 
NXT2WIFI using WEP connection 
Author Message
Novice

Joined: Sun Jun 13, 2010 9:26 am
Posts: 58
Post 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


Wed Oct 31, 2012 11:37 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post 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. :)


Thu Nov 01, 2012 5:05 am
Profile
Novice

Joined: Sun Jun 13, 2010 9:26 am
Posts: 58
Post 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,


Thu Nov 01, 2012 9:26 am
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post 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);
}


Thu Nov 01, 2012 5:11 pm
Profile
Novice

Joined: Sun Jun 13, 2010 9:26 am
Posts: 58
Post 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


Thu Nov 01, 2012 9:54 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post 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.


Fri Nov 02, 2012 1:32 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3163
Location: Rotterdam, The Netherlands
Post 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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri Nov 02, 2012 4:27 pm
Profile WWW
Novice

Joined: Sun Jun 13, 2010 9:26 am
Posts: 58
Post 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


Wed Nov 07, 2012 11:03 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.