samples: net: http_get: add support for hl7800 modem
Add overlay and small adjustments for using the hl7800 modem. Works out of the box with pinnacle_100_dvk and mg100. Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>
This commit is contained in:
parent
490e67528a
commit
b91c7418f1
5 changed files with 47 additions and 0 deletions
12
samples/net/common/Kconfig
Normal file
12
samples/net/common/Kconfig
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#
|
||||
# Copyright (c) 2025 Ezurio
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
config NET_SAMPLE_COMMON_WAIT_DNS_SERVER_ADDITION
|
||||
bool "Wait DNS server addition before considering connection to be up"
|
||||
depends on MODEM_HL7800 && !DNS_SERVER_IP_ADDRESSES
|
||||
help
|
||||
Make sure we get DNS server addresses from the network
|
||||
before considering the connection to be up.
|
||||
|
|
@ -10,7 +10,11 @@ LOG_MODULE_REGISTER(net_samples_common, LOG_LEVEL_DBG);
|
|||
#include <zephyr/net/conn_mgr_connectivity.h>
|
||||
|
||||
#if defined(CONFIG_NET_CONNECTION_MANAGER)
|
||||
#if defined(CONFIG_NET_SAMPLE_COMMON_WAIT_DNS_SERVER_ADDITION)
|
||||
#define L4_EVENT_MASK (NET_EVENT_DNS_SERVER_ADD | NET_EVENT_L4_DISCONNECTED)
|
||||
#else
|
||||
#define L4_EVENT_MASK (NET_EVENT_L4_CONNECTED | NET_EVENT_L4_DISCONNECTED)
|
||||
#endif
|
||||
|
||||
static struct net_mgmt_event_callback l4_cb;
|
||||
static K_SEM_DEFINE(network_connected, 0, 1);
|
||||
|
|
@ -19,7 +23,11 @@ static void l4_event_handler(struct net_mgmt_event_callback *cb, uint32_t event,
|
|||
struct net_if *iface)
|
||||
{
|
||||
switch (event) {
|
||||
#if defined(CONFIG_NET_SAMPLE_COMMON_WAIT_DNS_SERVER_ADDITION)
|
||||
case NET_EVENT_DNS_SERVER_ADD:
|
||||
#else
|
||||
case NET_EVENT_L4_CONNECTED:
|
||||
#endif
|
||||
LOG_INF("Network connectivity established and IP address assigned");
|
||||
k_sem_give(&network_connected);
|
||||
break;
|
||||
|
|
|
|||
8
samples/net/sockets/http_get/Kconfig
Normal file
8
samples/net/sockets/http_get/Kconfig
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
# Copyright (c) 2025 Ezurio
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
source "samples/net/common/Kconfig"
|
||||
source "Kconfig.zephyr"
|
||||
15
samples/net/sockets/http_get/overlay-hl7800.conf
Normal file
15
samples/net/sockets/http_get/overlay-hl7800.conf
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# The HL7800 driver gets its IP settings from the cell network
|
||||
CONFIG_DNS_SERVER_IP_ADDRESSES=n
|
||||
CONFIG_NET_CONFIG_SETTINGS=n
|
||||
# Wait for the network to be ready
|
||||
CONFIG_NET_CONNECTION_MANAGER=y
|
||||
CONFIG_NET_SAMPLE_COMMON_WAIT_DNS_SERVER_ADDITION=y
|
||||
# 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
|
||||
|
||||
# CONFIG_MODEM_LOG_LEVEL_DBG=y
|
||||
# CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=1
|
||||
# CONFIG_LOG_BUFFER_SIZE=20000
|
||||
# CONFIG_MODEM_HL7800_SET_APN_NAME_ON_STARTUP=y
|
||||
# CONFIG_MODEM_HL7800_APN_NAME="VZWINTERNET"
|
||||
|
|
@ -10,3 +10,7 @@ CONFIG_MBEDTLS_HASH_ALL_ENABLED=y
|
|||
CONFIG_MBEDTLS_CMAC=y
|
||||
|
||||
CONFIG_NET_SOCKETS_SOCKOPT_TLS=y
|
||||
|
||||
# Debugging options
|
||||
#CONFIG_MBEDTLS_DEBUG=y
|
||||
#CONFIG_MBEDTLS_LOG_LEVEL_DBG=y
|
||||
|
|
|
|||
Loading…
Reference in a new issue