Giter VIP home page Giter VIP logo

rtosexploration / coremqtt-agent-demos Goto Github PK

View Code? Open in Web Editor NEW

This project forked from freertos/coremqtt-agent-demos

0.0 0.0 0.0 888 KB

Demonstrates use of coreMQTT-Agent for simple MQTT connection sharing among different threads of execution.

Home Page: https://freertos.org/mqtt/mqtt-agent-demo.html

License: MIT License

JavaScript 1.29% Python 1.56% C 95.12% Makefile 1.40% HTML 0.56% Batchfile 0.06%

coremqtt-agent-demos's Introduction

coreMQTT Agent and Demo Tasks (including OTA)

This repository demonstrates examples of using AWS IoT Device Shadow, Device Defender, and OTA from multiple threads. It uses FreeRTOS and the coreMQTT Agent library, an extension on top of coreMQTT that provides MQTT APIs with thread safety. The examples here share a single MQTT connection amongst multiple concurrent tasks, without requiring the management of any synchronization primitives from the application.

Cloning this repository

This repo uses Git Submodules to bring in dependent components.

Note: If you download the ZIP file provided by the GitHub UI, you will not get the contents of the submodules. (The ZIP file is also not a valid git repository)

To clone using HTTPS:

git clone https://github.com/FreeRTOS/coreMQTT-Agent-Demos.git --recurse-submodules

Using SSH:

git clone [email protected]:FreeRTOS/coreMQTT-Agent-Demos.git --recurse-submodules

If you have downloaded the repo without using the --recurse-submodules argument, you need to run:

git submodule update --init --recursive

Getting started

The documentation page for this repository contains information on the MQTT agent and the contained demo project. There is also a supplemental documentation page that describes how to run an Over-the-Air (OTA) update agent as one of the RTOS tasks that share the same MQTT connection.

Building Demos

This repository contains both a Visual Studio project that uses the FreeRTOS Windows port and can be built using the free Community version of Visual Studio, and a GCC/makefile project that build the FreeRTOS ARM Cortex-M3 port and targets the QEMU hardware emulator. The makefile can be built from the command line or the provided Eclipse project, and works on both Windows and Linux hosts.

Visual Studio

  1. Ensure to follow the instructions on the above linked demo documentation page to configure the build as required to access your network.

  2. From the Visual Studio IDE, open the mqtt_multitask_demo.sln Visual Studio solution file in the build/VisualStudio/ directory.

  3. Select Build Solution from the IDE's Build menu.

QEMU Cortex-M3

Command Line

  1. Ensure that arm-none-eabi-gcc from the GNU ARM Embedded Toolchain and GNU make are in your path.

  2. From the build/Cortex-M3_MPS2_QEMU_GCC directory, run make.

Eclipse IDE

  1. Ensure that arm-none-eabi-gcc from the GNU ARM Embedded Toolchain and GNU make are in your path.

  2. Open the build/Cortex-M3_MPS2_QEMU_GCC directory as an Eclipse project.

  3. Select Project -> Build Project from the Eclipse menu.

In both cases, the generated executable can be found at build/Cortex-M3_MPS2_QEMU_GCC/output/RTOSDemo.elf.

Running the Makefile build in QEMU

Use the QEMU command contained in the start_qemu.bat batch file to run the generated RTOSDemo.elf file directly. Alternatively, use the command contained in the start_qemu_and_wait.bat batch file to start QEMU and wait for a GDB connection on port 1234. The Eclipse project contains a configuration suitable for debugging.

Note that these QEMU commands assume there is a network tap driver called "TAP0".

Obtaining network access from QEMU on Windows

  1. Install the OpenVPN TAP driver for Windows.

  2. Name the installed TAP interface "TAP0". This can be done by selecting "Change adapter settings" from Windows' Network Properties window (Control Panel\Network and Internet\Network Connections) to view all network adapters, selecting the installed TAP adapter, and then pressing F2 to edit the adapter's name.

  3. From the same window, configure a real wired network interface to have a static IP address that is within the range of IP addresses allocated by your local DHCP server.

  4. Still in the same window, select both the real network adapter and the TAP adapter at the same, then right click, and select "Bridge Connections" from the pop up menu.

Getting help

You can use your Github login to get support from both the FreeRTOS community and directly from the primary FreeRTOS developers on our active support forum. You can also find a list of frequently asked questions here.

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT License. See the LICENSE file.

coremqtt-agent-demos's People

Contributors

richardbarry avatar muneebahmed10 avatar ravibhagavandas avatar leegeth avatar archigup avatar aniruddhakanhere avatar aggarw13 avatar paulbartell avatar gkwicker avatar cobusve avatar divekarshubham avatar amazon-auto avatar keith-packard avatar gshvang avatar jasonpcarroll avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.