Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/update astarte sdk version #101

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ jobs:
strategy:
matrix:
idf-version:
- "4.4.4"
- "5.0.1"
- "4.4"
- "5.0"
- "5.1"
lucaato marked this conversation as resolved.
Show resolved Hide resolved
- "5.2"
- "5.3"
build-system:
- idf
runs-on: ubuntu-latest
container: espressif/idf:v${{ matrix.idf-version }}
container: espressif/idf:release-v${{ matrix.idf-version }}
steps:
- name: Check out repository
uses: actions/checkout@v2
Expand All @@ -48,8 +51,7 @@ jobs:
shell: bash
- name: Build with idf.py
run: |
. $IDF_PATH/export.sh
pip install idf-component-manager --upgrade
source $IDF_PATH/export.sh
idf.py reconfigure
idf.py build
# Print component size info
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@ doc/out

# VS code config
.vscode/

# LSP cache
.cache

# Private files
*.priv
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

sorru94 marked this conversation as resolved.
Show resolved Hide resolved
sorru94 marked this conversation as resolved.
Show resolved Hide resolved
## [Unreleased]
### Changed
- Bump Astarte Device SDK to v1.2.0.
- Bump Astarte Device SDK to v1.3.1.

## [0.7.1] - 2023-09-19
### Changed
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ endif ()
idf_component_register(SRCS "${edgehog_srcs}"
INCLUDE_DIRS "include"
PRIV_INCLUDE_DIRS "private"
REQUIRES astarte-device-sdk-esp32 esp_timer nvs_flash app_update esp_https_ota esp_wifi spi_flash driver)
REQUIRES astarte-device-sdk-esp32 esp_timer nvs_flash app_update esp_https_ota esp_wifi spi_flash driver
PRIV_REQUIRES mbedtls)
15 changes: 15 additions & 0 deletions examples/edgehog_app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

# Get the absolute path of the current directory
get_filename_component(CURRENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)
# Construct the absolute path to sdkconfig.priv
set(SDKCONFIG_PRIV_PATH "${CURRENT_DIR}/sdkconfig.priv")
# Construct the absolute path to sdkconfig.defaults
set(SDKCONFIG_DEFAULTS_PATH "${CURRENT_DIR}/sdkconfig.defaults")
# Check if sdkconfig.priv exists and add it to SDKCONFIG_DEFAULTS
if(EXISTS "${SDKCONFIG_PRIV_PATH}")
if(EXISTS "${SDKCONFIG_DEFAULTS_PATH}")
set(SDKCONFIG_DEFAULTS "sdkconfig.defaults;sdkconfig.priv")
else()
set(SDKCONFIG_DEFAULTS "sdkconfig.priv")
endif()
endif()

include($ENV{IDF_PATH}/tools/cmake/project.cmake)

set(PROJECT_VER "0.1.0")
Expand Down
27 changes: 0 additions & 27 deletions examples/edgehog_app/Makefile

This file was deleted.

2 changes: 2 additions & 0 deletions examples/edgehog_app/edgehog_partition_example.csv
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, , 0x12c000,
ota_0, app, ota_0, , 0x12c000,
ota_1, app, ota_1, , 0x12c000,
astarte, data, nvs, , 200K,
edgehog, data, nvs, , 200K,
2 changes: 1 addition & 1 deletion examples/edgehog_app/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
# SPDX-License-Identifier: Apache-2.0
#

idf_component_register(SRCS "main.c" "./src/wifi_cfg.c" "./src/example_task.c"
idf_component_register(SRCS "main.c" "./src/wifi.c" "./src/example_task.c"
INCLUDE_DIRS "./include"
REQUIRES edgehog-esp32-device nvs_flash)
93 changes: 85 additions & 8 deletions examples/edgehog_app/main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,92 @@

menu "Edgehog example"

config WIFI_SSID
string "WiFi SSID"
default "myssid"
menu "Astarte device configuration"

config CREDENTIALS_SECRET
lucaato marked this conversation as resolved.
Show resolved Hide resolved
string "Credentials secret"
default ""
help
SSID (network name) for the example to connect to.
Astarte device credential secret, generated when the device is added on an Astarte
instance.

config WIFI_PASSWORD
string "WiFi Password"
default "mypassword"
config DEVICE_ID
string "Device hardware ID"
default ""
help
WiFi password (WPA or WPA2) for the example to use.
Astarte device hardware id, generated when the device is added on an Astarte instance.

endmenu

menu "WiFi configuration"
sorru94 marked this conversation as resolved.
Show resolved Hide resolved

config WIFI_SSID
string "WiFi SSID"
default "myssid"
help
SSID (network name) for the demo to connect to.

config WIFI_PASSWORD
string "WiFi Password"
default "mypassword"
help
WiFi password (WPA or WPA2) for the demo to use.

choice WIFI_SAE_MODE
prompt "WPA3 SAE mode selection"
default ESP_WPA3_SAE_PWE_BOTH
help
Select mode for SAE as Hunt and Peck, H2E or both.
config ESP_WPA3_SAE_PWE_HUNT_AND_PECK
bool "HUNT AND PECK"
config ESP_WPA3_SAE_PWE_HASH_TO_ELEMENT
bool "H2E"
config ESP_WPA3_SAE_PWE_BOTH
bool "BOTH"
endchoice

config WIFI_PW_ID
string "PASSWORD IDENTIFIER"
depends on ESP_WPA3_SAE_PWE_HASH_TO_ELEMENT|| ESP_WPA3_SAE_PWE_BOTH
default ""
help
password identifier for SAE H2E

config ESP_MAXIMUM_RETRY
int "Maximum retry"
default 5
help
Set the Maximum retry to avoid station reconnecting to the AP unlimited when the AP
is really inexistent.

choice WIFI_SCAN_AUTH_MODE_THRESHOLD
prompt "WiFi Scan auth mode threshold"
default WIFI_AUTH_WPA2_PSK
help
The weakest authmode to accept in the scan mode.
This value defaults to WIFI_AUTH_WPA2_PSK incase password is present and
WIFI_AUTH_OPEN is used.
Please select WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK incase AP is operating in WEP/WPA
mode.

config WIFI_AUTH_OPEN
bool "OPEN"
config WIFI_AUTH_WEP
bool "WEP"
config WIFI_AUTH_WPA_PSK
bool "WPA PSK"
config WIFI_AUTH_WPA2_PSK
bool "WPA2 PSK"
config WIFI_AUTH_WPA_WPA2_PSK
bool "WPA/WPA2 PSK"
config WIFI_AUTH_WPA3_PSK
bool "WPA3 PSK"
config WIFI_AUTH_WPA2_WPA3_PSK
bool "WPA2/WPA3 PSK"
config WIFI_AUTH_WAPI_PSK
bool "WAPI PSK"
endchoice

endmenu

endmenu
26 changes: 0 additions & 26 deletions examples/edgehog_app/main/component.mk

This file was deleted.

3 changes: 3 additions & 0 deletions examples/edgehog_app/main/include/example_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#ifndef EXAMPLE_TASK_H
#define EXAMPLE_TASK_H

#define ASTARTE_PARTITION_NAME "astarte"
#define EDGEHOG_PARTITION_NAME "edgehog"

/**
* @brief Edgehog configuration task.
*
Expand Down
12 changes: 12 additions & 0 deletions examples/edgehog_app/main/include/wifi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* (C) Copyright 2024, SECO Mind Srl
*
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef WIFI_H
#define WIFI_H

void wifi_init_sta(void);

#endif /* WIFI_H */
29 changes: 0 additions & 29 deletions examples/edgehog_app/main/include/wifi_cfg.h

This file was deleted.

11 changes: 8 additions & 3 deletions examples/edgehog_app/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
#include <nvs_flash.h>

#include "example_task.h"
#include "wifi_cfg.h"
#include "wifi.h"

/************************************************
* Constants/Defines
***********************************************/

static const char *TAG = "EDGEHOG_EXAMPLE_MAIN";
static const char *TAG = "EXAMPLE_MAIN";

/************************************************
* Main function definition
Expand All @@ -43,8 +43,13 @@ void app_main(void)
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}

ESP_ERROR_CHECK(ret);
sorru94 marked this conversation as resolved.
Show resolved Hide resolved
wifi_init();
ESP_ERROR_CHECK(nvs_flash_init_partition(ASTARTE_PARTITION_NAME));
ESP_ERROR_CHECK(nvs_flash_init_partition(EDGEHOG_PARTITION_NAME));

ESP_LOGI(TAG, "ESP_WIFI_MODE_STA");
wifi_init_sta();

ESP_LOGI(TAG, "NVS and WIFI initialization completed.");

Expand Down
Loading
Loading