samples: mgmt: updatehub: Add modem support

Add MODEM and Arduino header overlays.  This allows users to evaluate
UpdateHub using any MODEM supported by Zephyr which supports UDP and
PPP connection.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
This commit is contained in:
Gerson Fernando Budke 2020-11-14 16:17:37 -03:00 committed by Carles Cufí
parent 5907fce327
commit c37c41bca9
3 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,12 @@
/*
* Copyright (c) 2020 O.S.Systems
*
* SPDX-License-Identifier: Apache-2.0
*/
&arduino_serial {
status = "okay";
label = "arduino_serial";
current-speed = <115200>;
};

View File

@ -0,0 +1,28 @@
# Copyright (c) 2020 O.S.Systems
# SPDX-License-Identifier: Apache-2.0
# Disable default configs
CONFIG_NET_L2_ETHERNET=n
CONFIG_NET_DHCPV4=n
CONFIG_NET_CONFIG_SETTINGS=n
# UART support
CONFIG_SERIAL=y
# GSM modem support
CONFIG_MODEM=y
CONFIG_MODEM_SHELL=y
CONFIG_MODEM_GSM_PPP=y
CONFIG_MODEM_GSM_UART_NAME="arduino_serial"
CONFIG_MODEM_GSM_APN="<Your Access Point Network>"
# PPP networking support
CONFIG_NET_NATIVE=y
CONFIG_NET_PPP=y
CONFIG_NET_L2_PPP=y
CONFIG_NET_L2_PPP_TIMEOUT=10000
CONFIG_DNS_SERVER_IP_ADDRESSES=y
CONFIG_DNS_SERVER1="8.8.8.8"

View File

@ -129,6 +129,12 @@ void main(void)
LOG_ERR("Error connecting to WiFi");
return;
}
#elif defined(CONFIG_MODEM_GSM_PPP)
const struct device *uart_dev =
device_get_binding(CONFIG_MODEM_GSM_UART_NAME);
LOG_INF("APN '%s' UART '%s' device %p", CONFIG_MODEM_GSM_APN,
CONFIG_MODEM_GSM_UART_NAME, uart_dev);
#endif
net_mgmt_init_event_callback(&mgmt_cb, event_handler, EVENT_MASK);