Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 1 month ago.
Setup CC3000 with LPC1768: Cannot get ip address from DHCP
Can I get some help on setting up CC3000 with LPC1768? I am running the "hello world" example David Fletcher provided in the thread
http://mbed.org/questions/1814/Setup-for-Adafruit-CC3000-and-the-mbed-L/
/media/uploads/dflet/cc3000_websocket_demo.zip
/media/uploads/dflet/cc3000_hello_world_demo.zip
and found there are two problems:
1. The firmware version, service pack version and other information from cc3000 seems not correct. I tried the cc3000 with arduino, the service pack version should be 1.24 and the other readings seem also incorrect.
2. CC3000 cannot get ip address from DHCP.
Anyone can help me setting up cc3000 with LPC1768?
************* Here is the output after enabling the debug msgs: *************
cc3000 Hello World demo.
MAC address + cc3000 info
[CC3000 : HCI TX] Command Sent : 0x0201
[CC3000 : HCI RX] Event Received : 0x0201
[CC3000 : HCI TX] Command Sent : 0x0201
[CC3000 : HCI RX] Event Received : 0x0201
MAC address 08:00:28:57:ae:51
FTC 7
PP_version 191.4
SERV_PACK 153.16
DRV_VER 49.4.153
FW_VER 10.49.19
Attempting SSID Connection.
[CC3000 : HCI TX] Command Sent : 0x0004
[CC3000 : HCI RX] Event Received : 0x0004 - Connect Policy
Connecting to SSID: my_network. Timeout is 10s.
[CC3000 : HCI TX] Command Sent : 0x0002
[CC3000 : HCI RX] Event Received : 0x0002 - Disconnect
[CC3000 : HCI TX] Command Sent : 0x0001
[CC3000 : HCI RX] Event Received : 0x0001 - Connecting
Connected.
DHCP request
Waiting for dhcp to be set.
1 Answer
11 years, 1 month ago.
Jason,
I have checked your reported problem using an open AP. I did not find any issues. If you are using connecting wires make sure that the sck wire is as short as possible, try to keep it to 4" / 100mm, as you can loose the sck if the connecting wire is too long.
EDIT: Also make sure the mbed can supply the current needed. When connecting to the 3.3v output pin the mbed will repeatedly reset, I have not tried the 5v output pin on the mbed, if you are using that pin then check with a scope that the voltage does not drop.
I have now tried connecting the cc3000 to the 5v output pin. It did work after a while, but there is still an issue the port was still being reset. I would suggest that you use a separate 5v power supply.
EDIT2: Sorry I missed your comments about your current source, 125 mA is nowhere near enough, you need at least 350mA when transmitting, so set your current source to 400mA min.
Dave.
David,
I am running into the exact same issue with the LPC1768 and the CC3000. I need to provide a separate 5V supply to the CC3000 in order to prevent the LPC1768 from continually resetting.
After some research, it seems that the power supply on the LPC1768 module is limited to 460mA (according to the schematic: http://mbed.org/media/uploads/chris/mbed-005.1.pdf). It seems to be working as intended to protect the USB ports on the computer.
To get both to work with a single power supply, you'll probably have to provide some additional circuitry (LDO, switching, etc.) that can power both the LPC1768 (through the Vin pin) and the CC3000.
posted by 09 Dec 2013
Hello Jason Tao,
I'll start with the second question:
@2 can you run hello world which is published on cc3000 cookbook page? I updated 12 days ago all of my repositories, with improved API. Please use the newest version. http://mbed.org/users/Kojto/code/cc3000_hello_world_demo/
@1 Frank published the mbed version of patch programmer (which is currently offline), with modified user info. I think you have not run it on your cc3000 board, thus just ignore those readings. Did you use any patch programmer for cc3000? How can arduino report version 1.24? CAn you direct me to the page with a code. I would like to check it.
Let us know.
Regards,
posted by Martin Kojtal 19 Nov 20130xc0170
Hi Martin, @1 I am trying it right now.
@2 I didn't actually use the patch programmer. The patch programmer for arduino (https://github.com/cmagagna/CC3000Patch) has the functionality to check the existing service pack version. When I check the version, it showed that the version 1.24, and I think it indicates the cc3000 I am using has the newest firmware. Correct me if I am wrong.
Thanks a lot for the help!
Jason
posted by Jason Tao 19 Nov 2013Hi Martin,
I tried to use the newest version but didn't make it work.
"cc3000 Hello World demo.
...
Failed to connect. Please verify connection details and try again. "
Are there some steps missing here? Here is what I did after importing the program (http://mbed.org/users/Kojto/code/cc3000_hello_world_demo/):
1. @main.cpp, line 30, I changed the ssid. Since my network does not have password, I set "" for phrase and set sesecurity to be NONE:
"#elif (MY_BOARD == MBED_BOARD_EXAMPLE)
cc3000 wifi(p9, p10, p8, SPI(p5, p6, p7), "my_network", "", NONE, false);"
2. @main.h, line 24, I set MY_BOARD to be MBED_BOARD_EXAMPLE, since I am using LPC1768:
"#define MY_BOARD MBED_BOARD_EXAMPLE"
3. @NVIC_set_all_priorities.h, I defined LPC176X because I am using LPC1768:
"#define LPC176X"
posted by Jason Tao 19 Nov 2013It seems the program stuck at connect_open(_ssid) in cc3000.m.
When I look into the code, the program did not run "connect_secure(_ssid,_phrase, _sec)" because the phrase is less than 8 characters (my passphrase is empty, i.e., "" ):
"if (strlen((const char *)_phrase) < 8) {
std::printf("password is shorter than 8 digits?\r\n");
if (connect_open(_ssid)) {
break;
}
}"
Then the question comes to that why the connect_open(_ssid) does not work?
posted by Jason Tao 19 Nov 2013Try to expand timeout for connecting. I will test connect_open tonight, will report the outcome here.
posted by Martin Kojtal 19 Nov 2013How are you powering the CC3000, whille transmitting it can require a lot of power, the mbed alone might not be able to power it and you may need an external supply. Or it's an issue with connecting to an open access point, can you try a secured one?
posted by Carl - SolderSplash Labs 19 Nov 2013Hi Martin, I will increase the timeout and try it out.
Hi Carl, I use the current source to power up the cc3000, which should be able to provide the necessary voltage and current. Currently, the voltage supply is 5V and the running current is 125mA.
posted by Jason Tao 19 Nov 2013Hi Carl, I cannot try the secured connection now but will try the secured connection when I get home. Thanks for pointing it out.
posted by Jason Tao 19 Nov 2013I have tested cc3000 on Wi-Go board, unsecured connection. Working.
posted by Martin Kojtal 19 Nov 2013Hi Martin, thank you very much! So since you have tested the unsecured network, it narrows down the problem to hardware setup, firmware for cc3000 and configuring the code. BTW, when you check the patch programmer for arduino, did you notice anything not correct?
I am little bit lost what should be the next step to solve this problem, so here I am just listing the things in my mind now:
As for the hardware setup for spi, I followed:
"cc3000 wifi(p9, p10, p8, SPI(p5, p6, p7)"
where p9 = irq, p10 = bat, p8 = cs, p5 = mosi, p6 = miso, p7 = sck. I think the hardware configuration for spi should be correct, because I can see from the debug line that cc3000 confirms that it receives the cmd with the right opcode.
As for cc3000 firmware, I may give it a shot some time today. Last time I saw the version is 1.24 so I didn't proceed since to a newbie like me it is kinda scary to do it: according to the website (https://github.com/cmagagna/CC3000Patch), there are chances I will make cc3000 a piece of useless metal.
As for configuring the code, am I doing it correct by setting MY_BOARD, defining LPC176X and updating the ssid, passphrase and security? Is there anything else I need to do?
I will post what I get today.
posted by Jason Tao 19 Nov 2013Hi Martin, I just noticed that you tested cc3000 with Wi-Go board. Has anyone successfully setup cc3000 with LPC1768 using unsecured network in your knowledge?
posted by Jason Tao 19 Nov 2013David Fletcher, who helped you previously. I have also external cc3000 and mbed board. I can set it up and run today/tomorrow.
To answer your question , yes, set your board, your cc3000 configuration (cc3000 object) and set your ssid details, that should be all you need to do.
posted by Martin Kojtal 20 Nov 2013Thank you Martin! Due to the course load, I shift my project on cc3000 to tomorrow. I will post on my progress tomorrow.
posted by Jason Tao 20 Nov 2013Hey Jason, have you successfully got it working? It's been a long time but I hope you can post some updates. Thanks!
posted by Jiayuan Chen 31 Mar 2015