Skip to content

Commit d9d19d4

Browse files
authored
Adjust cellular demo folder structure (#12)
* Move demo tasks and config files to project folder * Update the README.md to state that this repository is for community supported demos
1 parent c635b47 commit d9d19d4

35 files changed

Lines changed: 4924 additions & 160 deletions

README.md

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
1-
# FreeRTOS Labs - FreeRTOS Cellular Library Demo
1+
# FreeRTOS Labs - FreeRTOS Cellular Interface Demo
22

33
## Introduction
44

5-
FreeRTOS offers a suite of networking stacks designed for IoT applications. Applications can access communication protocols at different levels - MQTT, HTTP, Secure Sockets, etc. Common connectivity technologies such as Ethernet, Wi-Fi and BLE have been integrated with the networking stacks of FreeRTOS, with [a wide selection of microcontrollers and modules](https://devices.amazonaws.com/search?page=1&sv=freertos) pre-integrated.
6-
7-
The demos in this project demonstrate how to establish mutually authenticated MQTT connections to MQTT brokers, such as AWS IoT Core, by using cellular connectivity. The demos use the [Cellular Library](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Library/raw/main/doc/document/cellular.zip) sub-moduled from an external project. The FreeRTOS Cellular Library exposes the capability of a few popular cellular modems through a uniform API.
5+
FreeRTOS offers a suite of networking stacks designed for IoT applications.
6+
Applications can access communication protocols at different levels - MQTT, HTTP,
7+
Secure Sockets, etc. Common connectivity technologies such as Ethernet, Wi-Fi and
8+
BLE have been integrated with the networking stacks of FreeRTOS, with
9+
[a wide selection of microcontrollers and modules](https://devices.amazonaws.com/search?page=1&sv=freertos)
10+
pre-integrated.
11+
12+
FreeRTOS supported demos for FreeRTOS cellular interface can be found in the [FreeRTOS repository](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS_Cellular_Interface_Windows_Simulator).
13+
This repository contains community supported demos. The demos in this project
14+
demonstrate how to establish mutually authenticated MQTT connections to MQTT brokers,
15+
such as AWS IoT Core, by using cellular connectivity. The demos use the
16+
[FreeRTOS Cellular Interface](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface)
17+
sub-moduled from an external project. The FreeRTOS Cellular Interface exposes the
18+
capability of a few popular cellular modems through a uniform API.
819

920
1. [1nce Zero Touch Provisioning](https://1nce.com/en/help-center/tutorials-documentations/1nce-connectivity-suite/)
1021
1. [SIMCOM SIM7080](https://cn.simcom.com/product/SIM7080G.html)
1122

12-
The MQTT and HTTP libraries of FreeRTOS use an abstract [Transport Interface](https://github.com/FreeRTOS/coreMQTT/blob/main/source/interface/transport_interface.h) to send/receive data in a generic way. The demos in this project offer a [implementation](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Demo/blob/master/source/coreMQTT/using_mbedtls.c) of the Transport Interface on top of the uniform API exposed by the FreeRTOS Cellular Library.
23+
The MQTT and HTTP libraries of FreeRTOS use an abstract [Transport Interface](https://github.com/FreeRTOS/coreMQTT/blob/main/source/interface/transport_interface.h) to send/receive data in a generic way. The demos in this project offer a [implementation](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Demo/blob/master/source/coreMQTT/using_mbedtls.c) of the Transport Interface on top of the uniform API exposed by the FreeRTOS Cellular Interface.
1324

1425
## Hardware Setup
1526

1627
The demos in this project can be run in the [FreeRTOS Windows Simulator](https://freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html). You will need a Windows PC and one of the supported cellular modems to run a demo. A version of Visual Studio, such as the free Community version of [Visual Studios](https://visualstudio.microsoft.com/vs/community/), will be needed for building the demos.
1728

18-
FreeRTOS Windows simulator make use of COM port to communicate with cellular module. Setup you cellular module communication with the following steps.
29+
FreeRTOS Windows simulator make use of COM port to communicate with cellular module. Setup your cellular module communication with the following steps.
1930

2031
1. Connect the cellular module to PC. Most cellular dev kits have USB, in that case, just connect it to PC’s USB port and look for the COM port in Window’s Device Manager. For example, you will see a new COM69 showing up when you connect the modem like below. If your cellular dev kit does not have USB, use a USB adaptor [like these](https://www.amazon.com/Serial-Usb-Adapter/s?k=Serial+To+Usb+Adapter).
2132

@@ -43,14 +54,14 @@ Figure 1. Components and Interfaces</p>
4354

4455
The other components shown as blue boxes and dotted lines are implemented by this project:
4556

46-
* The [Demo Application](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Demo/blob/main/source). It is largely the same as the [coreMQTT demo](https://github.com/FreeRTOS/FreeRTOS/tree/master/FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Mutual_Auth), with added logic to set up cellular as the transport. (The original coreMQTT demo was designed for Wi-Fi on FreeRTOS Windows Simulator.) There is also a demo application that integrates [1nce Zero Touch Provisioning](https://1nce.com/en/help-center/tutorials-documentations/1nce-connectivity-suite/) with the FreeRTOS Cellular Library and coreMQTT for connecting to AWS IoT Core.
57+
* The [Demo Application](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Demo/blob/main/source). It is largely the same as the [coreMQTT demo](https://github.com/FreeRTOS/FreeRTOS/tree/master/FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Mutual_Auth), with added logic to set up cellular as the transport. (The original coreMQTT demo was designed for Wi-Fi on FreeRTOS Windows Simulator.) There is also a demo application that integrates [1nce Zero Touch Provisioning](https://1nce.com/en/help-center/tutorials-documentations/1nce-connectivity-suite/) with the FreeRTOS Cellular Interface and coreMQTT for connecting to AWS IoT Core.
4758
* The [Transport Interface](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Demo/blob/main/source/coreMQTT/using_mbedtls.c) is needed by the MQTT library (sub-moduled from the [coreMQTT](https://github.com/freertos/coreMQTT) project) to send and receive packets.
4859
* The[TLS porting interface](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Demo/blob/main/source/mbedtls/mbedtls_freertos_port.c) is needed by the mbedTLS library to run on FreeRTOS.
49-
* The [Comm Interface](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Demo/blob/main/source/cellular/comm_if_windows.c) is used by the FreeRTOS Cellular Library to communicate with the cellular modems over UART connections.
60+
* The [Comm Interface](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Demo/blob/main/source/cellular/comm_if_windows.c) is used by the FreeRTOS Cellular Interface to communicate with the cellular modems over UART connections.
5061

5162
## Developer References and API Documents
5263

53-
Please refer to [FreeRTOS Cellular Library API document](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Library/raw/main/doc/document/cellular.zip).
64+
Please refer to [FreeRTOS Cellular Interface API document](https://www.freertos.org/Documentation/api-ref/cellular/index.html).
5465

5566

5667
## Download the source code
@@ -90,32 +101,29 @@ There is also a demo for 1nce zero touch provisioning with Quectel BG96 & GSM Mo
90101
./Lab-Project-FreeRTOS-Cellular-Demo
91102
├── lib
92103
│ ├── backoff_algorithm ( submodule : backoffAlgorithm )
93-
│ ├── cellular ( submodule : Lab-Project-FreeRTOS-Cellular-Library )
104+
│ ├── cellular ( submodule : FreeRTOS-Cellular-Interface )
94105
│ ├── coreMQTT ( submodule : coreMQTT )
95106
│ ├── FreeRTOS ( submodule : FreeRTOS-Kernel )
96107
│ └── ThirdParty
97108
│ └── mbedtls ( submodule : mbedtls )
98109
├── projects
99110
│ ├── sim70x0_mqtt_mutual_auth_demo ( demo project for SIMCOM sim7080/sim7090 )
100-
│ └── 1nce_bg96_zero_touch_provisioning_demo ( demo project for 1nce zero touch provisioning with BG96 )
111+
│ │ └── ( project dependent demo tasks and configuration files )
112+
│ ├── 1nce_bg96_zero_touch_provisioning_demo ( demo project for 1nce zero touch provisioning with BG96 )
113+
│ │ └── ( project dependent demo tasks and configuration files )
101114
│ └── 1nce_qgsm_zero_touch_provisioning_demo ( demo project for 1nce zero touch provisioning with Quectel GSM Modules )
102-
└── source
115+
│ │ └── ( project dependent demo tasks and configuration files )
116+
└── source ( common source files to adapt libraries )
103117
├── cellular
104-
│ └── ( code for adapting FreeRTOS Cellular Library with this demo )
118+
│ └── ( code for adapting FreeRTOS Cellular Interface with this demo )
105119
├── coreMQTT
106120
│ └── ( code for adapting coreMQTT with this demo )
107-
├── FreeRTOS
108-
│ └── ( code for adapting FreeRTOS with this demo )
109121
├── mbedtls
110122
│ └── ( code for adapting mbedtls with this demo )
111-
├── main.c
112-
├── cellular_setup.c
113-
├── MutualAuthMQTTExample.c
114-
├── demo_config.h
115-
├── logging_levels.h
116-
├── logging_stack.h
117-
├── 1nce_zero_touch_provisioning.h
118-
└── 1nce_zero_touch_provisioning.c
123+
├── Logging
124+
│ └── ( code for FreeRTOS logging )
125+
└── cellular_setup.c
126+
119127
```
120128

121129

@@ -124,7 +132,9 @@ There is also a demo for 1nce zero touch provisioning with Quectel BG96 & GSM Mo
124132

125133
### **Configure cellular network**
126134

127-
The following parameters in the cellular configuration, [cellular_config.h](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Demo/tree/main/source/cellular), (located in "source/cellular/<cellular_module>/cellular_config.h”) must be modified for your network environment.
135+
The following parameters in the cellular configuration,
136+
[cellular_config.h](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Demo/tree/main/source/cellular),
137+
(located in <b>"projects/\<project_name\>/cellular_config.h”</b>) must be modified for your network environment.
128138

129139
| Configuration | Description | Value |
130140
|-----------------|-----------------------|--------|
@@ -137,15 +147,16 @@ The following parameters in the cellular configuration, [cellular_config.h](http
137147

138148
### **Configure MQTT broker**
139149

140-
The configuration for connecting to a MQTT broker can be found in [source/demo_config.h](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Demo/blob/main/source/demo_config.h)”. Refer to the [documentation](https://www.freertos.org/mqtt/mutual-authentication-mqtt-example.html#configuration) for more information about the settings.
150+
The configuration for connecting to a MQTT broker can be found in <b>"projects/\<project_name\>/demo_config.h"</b> for more information about the settings.
141151

142152
### Configure COM port settings
143153

144154
Reference the cellular module documentation for COM port settings. Update the [comm_if_windows.c](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Demo/blob/main/source/cellular/comm_if_windows.c) if necessary.
145155

146156
### **Configure other sub-modules**
147157

148-
[“source/FreeRTOS/FreeRTOSConfig.h](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Demo/blob/main/source/FreeRTOS/FreeRTOSConfig.h)”, “[source/mbedtls/mbedtls_config.h](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Demo/blob/master/source/mbedtls/mbedtls_config.h)” and “[source/coreMQTT/core_mqtt_config.h](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-Cellular-Demo/blob/main/source/coreMQTT/core_mqtt_config.h)” are configurations for the corresponding sub-modules.
158+
<b>"projects/\<project_name\>/FreeRTOSConfig.h"</b>, <b>"projects/\<project_name\>/mbedtls_config.h"</b> and <b>"projects/\<project_name\>/core_mqtt_config.h"</b>,
159+
are configurations for the corresponding sub-modules.
149160

150161
## Demo Execution Step flow
151162

source/1nce_zero_touch_provisioning.c renamed to projects/1nce_bg96_zero_touch_provisioning_demo/1nce_zero_touch_provisioning.c

File renamed without changes.

source/1nce_zero_touch_provisioning.h renamed to projects/1nce_bg96_zero_touch_provisioning_demo/1nce_zero_touch_provisioning.h

File renamed without changes.

source/MutualAuthMQTTExample.c renamed to projects/1nce_bg96_zero_touch_provisioning_demo/DemoTasks/MutualAuthMQTTExample.c

File renamed without changes.

source/FreeRTOS/FreeRTOSConfig.h renamed to projects/1nce_bg96_zero_touch_provisioning_demo/FreeRTOSConfig.h

File renamed without changes.

projects/1nce_bg96_zero_touch_provisioning_demo/WIN32.vcxproj

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,19 @@
146146
<ClInclude Include="..\..\lib\ThirdParty\mbedtls\library\psa_crypto_storage.h" />
147147
<ClInclude Include="..\..\lib\ThirdParty\mbedtls\library\ssl_invasive.h" />
148148
<ClInclude Include="..\..\lib\ThirdParty\mbedtls\library\ssl_tls13_keys.h" />
149-
<ClInclude Include="..\..\source\1nce_zero_touch_provisioning.h" />
150-
<ClInclude Include="..\..\source\cellular\bg96\cellular_config.h" />
151149
<ClInclude Include="..\..\source\cellular\cellular_platform.h" />
152-
<ClInclude Include="..\..\source\coreMQTT\core_mqtt_config.h" />
153150
<ClInclude Include="..\..\source\coreMQTT\sockets_wrapper.h" />
154151
<ClInclude Include="..\..\source\coreMQTT\using_mbedtls.h" />
155-
<ClInclude Include="..\..\source\demo_config.h" />
156-
<ClInclude Include="..\..\source\FreeRTOS\FreeRTOSConfig.h" />
157-
<ClInclude Include="..\..\source\logging_levels.h" />
158-
<ClInclude Include="..\..\source\logging_stack.h" />
159-
<ClInclude Include="..\..\source\mbedtls\mbedtls_config.h" />
152+
<ClInclude Include="..\..\source\logging\logging_levels.h" />
153+
<ClInclude Include="..\..\source\logging\logging_stack.h" />
160154
<ClInclude Include="..\..\source\mbedtls\mbedtls_error.h" />
161155
<ClInclude Include="..\..\source\mbedtls\threading_alt.h" />
156+
<ClInclude Include="1nce_zero_touch_provisioning.h" />
157+
<ClInclude Include="cellular_config.h" />
158+
<ClInclude Include="core_mqtt_config.h" />
159+
<ClInclude Include="demo_config.h" />
160+
<ClInclude Include="FreeRTOSConfig.h" />
161+
<ClInclude Include="mbedtls_config.h" />
162162
</ItemGroup>
163163
<ItemGroup>
164164
<ClCompile Include="..\..\lib\backoff_algorithm\source\backoff_algorithm.c" />
@@ -280,16 +280,16 @@
280280
<ClCompile Include="..\..\lib\ThirdParty\mbedtls\library\x509_crt.c" />
281281
<ClCompile Include="..\..\lib\ThirdParty\mbedtls\library\x509_csr.c" />
282282
<ClCompile Include="..\..\lib\ThirdParty\mbedtls\library\xtea.c" />
283-
<ClCompile Include="..\..\source\1nce_zero_touch_provisioning.c" />
284283
<ClCompile Include="..\..\source\cellular\cellular_platform.c" />
285284
<ClCompile Include="..\..\source\cellular\comm_if_windows.c" />
286285
<ClCompile Include="..\..\source\cellular_setup.c" />
287286
<ClCompile Include="..\..\source\coreMQTT\sockets_wrapper.c" />
288287
<ClCompile Include="..\..\source\coreMQTT\using_mbedtls.c" />
289-
<ClCompile Include="..\..\source\main.c" />
290288
<ClCompile Include="..\..\source\mbedtls\mbedtls_error.c" />
291289
<ClCompile Include="..\..\source\mbedtls\mbedtls_freertos_port.c" />
292-
<ClCompile Include="..\..\source\MutualAuthMQTTExample.c" />
290+
<ClCompile Include="1nce_zero_touch_provisioning.c" />
291+
<ClCompile Include="DemoTasks\MutualAuthMQTTExample.c" />
292+
<ClCompile Include="main.c" />
293293
</ItemGroup>
294294
<PropertyGroup Label="Globals">
295295
<ProjectGuid>{C686325E-3261-42F7-AEB1-DDE5280E1CEB}</ProjectGuid>
@@ -339,7 +339,7 @@
339339
</Midl>
340340
<ClCompile>
341341
<Optimization>Disabled</Optimization>
342-
<AdditionalIncludeDirectories>.\..\..\lib\cellular\source\include;.\..\..\lib\cellular\source\interface;.\..\..\lib\cellular\source\include\common;.\..\..\lib\cellular\source\include\private;.\..\..\lib\FreeRTOS\portable\MSVC-MingW;.\..\..\lib\FreeRTOS\include;.\..\..\lib\coreMQTT\source\portable;.\..\..\lib\coreMQTT\source\include;.\..\..\lib\coreMQTT\source\interface;.\..\..\lib\ThirdParty\mbedtls\include;.\..\..\lib\backoff_algorithm\source\include;.\..\..\source;.\..\..\source\coreMQTT;.\..\..\source\FreeRTOS;.\..\..\source\mbedtls;.\..\..\source\cellular;.\..\..\source\cellular\bg96;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
342+
<AdditionalIncludeDirectories>.\..\..\lib\cellular\source\include;.\..\..\lib\cellular\source\interface;.\..\..\lib\cellular\source\include\common;.\..\..\lib\cellular\source\include\private;.\..\..\lib\FreeRTOS\portable\MSVC-MingW;.\..\..\lib\FreeRTOS\include;.\..\..\lib\coreMQTT\source\portable;.\..\..\lib\coreMQTT\source\include;.\..\..\lib\coreMQTT\source\interface;.\..\..\lib\ThirdParty\mbedtls\include;.\..\..\lib\backoff_algorithm\source\include;.\..\..\source;.\..\..\source\coreMQTT;.\..\..\source\mbedtls;.\..\..\source\cellular;.\..\..\source\logging;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
343343
<PreprocessorDefinitions>USE_1NCE_ZERO_TOUCH_PROVISIONING;MBEDTLS_CONFIG_FILE="mbedtls_config.h";WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
344344
<MinimalRebuild>false</MinimalRebuild>
345345
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

0 commit comments

Comments
 (0)