Skip to content

Commit

Permalink
samples: net: aws_iot_mqtt: Add support for hl7800 based boards
Browse files Browse the repository at this point in the history
Add support for the pinnacle_100_dvk and mg100.
With these boards, wait to get on the network before trying to connect to AWS.

Signed-off-by: Ryan Erickson <[email protected]>
  • Loading branch information
rerickson1 committed Jan 10, 2025
1 parent db9f3a8 commit 767ac95
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions samples/net/cloud/aws_iot_mqtt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ else()
endif()

target_sources(app PRIVATE "src/main.c" ${creds})

include(${ZEPHYR_BASE}/samples/net/common/common.cmake)
11 changes: 11 additions & 0 deletions samples/net/cloud/aws_iot_mqtt/boards/mg100.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The HL7800 driver gets its IP settings from the cell network
CONFIG_NET_CONFIG_SETTINGS=n
CONFIG_NET_DHCPV4=n
CONFIG_DNS_SERVER_IP_ADDRESSES=n
# NB-IoT has large latency, so increase timeouts. It is ok to use this for Cat-M1 as well.
CONFIG_NET_SOCKETS_DNS_TIMEOUT=12000
CONFIG_NET_SOCKETS_CONNECT_TIMEOUT=15000
# Wait for the network to be ready
CONFIG_NET_CONNECTION_MANAGER=y
# Don't require device to have time/date
CONFIG_MBEDTLS_HAVE_TIME_DATE=n
11 changes: 11 additions & 0 deletions samples/net/cloud/aws_iot_mqtt/boards/pinnacle_100_dvk.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The HL7800 driver gets its IP settings from the cell network
CONFIG_NET_CONFIG_SETTINGS=n
CONFIG_NET_DHCPV4=n
CONFIG_DNS_SERVER_IP_ADDRESSES=n
# NB-IoT has large latency, so increase timeouts. It is ok to use this for Cat-M1 as well.
CONFIG_NET_SOCKETS_DNS_TIMEOUT=12000
CONFIG_NET_SOCKETS_CONNECT_TIMEOUT=15000
# Wait for the network to be ready
CONFIG_NET_CONNECTION_MANAGER=y
# Don't require device to have time/date
CONFIG_MBEDTLS_HAVE_TIME_DATE=n
6 changes: 6 additions & 0 deletions samples/net/cloud/aws_iot_mqtt/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,9 @@ CONFIG_MBEDTLS_TLS_VERSION_1_2=y
CONFIG_MBEDTLS_MEMORY_DEBUG=y
CONFIG_MBEDTLS_HAVE_TIME_DATE=y
CONFIG_MBEDTLS_SSL_ALPN=y

# Debugging options
# CONFIG_MBEDTLS_DEBUG=y
# CONFIG_MBEDTLS_LOG_LEVEL_DBG=y
# CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=1
# CONFIG_LOG_BUFFER_SIZE=50000
3 changes: 3 additions & 0 deletions samples/net/cloud/aws_iot_mqtt/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <zephyr/data/json.h>
#include <zephyr/random/random.h>
#include <zephyr/logging/log.h>
#include "net_sample_common.h"


#if defined(CONFIG_MBEDTLS_MEMORY_DEBUG)
Expand Down Expand Up @@ -453,6 +454,8 @@ int main(void)
{
setup_credentials();

wait_for_network();

for (;;) {
resolve_broker_addr(&aws_broker);

Expand Down

0 comments on commit 767ac95

Please sign in to comment.