Statistics
| Branch: | Tag: | Revision:

mongoose / examples / CC3200 / ccs @ eaef5bd1

Name Size Revision Age Author Comment
  MG_hello eaef5bd1 almost 5 years Alexander Alashkin Revert "Stop publish examples to mongoose repo"...
  MG_sensor_demo eaef5bd1 almost 5 years Alexander Alashkin Revert "Stop publish examples to mongoose repo"...
  Mongoose eaef5bd1 almost 5 years Alexander Alashkin Revert "Stop publish examples to mongoose repo"...
Makefile 74 Bytes eaef5bd1 almost 5 years Alexander Alashkin Revert "Stop publish examples to mongoose repo"...
README.md 4.51 KB eaef5bd1 almost 5 years Alexander Alashkin Revert "Stop publish examples to mongoose repo"...
sensor_demo.png 137 KB eaef5bd1 almost 5 years Alexander Alashkin Revert "Stop publish examples to mongoose repo"...
upload_form.png 30.9 KB eaef5bd1 almost 5 years Alexander Alashkin Revert "Stop publish examples to mongoose repo"...

Latest revisions

# Date Author Comment
eaef5bd1 02/06/2017 02:08 PM Alexander Alashkin

Revert "Stop publish examples to mongoose repo"

This reverts commit 1a17e17c462bdd4e1d26d8742f8b7087273e04c2.

PUBLISHED_FROM=80028de308c9a021955d1425d2bfee8feb85f193

551f393d 02/03/2017 10:17 AM Alexander Alashkin

Remove examples

4bdec5c1 01/09/2017 05:03 PM Dmitry Frank

Rename mongoose-iot to mongoose-os

URLs like mongoose-iot.com are left intact

PUBLISHED_FROM=b8502b163c26a2cb54598db57ba094333fe7cf54

0ceee1dc 11/15/2016 02:36 PM Dmitry Frank

Rename `mg_` -> `miot_` under fw

`MG_ENABLE_...` macros are not yet renamed because it involves some
logic change: e.g. instead of defining `MG_ENABLE_MQTT`, one should
define `MIOT_ENABLE_MQTT`, which should imply `MG_ENABLE_MQTT` as well.

Macro refactoring is going to be done in another PR....

6d8b747f 10/19/2016 12:41 PM Deomid Ryabkov

Add MG_ENABLE_FILESYSTEM to CCS projects

Update compiler version to 5.2.8

PUBLISHED_FROM=5e9cd9571127d980b9d4dbe78f2aefb78a4d90f5

806f07db 09/15/2016 01:36 PM Deomid Ryabkov

Fix MG_hello project build

PUBLISHED_FROM=450e5c045b6515fba0e0614c6d76a58712c72160

2a541175 09/05/2016 03:51 PM Dmitry Frank

Use void arguments list consistently in C code

On my way, fixed a couple of cases where we had `()` in the header, and
non-empty argument list in the source file.

PUBLISHED_FROM=5519526cf84e2bbd425a726fcc112fea1a95cbf1

cc8f1466 07/27/2016 08:36 PM Deomid Ryabkov

Turn on func. sections + dead section elimination

In CCS example projects

PUBLISHED_FROM=b3ab112f74ae475cb93bf06fdb7db811bbb99a59

1a61455e 05/31/2016 02:36 PM Deomid Ryabkov

Magic numbers are magic

PUBLISHED_FROM=cec68bab53fc81b4085b81fba0c52e0c42b09f0f

b04d47c3 04/28/2016 12:51 PM Deomid Ryabkov

Update README for CC3200 examples

PUBLISHED_FROM=53ce21efbb0e769089293b1aa11d2b2f3136161d

View revisions

README


Code Composer Studio example projects

To run them you will need: - CC3200-LAUNCHXL dev board. - CC3200SDK 1.2.0 installed in TI_PRODUCTS_DIR/CC3200SDK_1.2.0 (typically C:\ti\CC3200SDK_1.2.0 on Windows, /home/USER/ti/CC3200SDK_1.2.0 on Linux). - The latest CC3200SDK-SERVICEPACK should also be installed and flashed to the device - Code Composer Studio 6 IDE - Mongoose source code. Either clone the Git repo or download the ZIP archive.

Mongoose - The library project

This project produces Mongoose.lib - a static library meant to be used by other projects. Feel free to use it as a dependency for your own projects or just copy mongoose.c and mongoose.h. Note that by default a lot of features are enabled, including file serving (which we use in our examples). You can trim a lot of fat by turning various build options off. A minimal HTTP serving configuration is about 25 K (compiled for ARM® Cortex®M4 with GCC 4.9 with size optimization on).

MG_hello - A simple demo

MG_hello project is a simple web server that serves files from the SimpleLink file system and allows them to be uploaded. This project depends on the Mongoose library project, make sure you import them both. When importing, ensure the “copy project to workspace” checkbox is unchecked, otherwise file references will be broken.

When built and run on the device, by default, the example will set up a Wi-Fi network called “Mongoose” (no password).

Assuming everything works, you should see the following output in CIO:

main Hello, world! mg_init MG task running mg_init Starting NWP... mg_init NWP started wifi_setup_ap WiFi: AP Mongoose configured

Note: If the demo does not proceed past “Starting NWP…”, please reset the board (possibly related to this and our workaround is not always effective).

And after connecting to Wi-Fi network Mongoose, the following page on http://192.168.4.1/:

Pick a small file (say favicon.ico) and upload. You should get “Ok, favicon.ico - 16958 bytes.” and it will be served back to you (link). If you upload index.html, it will be served instead of the form (but the form will be accessible at /upload).

MGsensordemo - A more elaborate demo project

This demo shows the use of timers and serving a WebSocket data stream to (potentially) multiple subscribers. Data from the on-board temperature sensors and accelerometer is streamed to any clients connected over WebSocket, which allows building of responsive, near-real time dashboards.

The main event handler function in main.c does everything MGhello’s function does, but also handles the websocket connection event - when MG_EV_WEBSOCKET_HANDSHAKE_DONE arrives, it switches the event handler to a different one - dataconn_handler (defined here in data.c). Doing this is not required, but it keeps the code modular and function size manageable.

Data acquisition is performed at regular intervals by a timer. Mongoose timers are not very accurate (remember - everything is executed in single thread), but good enough for this case.The timer is first set in mg_init(), and the MG_EV_TIMER event is handled in the main handler. Mongoose timers must be re-armed manually.

To try this demo from Code Composer Studio IDE, follow the steps above for MGhello. Same as for MGhello, you will only see an upload for initially. Please upload main.js and index.html from the slfs directory and reload the page. You should see something like this:

This short video shows the demo in action.

Also available in: Atom