Skip to content

Commit 1ceb7b9

Browse files
committed
Update ESP-IDF examples
1 parent ff997d3 commit 1ceb7b9

File tree

73 files changed

+1484
-838
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1484
-838
lines changed

examples/espidf-arduino-blink/platformio.ini

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,21 @@
77
; Please visit documentation for the other options and examples
88
; http://docs.platformio.org/page/projectconf.html
99

10-
[env:esp32dev]
10+
[env]
1111
platform = espressif32
1212
framework = arduino, espidf
13-
board = esp32dev
1413
build_flags =
1514
-D CONFIG_BLINK_GPIO=2
1615
monitor_speed = 115200
1716
platform_packages =
1817
; use a special branch
1918
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#idf-release/v4.0
2019

20+
[env:esp32dev]
21+
board = esp32dev
22+
2123
[env:espea32]
22-
platform = espressif32
23-
framework = arduino, espidf
2424
board = espea32
25-
build_flags =
26-
-D CONFIG_BLINK_GPIO=2
27-
monitor_speed = 115200
28-
platform_packages =
29-
; use a special branch
30-
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#idf-release/v4.0
3125

3226
[env:esp320]
33-
platform = espressif32
34-
framework = arduino, espidf
3527
board = esp320
36-
build_flags =
37-
-D CONFIG_BLINK_GPIO=2
38-
monitor_speed = 115200
39-
platform_packages =
40-
; use a special branch
41-
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#idf-release/v4.0

examples/espidf-arduino-wifiscan/platformio.ini

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,16 @@
77
; Please visit documentation for the other options and examples
88
; http://docs.platformio.org/page/projectconf.html
99

10-
[env:esp32dev]
10+
[env]
1111
platform = espressif32
1212
framework = arduino, espidf
13-
board = esp32dev
14-
build_flags = -DCONFIG_WIFI_SSID=\"ESP_AP\" -DCONFIG_WIFI_PASSWORD=\"MYPASS\"
1513
monitor_speed = 115200
1614
platform_packages =
1715
; use a special branch
1816
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#idf-release/v4.0
1917

18+
[env:esp32dev]
19+
board = esp32dev
20+
2021
[env:esp-wrover-kit]
21-
platform = espressif32
22-
framework = arduino
2322
board = esp-wrover-kit
24-
build_flags = -DCONFIG_WIFI_SSID=\"ESP_AP\" -DCONFIG_WIFI_PASSWORD=\"MYPASS\"
25-
monitor_speed = 115200
26-
platform_packages =
27-
; use a special branch
28-
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#idf-release/v4.0

examples/espidf-arduino-wifiscan/sdkconfig.defaults

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ CONFIG_ARDUHAL_PARTITION_SCHEME="default"
1515
CONFIG_AUTOCONNECT_WIFI=y
1616
CONFIG_ARDUINO_SELECTIVE_WiFi=y
1717
CONFIG_MBEDTLS_PSK_MODES=y
18-
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y
18+
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y
19+
# Example configs
20+
CONFIG_EXAMPLE_WIFI_SSID="MYSSID"
21+
CONFIG_EXAMPLE_WIFI_PASSWORD="MYPASS"

examples/espidf-aws-iot/components/esp-aws-iot/.gitlab-ci.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ variables:
55
BATCH_BUILD: "1"
66
V: "0"
77
MAKEFLAGS: "-j5 --no-keep-going"
8-
IDF_PATH: "$CI_PROJECT_DIR/idf/esp-idf"
8+
IDF_PATH: "$CI_PROJECT_DIR/esp-idf"
99

1010
build_demo:
1111
stage: build
@@ -23,12 +23,11 @@ build_demo:
2323
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
2424
- git --version
2525
- git submodule update --init --recursive
26-
- mkdir idf
27-
- cd idf
28-
- git clone --depth 1 $GITLAB_SSH_SERVER/idf/esp-idf.git
29-
- pushd esp-idf
30-
- ./tools/ci/mirror-submodule-update.sh
31-
- popd
26+
- git clone --recursive --depth 1 $GITLAB_SSH_SERVER/idf/esp-idf.git
27+
- export PATH="$IDF_PATH/tools:$PATH"
28+
- cd esp-idf
29+
- ./install.sh
30+
- . export.sh
3231
- cd ..
3332
- cd examples/thing_shadow
3433
- cat sdkconfig.ci >> sdkconfig.defaults

examples/espidf-aws-iot/components/esp-aws-iot/aws-iot-device-sdk-embedded-C/.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Ignore executables
2+
*.o
3+
IotSdkC_tests
4+
samples/linux/jobs_sample/jobs_sample
5+
samples/linux/shadow_sample/shadow_sample
6+
samples/linux/shadow_sample_console_echo/shadow_console_echo
7+
samples/linux/subscribe_publish_library_sample/libAwsIotSdk.a
8+
samples/linux/subscribe_publish_library_sample/subscribe_publish_library_sample
9+
samples/linux/subscribe_publish_sample/subscribe_publish_sample
10+
tests/integration/integration_tests_mbedtls
11+
tests/integration/integration_tests_mbedtls_mt
12+
13+
# Ignore test artifacts
14+
objs/*
15+
testLibs/*
16+
17+
# Ignore CppUTest and mbed TLS
18+
external_libs/CppUTest/*
19+
external_libs/mbedTLS/*
20+
21+
# Ignore credentials
22+
certs/*
Lines changed: 26 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,44 @@
11
language: c
22

3-
# Get Coverity certificate.
4-
before_install:
5-
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
6-
7-
# Coverity configuration.
8-
addons:
9-
coverity_scan:
10-
project:
11-
name: "aws-iot-device-sdk-embedded-C"
12-
description: "SDK for connecting to AWS IoT from a device using embedded C. "
13-
notification_email: [email protected]
14-
build_command_prepend: "cd tests/integration"
15-
build_command: "make app"
16-
branch_pattern: master
17-
183
install:
194
# Remove placeholders.
205
- rm external_libs/CppUTest/*
21-
- rm -rf external_libs/mbedTLS
6+
- rm external_libs/mbedTLS/*
227

238
# Get mbedtls.
24-
- git clone https://github.com/ARMmbed/mbedtls.git external_libs/mbedTLS
9+
- wget -qO- https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.16.5.tar.gz | tar xvz -C external_libs/mbedTLS --strip-components=1
2510

2611
# Get CppUTest.
2712
- wget -qO- https://github.com/cpputest/cpputest/archive/v3.6.tar.gz | tar xvz -C external_libs/CppUTest --strip-components=1
2813

2914
script:
3015
# Verify that the samples build.
3116
- cd samples/linux/jobs_sample
32-
- make
17+
- make -j2
3318
- cd ../shadow_sample
34-
- make
19+
- make -j2
3520
- cd ../shadow_sample_console_echo
36-
- make
21+
- make -j2
3722
- cd ../subscribe_publish_library_sample
38-
- make
23+
- make -j2
3924
- cd ../subscribe_publish_sample
40-
- make
41-
42-
# Set the AWS IoT endpoint.
43-
- cd ../../../tests/integration
44-
- sed -i 's/^.*#define AWS_IOT_MQTT_HOST.*$/#define AWS_IOT_MQTT_HOST "'"$INTEGRATION_TEST_ENDPOINT"'"/' include/aws_iot_config.h
45-
46-
# Build the integration tests.
47-
- make app
48-
49-
# Build the unit tests.
50-
- cd ../../
51-
- make build-cpputest
52-
- make all_no_tests
53-
54-
# Execute unit tests.
55-
- ./IotSdkC_tests
56-
57-
# Import credentials.
58-
- echo -e $INTEGRATION_TEST_CLIENT_CERT > certs/cert.pem
59-
- echo -e $INTEGRATION_TEST_ROOT_CA > certs/rootCA.crt
60-
- echo -e $INTEGRATION_TEST_PRIVATE_KEY > certs/privkey.pem
61-
62-
# Execute integration tests.
63-
- cd tests/integration
64-
- ./integration_tests_mbedtls
65-
- ./integration_tests_mbedtls_mt
66-
25+
- make -j2
26+
27+
# Build and run unit tests.
28+
- cd ../../../
29+
- make build-cpputest -j2
30+
- make all_no_tests -j2
31+
- ./IotSdkC_tests -v
32+
33+
# Set up integration tests if not a pull request.
34+
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cd tests/integration; fi
35+
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sed -i 's/^.*#define AWS_IOT_MQTT_HOST.*$/#define AWS_IOT_MQTT_HOST "'"$AWS_IOT_ENDPOINT"'"/' include/aws_iot_config.h; fi
36+
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then make app -j2; fi
37+
38+
# Import credentials for integration tests.
39+
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then wget https://www.amazontrust.com/repository/AmazonRootCA1.pem -O ../../certs/rootCA.crt; fi
40+
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then echo -e $AWS_IOT_CLIENT_CERT > ../../certs/cert.pem; fi
41+
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then echo -e $AWS_IOT_PRIVATE_KEY > ../../certs/privkey.pem; fi
42+
43+
# Run integration tests.
44+
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then ./integration_tests_mbedtls; fi

examples/espidf-aws-iot/components/esp-aws-iot/aws-iot-device-sdk-embedded-C/CHANGELOG.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44

55
Bugfixes:
66

7-
- [#167], [#168] Fixed issues reported by Coverity Scan.
8-
- [#177] Fixes a memory corruption bug and handling of timeouts.
7+
- [#167](https://github.com/aws/aws-iot-device-sdk-embedded-C/pull/167), [#168](https://github.com/aws/aws-iot-device-sdk-embedded-C/pull/168) Fixed issues reported by Coverity Scan.
8+
- [#177](https://github.com/aws/aws-iot-device-sdk-embedded-C/pull/177) Fixes a memory corruption bug and handling of timeouts.
99

1010
Other:
1111

1212
- Add .travis.yml for Travis CI.
1313
- Removed C++ sample.
1414
- Removed includes of `inttypes.h`, which doesn't exist on some systems.
15-
- [#175] Added comments on static allocation of MQTT topics.
15+
- [#175](https://github.com/aws/aws-iot-device-sdk-embedded-C/pull/175) Added comments on static allocation of MQTT topics.
1616

1717
## [3.0.0](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v3.0.0) (Apr 17, 2018)
1818

1919
Bugfixes:
2020

21-
- [#152] Fixes potential buffer overflows in `parseStringValue` by requiring a size parameter in `jsonStruct_t`.
22-
- [#155] Fixes other memory corruption bugs; also improves stability.
21+
- [#152](https://github.com/aws/aws-iot-device-sdk-embedded-C/pull/152) Fixes potential buffer overflows in `parseStringValue` by requiring a size parameter in `jsonStruct_t`.
22+
- [#155](https://github.com/aws/aws-iot-device-sdk-embedded-C/pull/155) Fixes other memory corruption bugs; also improves stability.
2323

2424
The two bug fixes above are not backwards compatible with v2.3.0. Please see [README.md](README.md#migrating-from-2x-to-3x) for details on migrating to v3.0.0.
2525

@@ -50,7 +50,7 @@ Pull requests:
5050
## [2.2.0](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v2.2.0) (Nov 22, 2017)
5151

5252
New Features:
53-
53+
5454
- Added SDK metrics string into connect packet
5555

5656
Bugfixes:
@@ -79,7 +79,7 @@ Improvements:
7979
- Change default keepalive interval to 600 seconds
8080

8181
Pull requests:
82-
82+
8383
- [#29](https://github.com/aws/aws-iot-device-sdk-embedded-C/pull/29) - three small fixes
8484
- [#59](https://github.com/aws/aws-iot-device-sdk-embedded-C/pull/59) - Fixed MQTT header constructing and parsing
8585
- [#88](https://github.com/aws/aws-iot-device-sdk-embedded-C/pull/88) - Fix username and password are confused
@@ -92,14 +92,14 @@ Pull requests:
9292
Bugfixes/Improvements:
9393

9494
- Network layer interface improvements to address reported issues
95-
- Incorporated GitHub pull request [#41](https://github.com/aws/aws-iot-device-sdk-embedded-c/pull/41)
95+
- Incorporated GitHub pull request [#41](https://github.com/aws/aws-iot-device-sdk-embedded-c/pull/41)
9696
- Bugfixes for issues [#36](https://github.com/aws/aws-iot-device-sdk-embedded-C/issues/36) and [#33](https://github.com/aws/aws-iot-device-sdk-embedded-C/issues/33)
9797

9898
## [2.1.0](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v2.1.0) (Jun 15, 2016)
9999

100100
New features:
101101

102-
- Added unit tests, further details can be found in the testing readme [here](https://github.com/aws/aws-iot-device-sdk-embedded-c/blob/master/tests/README.md)
102+
- Added unit tests, further details can be found in the testing readme [here](https://github.com/aws/aws-iot-device-sdk-embedded-c/blob/master/tests/README.md/)
103103
- Added sample to demonstrate building the SDK as library
104104
- Added sample to demonstrate building the SDK in C++
105105

@@ -109,7 +109,7 @@ Bugfixes/Improvements:
109109
- Increased default value of MQTT Command Timeout in Shadow Connect to 20 secs
110110
- Shadow null/length checks
111111
- Client Id Length not passed correctly in shadow connect
112-
- Add extern C to headers and source files, added sample to demonstrate usage with C++
112+
- Add extern C to headers and source files, added sample to demonstrate usage with C++
113113
- Delete/Accepted not being reported, callback added for delete/accepted
114114
- Append IOT_ to all Debug macros (eg. DEBUG is now IOT_DEBUG)
115115
- Fixed exit on error for subscribe_publish_sample
@@ -134,7 +134,7 @@ Bugfixes/Improvements:
134134
- Removed Paho Wrapper, Merge MQTT into SDK code, added specific error codes
135135
- Refactored Network and Timer layer wrappers, added specific error codes
136136
- Refactored samples and makefiles
137-
137+
138138
## [1.1.2](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v1.1.2) (April 22, 2016)
139139

140140
Bugfixes/Improvements:
@@ -149,13 +149,13 @@ Bugfixes/Improvements:
149149
- Removing the Executable bit from all the files in the repository. Fixing [this](https://github.com/aws/aws-iot-device-sdk-embedded-C/issues/14) issue
150150
- Refactoring MQTT client to remove declaration after statement warnings
151151
- Fixing [this](https://forums.aws.amazon.com/thread.jspa?threadID=222467&tstart=0) bug
152-
152+
153153

154154
## [1.1.0](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v1.1.0) (February 10, 2016)
155155
Features:
156156

157157
- Auto Reconnect and Resubscribe
158-
158+
159159
Bugfixes/Improvements:
160160

161161
- MQTT buffer handling incase of bigger message
@@ -169,7 +169,7 @@ Bugfixes/Improvements:
169169
Bugfixes/Improvements:
170170

171171
- Paho name changed to Eclipse Paho
172-
- Renamed the Makefiles in the samples directory
172+
- Renamed the Makefiles in the samples directory
173173
- Device Shadow - Delete functionality macro fixed
174174
- `subscribe_publish_sample` updated
175175

@@ -182,7 +182,7 @@ Features:
182182

183183
Bugfixes/Improvements:
184184
- Updated API documentation
185-
185+
186186
## 0.4.0 (October 5, 2015)
187187

188188
Features:
@@ -191,7 +191,7 @@ Features:
191191
- aws_iot_config.h file for easy configuration of parameters
192192
- Sample app for talking with console's Interactive guide
193193
- disconnect handler for the MQTT client library
194-
194+
195195
Bugfixes/Improvements:
196196

197197
- mbedTLS read times out every 10 ms instead of hanging for ever

examples/espidf-aws-iot/components/esp-aws-iot/aws-iot-device-sdk-embedded-C/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ IOT_CLIENT_DIR = .
3131
APP_DIR = $(IOT_CLIENT_DIR)/tests/unit
3232
APP_NAME = aws_iot_sdk_unit_tests
3333
APP_SRC_FILES = $(shell find $(APP_DIR)/src -name '*.cpp')
34-
APP_SRC_FILES = $(shell find $(APP_DIR)/src -name '*.c')
34+
APP_SRC_FILES += $(shell find $(APP_DIR)/src -name '*.c')
3535
APP_INCLUDE_DIRS = -I $(APP_DIR)/include
3636

3737
CPPUTEST_DIR = $(IOT_CLIENT_DIR)/external_libs/CppUTest

0 commit comments

Comments
 (0)