Skip to content

Commit

Permalink
Merge pull request #11 from felixgateru/esp32_coap_zephyr
Browse files Browse the repository at this point in the history
NOISSUE -  Add zephyr target with CoAP capability
  • Loading branch information
drasko authored Jan 12, 2025
2 parents 12e3c8d + b25128f commit 4d7722b
Show file tree
Hide file tree
Showing 4 changed files with 708 additions and 0 deletions.
7 changes: 7 additions & 0 deletions targets/zephyr_targets/coap/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(coap_client)

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})
target_include_directories(app PRIVATE ${ZEPHYR_BASE}/subsys/net/ip)
20 changes: 20 additions & 0 deletions targets/zephyr_targets/coap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
MQTTS- esp32 target
## Requirements
1. Mainflux broker details including: hostname, ThingID, Thing Credentials and Channel ID
2. [Zephyr](https://www.zephyrproject.org/)


## Configure
1. Edit the [config file](include/config.h) with your broker details.

## Build
The project can be built by utilising the make file within the target directory

```bash
west build -p always -b <your-board-name> mqtt
```
## Flash
Platform io generate a build directory with the fimware.bin within it. Use the make command to flash to board
```bash
west flash
```
29 changes: 29 additions & 0 deletions targets/zephyr_targets/coap/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generic networking options
CONFIG_NETWORKING=y
CONFIG_NEWLIB_LIBC=y
CONFIG_NET_IPV6=y
CONFIG_NET_UDP=y

CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
CONFIG_NET_SOCKETS_POLL_MAX=4

CONFIG_COAP=y

# Kernel options
CONFIG_ENTROPY_GENERATOR=y
CONFIG_TEST_RANDOM_GENERATOR=y

# Logging
CONFIG_PRINTK=y
CONFIG_NET_LOG=y

# Network Shell
CONFIG_NET_SHELL=y

CONFIG_NET_CONFIG_SETTINGS=y
CONFIG_NET_CONFIG_NEED_IPV6=y
CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::2"
CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::1"

CONFIG_HEAP_MEM_POOL_SIZE=2048
Loading

0 comments on commit 4d7722b

Please sign in to comment.