TCP/IP stack for wifi module

atmegamicrocontrollertcp/ipwifi

I keep reading about TCP/IP stack for wifi module. I am having bit difficulty to understand that.

I am working on hobby project in IoT and need to choose wifi module for Atmega328P. I heard about CC3000 module which is very costly. So I thought I should buy raw wifi chip and use that with Atmega328P and use MQTT to communicate with it. This is just a theory. But this stack thing came in between and I don't know what it is?

What is TCP/IP stack for wifi module? I am new to this area. So, it would be great if you can elaborate the answer.

Best Answer

First and foremost: Do not use the CC3000 module. I tried it, and failed miserably after many hours of work involved. The driver which comes with the module is unusable. You might want to browse the related TI forum and read through all the various people having problems, especially with hanging communication. Go for one of the successors (CC31xx/CC32xx) instead.

Regarding the TCP/IP stack. Look at the OSI model. It defines several layers, starting from the physical layer (which is how bits are transferred over a connection) up to the application layer (which is what the data actually means). Each layer builds upon each other. Now, various parts will abstract the complexities of each layer up to a certain layer. If you simply have a PHY chip, you will need to implement all Layers starting from layer 2 (the data link layer). You will probably run into timing issues. This can be resolved by using a controller which already implements Layer 1 + 2 + 3, or even up to layer 4. This is basically what many microcontrollers use. You will be able to prepare a TCP or UDP packet in software, then pass all the rest of the work to the module. Far less work for you.

If you really want to go with "raw data" (still, you will be praparing data for one layer or the other) I would account for (far) increased development time. There are also several TCP/IP stacks available (both for free and commercially available) but you will still need time to implement this into your remaining application.