Skip to content

Commit

Permalink
Merge branch 'feature/add_esp8266_compliance' into 'master'
Browse files Browse the repository at this point in the history
examples: Add esp8266 compliance

See merge request esp-components/esp-azure!8
  • Loading branch information
mahavirj committed Dec 21, 2018
2 parents cd26689 + 653e76f commit 55dbce1
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 1,045 deletions.
31 changes: 28 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
stages:
- build
- build_esp32
- build_esp8266

variables:
BATCH_BUILD: "1"
Expand All @@ -8,8 +9,8 @@ variables:
IDF_PATH: "$CI_PROJECT_DIR/esp-idf"
IDF_CI_BUILD: "1"

build_demo:
stage: build
build_esp32_demo:
stage: build_esp32
image: $CI_DOCKER_REGISTRY/esp32-ci-env
tags:
- build
Expand All @@ -34,3 +35,27 @@ build_demo:
- cd examples/prov_dev_client_ll_sample
- make defconfig
- make

build_esp8266_demo:
stage: build_esp8266
image: $CI_DOCKER_REGISTRY/esp8266-ci-env-new
tags:
- build
script:
# add gitlab ssh key
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- git --version
- git clone --depth 1 $GITLAB_SSH_SERVER/sdk/ESP8266_RTOS_SDK.git
- export IDF_PATH=$CI_PROJECT_DIR/ESP8266_RTOS_SDK
- cd examples/iothub_client_sample_mqtt
- make defconfig
- make
- cd ../../
- cd examples/prov_dev_client_ll_sample
- make defconfig
- make
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ git submodule update --init --recursive

Please check results on both the iothub and device side:

- iothub: log into iothub-explorer, and monitor events with command `iothub-explorer monitor-events yourdevice --login 'yourprimarykey'`
- az iot hub monitor-events -n [IoTHub Name] --login 'HostName=myhub.azuredevices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=12345'

- ESP device: monitor events with command `make monitor`

ESP device would send data to the Azure cloud, and then you would be able to receive data at the iothub side.
Expand Down
1 change: 0 additions & 1 deletion component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ azure-iot-sdk-c/c-utility/pal/tlsio_options.o \
port/src/agenttime_esp.o \
port/src/platform_esp.o \
port/src/tlsio_esp_tls.o \
port/src/socketio_berkeley.o \
\
azure-iot-sdk-c/c-utility/src/xlogging.o \
azure-iot-sdk-c/c-utility/src/singlylinkedlist.o \
Expand Down
2 changes: 1 addition & 1 deletion examples/iothub_client_sample_mqtt/main/azure_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void app_main()
{
// Initialize NVS
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
if (ret == ESP_ERR_NVS_NO_FREE_PAGES) {
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
Expand Down
3 changes: 3 additions & 0 deletions examples/iothub_client_sample_mqtt/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
CONFIG_NEWLIB_ENABLE=y
CONFIG_NEWLIB_LIBRARY_LEVEL_NORMAL=y
CONFIG_NEWLIB_NANO_FORMAT=
CONFIG_SSL_USING_MBEDTLS=y
CONFIG_LWIP_IPV6=y

2 changes: 1 addition & 1 deletion examples/prov_dev_client_ll_sample/main/azure_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void app_main()
{
// Initialize NVS
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
if (ret == ESP_ERR_NVS_NO_FREE_PAGES) {
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ static void register_device_callback(PROV_DEVICE_RESULT register_result, const c
}
}

const IO_INTERFACE_DESCRIPTION* socketio_get_interface_description(void)
{
return NULL;
}

int prov_dev_client_ll_sample_run()
{
SECURE_DEVICE_TYPE hsm_type;
Expand Down
3 changes: 3 additions & 0 deletions examples/prov_dev_client_ll_sample/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
CONFIG_NEWLIB_ENABLE=y
CONFIG_NEWLIB_LIBRARY_LEVEL_NORMAL=y
CONFIG_NEWLIB_NANO_FORMAT=
CONFIG_SSL_USING_MBEDTLS=y
CONFIG_LWIP_IPV6=y

Loading

0 comments on commit 55dbce1

Please sign in to comment.