Skip to content

Commit

Permalink
Anjay-esp32-client 23.09
Browse files Browse the repository at this point in the history
BREAKING CHANGES
- Removed Anjay and FreeRTOS-Cellular-Interface submodules and added Anjay-esp-idf
  component into the components/ directory

Improvements
- Updated Anjay to version X.X.X
- Revamped configuration of Anjay and its dependencies
- The Anjay-esp-idf component includes a new `Component config/Anjay library
  configuration` menu for configuring the Anjay library
- Updated recommended ESP IDF to v4.4.5
  • Loading branch information
JZimnol committed Sep 7, 2023
1 parent 8beedba commit 6a6ef67
Show file tree
Hide file tree
Showing 49 changed files with 97 additions and 1,789 deletions.
10 changes: 3 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[submodule "main/anjay"]
path = main/anjay
url = https://github.com/AVSystem/Anjay.git
[submodule "main/FreeRTOS-Cellular-Library"]
path = main/FreeRTOS-Cellular-Interface
url = https://github.com/AVSystem/FreeRTOS-Cellular-Interface
branch = esp32-client-v1.2.0
[submodule "components/anjay-esp-idf"]
path = components/anjay-esp-idf
url = https://github.com/AVSystem/Anjay-esp-idf.git
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 23.09 (September 7th, 2023)

### BREAKING CHANGES
- Removed Anjay and FreeRTOS-Cellular-Interface submodules and added Anjay-esp-idf
component into the components/ directory

### Improvements
- Revamped configuration of Anjay and its dependencies
- The Anjay-esp-idf component includes a new `Component config/Anjay library
configuration` menu for configuring the Anjay library
- Updated recommended ESP IDF to v4.4.5

## 22.12 (December 13th, 2022)

### Bugfixes
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021-2022 AVSystem <[email protected]>
# Copyright 2021-2023 AVSystem <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021-2022 AVSystem <[email protected]>
# Copyright 2021-2023 AVSystem <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Anjay ESP32 Client
## Overview
This repository contains a LwM2M Client application example for ESP32 devices, based on open-source [Anjay](https://github.com/AVSystem/Anjay) library and [Espressif IoT Development Framework](https://github.com/espressif/esp-idf).
This repository contains a LwM2M Client application example for ESP32 devices, based on open-source [Anjay-esp-idf](https://github.com/AVSystem/Anjay-esp-idf) component and [Espressif IoT Development Framework](https://github.com/espressif/esp-idf).

The following boards are supported natively in the project:
- ESP-WROVER-KIT
Expand All @@ -18,16 +18,18 @@ The following LwM2M Objects are supported:
| M5StickC-Plus | Push button (/3347)<br>Light control (/3311)<br>Temperature sensor (/3303)<br>Accelerometer (/3313)<br>Gyroscope (/3343)

## Compiling and launching
1. Install ESP-IDF and its dependencies on your computer. Please follow the instructions at https://docs.espressif.com/projects/esp-idf/en/v4.4/esp32/get-started/index.html up to and including the point where you call `. $HOME/esp/esp-idf/export.sh`
* The project has been tested with ESP-IDF v4.4, but may work with other versions as well.
1. Install ESP-IDF and its dependencies on your computer. Please follow the instructions at https://docs.espressif.com/projects/esp-idf/en/v4.4.5/esp32/get-started/index.html up to and including the point where you call `. $HOME/esp/esp-idf/export.sh`
* The project has been tested with ESP-IDF v4.4.5, but may work with other versions as well.
1. Clone the repository `git clone https://github.com/AVSystem/Anjay-esp32-client.git` and navigate to project directory
1. Initialize and update submodules with `git submodule update --init --recursive`
1. Run `idf.py set-target esp32` in the project directory
1. Run `idf.py menuconfig`
* navigate to `Component config/anjay-esp32-client`:
* select one of supported boards or manually configure the board in `Board options` menu
* configure Anjay in `Client options` menu
* configure WiFi in `Connection configuration` menu
* configure LwM2M client configuration in `Client options` menu
* configure Wi-Fi in `Connection configuration` menu
* navigate to `Component config/Anjay library configuration` to configure `Anjay`
library and its dependencies (`avs_commons` and `avs_coap`)
1. Run `idf.py build` to compile
1. Run `idf.py flash` to flash
* NOTE: M5StickC-Plus does not support default baudrate, run `idf.py -b 750000 flash` to flash it
Expand Down Expand Up @@ -95,8 +97,11 @@ $PROJECT_DIR/build/anjay-esp32-client/build/anjay-esp32-client.bin
1. Run `idf.py menuconfig`
* navigate to `Component config/anjay-esp32-client`:
* select `External BG96 module` in `Choose an interface` menu
* navigate to `Component config/Anjay library configuration/Enable support for external BG96 module`:
* configure BG96 in `BG96 module configuration` menu
* configure PDN in `Connection configuration` menu
* configure PDN authentication type in `PDN authentication type` menu
* configure the `APN name` (and `PDN username/password` if needed)

## Links
* [Anjay source repository](https://github.com/AVSystem/Anjay)
* [Anjay documentation](https://avsystem.github.io/Anjay-doc/index.html)
Expand Down
1 change: 1 addition & 0 deletions components/anjay-esp-idf
Submodule anjay-esp-idf added at 5448c8
48 changes: 1 addition & 47 deletions main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021-2022 AVSystem <[email protected]>
# Copyright 2021-2023 AVSystem <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -49,51 +49,6 @@ idf_component_register(SRCS ${sources}
INCLUDE_DIRS "."
EMBED_FILES ${Embedded_cert})

file(GLOB_RECURSE ANJAY_SOURCES
"anjay/src/*.c"
"anjay/deps/avs_coap/src/*.c"
"anjay/deps/avs_commons/src/*.c")

add_library(anjay MODULE ${ANJAY_SOURCES})
target_include_directories(anjay PRIVATE
"anjay/src"
"anjay/deps/avs_coap/src"
"anjay/deps/avs_commons/src")
target_include_directories(anjay PUBLIC
"anjay-config"
"anjay/include_public"
"anjay/deps/avs_coap/include_public"
"anjay/deps/avs_commons/include_public")
target_link_libraries(anjay PRIVATE idf::mbedtls)

# NOTE: avs_coap contains some assertions that check if allocated memory
# follows alignment requirements. malloc() on ESP-IDF aligns everything
# to 4 bytes, even though alignof(max_align_t) == alignof(int64_t)
# == alignof(long double) == 8. This is just GCC being overly cautious,
# the maximum hardware-imposed alignment on ESP32 is actually 4 bytes.
# We disable assertions within anjay to work around that.
target_compile_definitions(anjay PRIVATE NDEBUG)

if (CONFIG_ANJAY_CLIENT_INTERFACE_BG96_MODULE)
file(GLOB_RECURSE FREERTOS_CELLULAR_LIBRARY_SOURCES
"FreeRTOS-Cellular-Interface/source/*.c"
"FreeRTOS-Cellular-Interface/modules/bg96/*.c"
"FreeRTOS-Cellular-Interface/modules/cellular_platform.c")

add_library(freertos_cellular_library MODULE ${FREERTOS_CELLULAR_LIBRARY_SOURCES})
target_include_directories(freertos_cellular_library PRIVATE
"FreeRTOS-Cellular-Interface/source/include/private"
"FreeRTOS-Cellular-Interface/modules/bg96")
target_include_directories(freertos_cellular_library PUBLIC
"FreeRTOS-Cellular-Interface/source/include"
"FreeRTOS-Cellular-Interface/source/include/common"
"FreeRTOS-Cellular-Interface/source/logging"
"FreeRTOS-Cellular-Interface/source/cellular_network_transport"
"FreeRTOS-Cellular-Interface/source/interface"
"FreeRTOS-Cellular-Interface/modules")
target_link_libraries(freertos_cellular_library PRIVATE anjay)
endif()

add_custom_target( configure_git_version
COMMAND ${CMAKE_COMMAND}
-D GIT_EXECUTABLE=${GIT_EXECUTABLE}
Expand All @@ -104,7 +59,6 @@ add_custom_target( configure_git_version

add_dependencies(${COMPONENT_LIB} configure_git_version)

target_link_libraries(${COMPONENT_LIB} PRIVATE anjay)
if (CONFIG_ANJAY_CLIENT_INTERFACE_BG96_MODULE)
target_link_libraries(${COMPONENT_LIB} PRIVATE freertos_cellular_library)
endif()
1 change: 0 additions & 1 deletion main/FreeRTOS-Cellular-Interface
Submodule FreeRTOS-Cellular-Interface deleted from dc12cb
61 changes: 7 additions & 54 deletions main/Kconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021-2022 AVSystem <[email protected]>
# Copyright 2021-2023 AVSystem <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,6 +13,7 @@
# limitations under the License.

menu "anjay-esp32-client"

choice ANJAY_CLIENT_DEVBOARD
prompt "Choose targeted development board"
default ANJAY_CLIENT_BOARD_UNKNOWN
Expand Down Expand Up @@ -146,30 +147,14 @@ menu "anjay-esp32-client"

config ANJAY_CLIENT_INTERFACE_BG96_MODULE
bool "External BG96 module"
select ANJAY_ESP_IDF_WITH_BG96_SUPPORT
endchoice

config ANJAY_CLIENT_CELLULAR_EVENT_LOOP
bool
default y if ANJAY_CLIENT_INTERFACE_BG96_MODULE
default n

if ANJAY_CLIENT_INTERFACE_BG96_MODULE
menu "BG96 module configuration"

config ANJAY_BG96_UART_PORT_NUMBER
int "UART port number"
default 0

config ANJAY_BG96_TX_PIN
int "UART Tx pin"
default 0

config ANJAY_BG96_RX_PIN
int "UART Rx pin"
default 0
endmenu
endif

menu "Client options"
config ANJAY_CLIENT_ENDPOINT_NAME
string "Endpoint name"
Expand Down Expand Up @@ -217,8 +202,8 @@ menu "anjay-esp32-client"
endmenu
endmenu

menu "Connection configuration"
if ANJAY_CLIENT_INTERFACE_ONBOARD_WIFI
if ANJAY_CLIENT_INTERFACE_ONBOARD_WIFI
menu "Connection configuration"
config ANJAY_WIFI_SSID
string "WiFi SSID"
default "myssid"
Expand Down Expand Up @@ -249,38 +234,6 @@ menu "anjay-esp32-client"
bool "Unique Local Link Address"
endchoice
endif
endif

if ANJAY_CLIENT_INTERFACE_BG96_MODULE
config ANJAY_CELLULAR_APN
string "APN name"
default "Cellular APN"

choice ANJAY_CELLULAR_PDN_AUTH_TYPE
prompt "PDN authentication type"
default ANJAY_CELLULAR_PDN_AUTH_TYPE_NONE

config ANJAY_CELLULAR_PDN_AUTH_TYPE_NONE
bool "No authentication"

config ANJAY_CELLULAR_PDN_AUTH_TYPE_PAP
bool "PAP"

config ANJAY_CELLULAR_PDN_AUTH_TYPE_CHAP
bool "CHAP"

config ANJAY_CELLULAR_PDN_AUTH_TYPE_PAP_OR_CHAP
bool "PAP or CHAP"
endchoice

config ANJAY_CELLULAR_PDN_USERNAME
string "PDN username" if !ANJAY_CELLULAR_PDN_AUTH_TYPE_NONE
default ""

config ANJAY_CELLULAR_PDN_PASSWORD
string "PDN password" if !ANJAY_CELLULAR_PDN_AUTH_TYPE_NONE
default ""

endif
endmenu
endmenu
endif
endmenu
1 change: 0 additions & 1 deletion main/anjay
Submodule anjay deleted from 6bfb0b
Loading

0 comments on commit 6a6ef67

Please sign in to comment.