Go Down

Topic: discussion on supporting the TI CC3000 WiFi module (Read 61015 times) previous topic - next topic

magagna

#60
Jul 06, 2013, 07:14 pm Last Edit: Jul 06, 2013, 07:18 pm by magagna Reason: 1

...Am I misunderstanding this argument stuff?...  


No, you're right. Well...I should say I think you're right. In fact, if you look further down on that web page you've linked you'll see that in the second example (step 3) the argument length is 0, as it should be.

As an added bonus, it doesn't matter. I just tried the init code with length=0 for HCI_CMND_SIMPLE_LINK_START and it worked, as did length=0xffff. My guess is the code in the MCU inside the CC3000 sees the "start" opcode and ignores the rest of the packet since there are no sub-options.

As to why the '1' is there in the first place when it clearly should be '0'...well...TI's documentation for the CC3000 is not the best....

[edit - typos]
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Hi there,

I have been following the whole discussion for a while, first of all, magagna, great job on the library !

I want to use this chip for home automation purposes (I have a project working with the Arduino WiFi shield but it's too expensive ...).

So I wondered if it will be possible to run a client on an Arduino + this chip and then transmit HTTP requests to a server also connected to the WiFi network, just like with the official WiFi shield. Anyone has some thoughts on that ?

Thanks
http://www.openhomeautomation.net

magagna

Quote

I have been following the whole discussion for a while, first of all, magagna, great job on the library !


Thanks!

Quote

So I wondered if it will be possible to run a client on an Arduino + this chip and then transmit HTTP requests to a server also connected to the WiFi network, just like with the official WiFi shield. Anyone has some thoughts on that ?


I've never worked with the official shield but in your example it's probably opening a TCP port 80 connection to the IP address of the server and sending some data? You can easily do all of that with the TI module.
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Yes exactly, here is part of the code I use:

Code: [Select]

WiFiClient client;

client.connect(server, 80);
Serial.println("Connected to server");
client.println("GET /central.php?device=sensor1 HTTP/1.0");

// Some code to wait and receive the answer ...

client.stop();


If that's working I will order the official evaluation board then, and try it out with your library.
http://www.openhomeautomation.net

TheCon

Yes, I'm hoping to be able to use the client style send and receive from the wifi shield library as well. I'll mainly be using this chip for http requests.

magagna

@marcoschwartz and @TheCon, this should be no problem.

I haven't tested this, but here's some demo code from TI that opens a connection and sends some data:

Code: [Select]

mySocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

tSocketAddr.sa_family = AF_INET;

tSocketAddr.sa_data[0] = (port & 0xFF00) >> 8;
tSocketAddr.sa_data[1] = (port & 0x00FF);

tSocketAddr.sa_data[2] = 207;  // First octet of destination IP
tSocketAddr.sa_data[3] = 58;   // Second Octet of destination IP
tSocketAddr.sa_data[4] = 147;  // Third Octet of destination IP
tSocketAddr.sa_data[5] = 66;  // Fourth Octet of destination IP

connect(mySocket, &tSocketAddr, sizeof(tSocketAddr));

send(mySocket, cmdBuf, strlen(cmdBuf), 0); // the 4th parameter is 'flags', but not currently supported

closesocket(mySocket);



I will add a working example to the library for the next revision.
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

marco26

@magagna : Thanks for the answer. I now want to buy an evaluation module to test it out, but I don't know which one to buy. I saw this one :

http://www.ti.com/tool/cc3000em

But it is out of stock ... TI also proposes this one:

http://www.ti.com/tool/cc3000boost

Which is in stock, and it seems to have similar features ... which one do you use actually ? Do you think the second one is compatible with the library you wrote ? Thanks.

TheCon

Great! I anxiously await your next update, some http commands would be pretty awesome...

magagna

The CC300Boost should be fine. I'm currently using the CC3000EM but really both boards are just the WiFi module (the CC3000), an antenna, and a couple of capacitors, resistors, and inductors on a small circuit board.

If you get the board please let me know how you like it, how easy it is to wire in to an Arduino, etc. -- I want to port the firmware upgrade and I'm getting tired of switching between my Teensy and my Nano so I need a couple more.

I am also thinking about building some of my own, all the existing CC3000 projects on the web seem to have stalled.
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

pitucorto

Hello,

I bought The CC300Boost. The library seems to work perfectly. I have designed a shield for this module (compatible with arduino One and mega). In the coming days I will try the shield and will show the results.

magagna


Hello,

I bought The CC300Boost. The library seems to work perfectly. I have designed a shield for this module (compatible with arduino One and mega). In the coming days I will try the shield and will show the results.



Thanks!
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

agra_shashank

Hi Magagna,
i was not here for quite some days, last night i got some time to play with CC3000 again. your New library is awesome, i tried it on my UNO......somehow get_mac was still not working but rest of the functions were doing perfect....so i made the following changes and it worked fine:
set interrupt on LOW rather then falling edge: attachInterrupt(WLAN_IRQ_INTNUM, CC3000InterruptHandler, LOW);
and change all the digital read, write and mode settings to direct register values.
for me HCI_EVNT_WLAN_ASYNC_SIMPLE_CONFIG_DONE was also working fine :)
hope this helps to improve the library :)

BTW i am working on porting the code on native AtMega328 Environment too. I am able to do some basic command and response thing, i'll do more as i get time, if any1 working on that let me know :)

magagna


set interrupt on LOW rather then falling edge: attachInterrupt(WLAN_IRQ_INTNUM, CC3000InterruptHandler, LOW);


That is fantastic work! Very cool. I will try it out with my Uno this weekend.
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

marco26

Hey,

I finally received my TI CC3000 boost module and I tried the library with my Teensy 3.0 board. It works in the sense that I can compile the library, upload the sketch and initialize the CC3000 chip. I can also see the wireless networks, and I tried connecting to mine manually. However, I have a few questions/issues:

- When I connect to my network, the option to show the CC3000 configuration (IP, etc) doesn't work anymore, and actually my computer looses its WiFi connection ! Anybody had the same issue ? It's a shared router so I cannot access the router itself.

- Does this board needs an external antena, or is the integrated antenna sufficient ?

- I noticed that I have the firmware 1.7. How can I update to a more recent firmware ?

- I want to use the CC3000 module with my Arduino Uno now, I just need a bunch of resistors to convert the 5V to 3V right ?

Thanks in advance for any answer !

magagna

Quote
When I connect to my network, the option to show the CC3000 configuration (IP, etc) doesn't work anymore, and actually my computer looses its WiFi connection ! Anybody had the same issue ? It's a shared router so I cannot access the router itself.


I haven't seen that one...do you have other devices on your WiFi network, like a smartphone or more than one computer? Do they all work OK? The only reason I could think that your computer looses connection when your CC3000 turns on is they're using the same MAC address....

Quote
Does this board needs an external antena, or is the integrated antenna sufficient ?


So far I have just been using the internal chip antenna, no problems. It seems to be about as capable as my phone (not as good as my laptop, better than my tablet)....

Quote
I noticed that I have the firmware 1.7. How can I update to a more recent firmware ?


We do need to get the firmware upgrade ported to Arduino. So far I haven't touched it because I only have 1 CC3000 board and I don't want to risk turning it into a brick and having nothing, but I am going to either buy or build more boards.

Quote
I want to use the CC3000 module with my Arduino Uno now, I just need a bunch of resistors to convert the 5V to 3V right ?


Correct. You'll need level shifters (2 resistors) for WLAN_EN, WLAN_CS, WLAN_MOSI, and WLAN_SCK, and 1 resistor for the 3.3V pullup for WLAN_IRQ.
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Go Up