Go Down

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

TheCon

#75
Jul 17, 2013, 06:29 am Last Edit: Jul 17, 2013, 06:35 am by TheCon Reason: 1

@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.


Any luck in getting this working? I have been trying to do a ping test, but I cannot figure out how to read back the data holding the ping results...

Specifially, the functions I have been calling are netapp_ping_send() and netapp_ping_report().

marco26

Alright, I tried the library with my Arduino UNO board, using level shifters. I can initialize the module successfully, so I guess my wiring is right. However, when playing with the different settings in the serial monitor the sketch randomly freezes and then I have to reset the Arduino board. I guess one problem is in the netapp_ipconfig() function which freezes the whole sketch.

Magagna, do you know something about this issue ? Maybe it is related to some issue that someone posted recently with the Arduino Uno ? I am talking about a recent post from agra_shashank:

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


KwameOA

@marco26 I'm also having a similar issue. The library and sample code seem to compile fine, but when I try to initialize it freezes up. I traced the problem, using good old debugging print statements, to the hci_event_handler() function. For some reason it just stays in the while loop. Unfortunately for me, coding isn't really my strong suit, but you could take a look and see if there's anything that needs tweaking in there.

westfw

Hardware-wise, it looks like Adafruit has been active; they claim to be making announcements later tonight.

http://www.adafruit.com/blog/2013/07/19/ask-an-engineer-10pm-saturday-night-10pm-et-first-look-at-our-txinstruments-cc3000-breakout-shield-for-arduino-and-arduino-compatible-code-name-wifi-duino-internet-of/

GBdavef


@marco26 I'm also having a similar issue. The library and sample code seem to compile fine, but when I try to initialize it freezes up. I traced the problem, using good old debugging print statements, to the hci_event_handler() function. For some reason it just stays in the while loop. Unfortunately for me, coding isn't really my strong suit, but you could take a look and see if there's anything that needs tweaking in there.
I had this problem using a Arduino Due, I fixed it using the soft SPI option, perhaps you can try this.

marco26

Anybody else watched Ask An Engineer last night ? They speak indeed about the release of breakout boards for the CC3000, but even more important they mentioned that they've been working on the software for months ! I am really looking forward for the release of their products & the software. The link:

https://www.youtube.com/watch?v=pzeUvcxrIEw

KwameOA

@GBdavef Thanks for the suggestion. Unfortunately it didn't work. I also just tried Magagna's first Arduino test file for the CC3000 and that sort of worked. There was an error in receiving the second packet, but at least it gives me some comfort knowing that I've wired it up properly and it's capable of some kind of communication with the UNO. I guess I'll just have to wait and see what adafruit comes out with. Hopefully it'll be soon.

magagna

#82
Jul 23, 2013, 08:16 am Last Edit: Jul 23, 2013, 08:18 am by magagna Reason: 1
Hi all,

Apologies for the absence. I'm leaving this Sunday for a 2 week family reunion / vacation and am trying to get ahead at work.

I've received all the parts to build some more CC3000 boards (based on this: https://github.com/cmagagna/CC3000-Breakout-Board) and am waiting for boards from Osh Park. I'm hoping I get them before I leave so I can work on the firmware upgrade code  during my downtime.

My guess is most of the issues everyone is seeing is due to older firmware. The current version is 1.19; the sample Arduino app has code to get yours, or you can do it yourself with nvmem_read_sp_version().

I haven't had a chance to watch the YouTube video but am excited to see it will be professionally supported; I've used many AdaFruit products and have found them to be high quality. I will continue development of my code at least until their products are officially released; after that...we'll see....
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

agra_shashank


@marco26 I'm also having a similar issue. The library and sample code seem to compile fine, but when I try to initialize it freezes up. I traced the problem, using good old debugging print statements, to the hci_event_handler() function. For some reason it just stays in the while loop.


Sorry that i am not very regular here, but it looks great that there are others interested in this CC3000 stuff.
i was facing the same problem initially, if u'll comment out the get_mac function everything works well. I finally changed the interrupt style as i mentioned earlier and everything worked for me. I feel firmware update is not the solution for this b'coz i had the same problem with older version and the latest one too. Hope this works :)

KwameOA

Quote
if u'll comment out the get_mac function everything works well.


Thanks agra_shashank. I don't think that's the problem though. It only prints out "Initializing CC3000..." and then freezes up. So it never even reaches "nvemem_get_mac_address". I'll keep working and see if I can figure this thing out. Hopefully I can make a breakthrough soon enough.

KwameOA

Good news: I finally have my board being able to initialize and run a few of the commands. Bad news: it runs for a while and then just freezes up until I reboot the board. At least it's some progress. I'll update if anything changes.

magagna


Good news: I finally have my board being able to initialize and run a few of the commands. Bad news: it runs for a while and then just freezes up until I reboot the board. At least it's some progress. I'll update if anything changes.


How are you powering the CC3000?
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

KwameOA


How are you powering the CC3000?



Initially I was using a voltage regulator which cut down the 5V from the Uno board, but I believe the current  draw was way more than it could handle. So I am currenntly powering it using the VCC pin of the launchpad. I put in an order for some LD1117V33s, so I'll try those with the 5V source as well and give an update.

Eventually I would like to use the CC3000 with an Atmega328 that has been breadboarded. I tried it today, after I figured that the CC3000 was getting enough current, and it worked once and then went back to freezing right after "Initializing CC3000..." Have you tried using the CC3000 with other peripherals on connected to the Uno? Especially one connected via SPI?

TheCon

How is your MOSI, MISO, and SCK lines routed? I have discovered that the CC3000 is very picky about having a clean clock signal. If you have other devices on the SPI bus that could potentially be adding reflection to the bus, you should try using some termination resistors on the SCK line. You can either do a series termination at the source if you have nice SCK routing with no t's, or do end termination with a voltage divider (I believe 330 ohm pullup to vcc and 220 pulldown to GND).

KwameOA


How is your MOSI, MISO, and SCK lines routed? I have discovered that the CC3000 is very picky about having a clean clock signal. If you have other devices on the SPI bus that could potentially be adding reflection to the bus, you should try using some termination resistors on the SCK line. You can either do a series termination at the source if you have nice SCK routing with no t's, or do end termination with a voltage divider (I believe 330 ohm pullup to vcc and 220 pulldown to GND).


I actually don't have any kind of termination for my lines. I figured that having other peripherals on the SPI might be the issue but I didn't have much of an idea how to solve that problem. I'll have to do a bit more reading up on the terminations, give your suggestions a try and see how they work out. Thanks for pointing this out.

Go Up