Hi
I am using a computer to create an ad-hoc wifi network. Now, I want to access this network using wifi shield CC3000. My sketch fails to turn up the network, though it detects the network among the available ones. I use a WPA-personal encryption. the Serial monitor is stuck with "attempting to connect the xxx network."
I am using for instance the buildtest example sketch.
Please help!
My intention is to access the data logged on the sd card of the wifi shield in the computer, which is wifi connected to the arduino board and shield thru an adhoc network. Please suggest, if it is doable. I can insert a schematic representation if someone wants further understanding on the expectation.
CC3000 wifi shield connection to an ad-hoc network
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 9
- Joined: Fri Apr 25, 2014 5:03 pm
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: CC3000 wifi shield connection to an ad-hoc network
I'm pretty sure your initial problem is that the computer hosting the ad-hoc network isn't running a DHCP server that would give the CC3000 its configuration. You might be able to solve that by setting the CC3000's IP address statically, but that requires some changes to the library.
A more long-term problem is that you won't be able to access the SD card unless the Arduino implements some kind of file-sharing protocol like Samba, and I strongly doubt that an Arduino has enough memory to do that.
A more long-term problem is that you won't be able to access the SD card unless the Arduino implements some kind of file-sharing protocol like Samba, and I strongly doubt that an Arduino has enough memory to do that.
- superman136
- Posts: 14
- Joined: Tue Sep 23, 2014 8:12 pm
Re: CC3000 wifi shield connection to an ad-hoc network
I have the same problem like the guy above. Please help me to solve the problem as you said. Setting CC300's IP address statically, change on library. Can you talk and explain it in more detail. Please.
I am totally noob for this.
I am totally noob for this.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: CC3000 wifi shield connection to an ad-hoc network
The library has been modified to support static IP addresses since the last time this thread was active. It now has a function named '.setStaticIPAddress()' which will do all the work for you. There's also a helper function named '.IP2U32()' which converts the kind of network numbers people read to the kind the CC3000 can use.
To make those work, you need to know four pieces of information which are usually written in 'dotted octet notation':
- The IP address you want to use (ex: 192.168.42.100)
- The address mask for the network (usually 255.255.255.0)
- The IP address of the router (ex: 192.168.42.1)
- The IP address of the nameserver (ex: 8.8.8.8)
The code to configure a static address would look something like this:
To make those work, you need to know four pieces of information which are usually written in 'dotted octet notation':
- The IP address you want to use (ex: 192.168.42.100)
- The address mask for the network (usually 255.255.255.0)
- The IP address of the router (ex: 192.168.42.1)
- The IP address of the nameserver (ex: 8.8.8.8)
The code to configure a static address would look something like this:
Code: Select all
uint32_t addr = cc3000.IP2U32( 192, 168, 42, 100 );
uint32_t mask = cc3000.IP2U32( 255, 255, 255, 0 );
uint32_t rout = cc3000.IP2U32( 192, 168, 42, 1 );
uint32_t dns = cc3000.IP2U32( 8, 8, 8, 8 );
cc3000.setStaticIPAddress( addr, mask, rout, dns );
- nedwards
- Posts: 1
- Joined: Thu Jun 11, 2015 3:01 pm
Re: CC3000 wifi shield connection to an ad-hoc network
Pretty sure the cc3000 does not support ad hoc mode.
Please be positive and constructive with your questions and comments.