Today I'll show you how to get Mongoose, the most popular open source web server and networking library running on the NXP LPC4088 QuickStart Board.
Our sample application is an HTTP server, but Mongoose is much more than that - it's also a networking client library, supporting HTTP, MQTT, CoAP, DNS protocols and more. See the product page linked above, check out our GitHub project page.
In our example we will use the LPCXpresso IDE (at the time of writing the latest version is 8.2.2).
Getting Started- Start by downloading Mongoose source code from here or clone the Git repo from GitHub.
- Unpack the archive and navigate to the examples/NXP_LPC4088 directory.
- Download the QuickStart Board version of the LPCOpen SDK from here and unpack the contents of the ZIP archive into the LPCOpen_QSB directory.
- Open LPCXpresso and import the following projects from the LPCOpen_QSB directory into the workspace: lpc_board_ea_devkit_4088, lpc_chip_40xx, webserver. (the SDK ships multiple copies of the LWIP library with its examples, to avoid bundling another copy, Mongoose reuses LWIP from the SDK's web server example).
- Import the Mongoose_LPC4088_QSB_BM project.
If you started with empty workspace, it should now look like this:
Now build and the Mongoose project. Assuming it builds successfully, attach a terminal program to the serial port exposed by the debug probe and run the program on the device.
You should see the following output:
Waiting for DHCP...
DHCP state: 6
Link down
Link up
DHCP state: 1
DHCP state: 8
DHCP state: 10
DHCP bound.
Setting up HTTP server...
Server address: http://192.168.11.115/
Following the link you will see a simple "hello" page and a few lines appear in the terminal, showing which page was requested by the client.
That's basically it. But again, what you have now is much more than a web server - you can run pretty much any of our other examples.
Happy networking!
Comments
Please log in or sign up to comment.