Mongoose is the most popular open source (see our GitHub page) embedded networking library. It provides a simple, cross-platform API for plain TCP, UDP, HTTP, MQTT, CoAP and DNS protocols. It can act as both a server and a client.
Today I will show you how to get started with Mongoose on a Tiva TM4C129 LaunchPad board by creating a simple web server.
- Make sure your Code Composer Studio is up to date. This example was created in CCS 6.2.0. CCS for TM4x MCUs can be downloaded from the TI site (here).
- Install the latest TivaWare package. At the time of writing, the latest version is 2.1.3.156 (available for download here).
- Download and unpack Mongoose source code from here or clone the Git repo.
- Import the example project: go to Projects -> Import CCS Project... and select the examples/TM4C129 directory.
- When importing, make sure the "Copy projects into workspace" checkbox is not checked:
- Make sure TivaWare path is correct. The project expects to find TivaWare installed in ${TI_PRODUCTS_DIR}\TivaWare_C_Series-2.1.3.156 (which is, typically, C:\TI\TivaWare_C_Series-2.1.3.156 on Windows). If you have a different version of TivaWare installed, or it is installed in a different location, please adjust the SDK_ROOT variable in the project properties, as shown on the screenshot below:
- Finally, build and run the project.
- Open a serial terminal to the debug port created by the dev board (you can find the name of the port in the device manager) at 115200 baud. Use your favorite terminal program (or PuTTY if you don't have one). You should get the following result:
- Done! You now have a web server on your board.
Have a look at the main.c file. Learn more about Mongoose by reading the documentation.
Comments