summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2018-01-23 21:28:57 +0200
committerDamien George <damien.p.george@gmail.com>2018-05-21 10:35:16 +1000
commit7afbc498636be676f309193be50c1c47a700b157 (patch)
tree46ce9236418a40b224f99bb50f5483f6fe1cddb8
parent0e52ee957df7700e27fe5bb2378b24b4cecfab08 (diff)
zephyr/prj_base.conf: Enable DHCP and group static IPs together.
Add CONFIG_NET_DHCPV4, which, after https://github.com/zephyrproject-rtos/zephyr/pull/5750 works as follows: static addresses are configured after boot, and DHCP requests are sent at the same time. If valid DHCP reply is received, it overrides static addresses. This setup works out of the box for both direct connection to a workstation (DHCP server usually is not available) and for connection to a router (DHCP is available and required).
-rw-r--r--ports/zephyr/prj_base.conf12
1 files changed, 9 insertions, 3 deletions
diff --git a/ports/zephyr/prj_base.conf b/ports/zephyr/prj_base.conf
index db6a1e3c1..c39779548 100644
--- a/ports/zephyr/prj_base.conf
+++ b/ports/zephyr/prj_base.conf
@@ -32,16 +32,22 @@ CONFIG_NET_APP_SETTINGS=y
CONFIG_NET_APP_INIT_TIMEOUT=3
CONFIG_NET_APP_NEED_IPV6=y
CONFIG_NET_APP_NEED_IPV4=y
-CONFIG_NET_APP_MY_IPV6_ADDR="2001:db8::1"
-CONFIG_NET_APP_MY_IPV4_ADDR="192.0.2.1"
-CONFIG_NET_APP_MY_IPV4_GW="192.0.2.2"
# DNS
CONFIG_DNS_RESOLVER=y
CONFIG_DNS_RESOLVER_ADDITIONAL_QUERIES=2
CONFIG_DNS_SERVER_IP_ADDRESSES=y
+
+# Static IP addresses
+CONFIG_NET_APP_MY_IPV6_ADDR="2001:db8::1"
+CONFIG_NET_APP_MY_IPV4_ADDR="192.0.2.1"
+CONFIG_NET_APP_MY_IPV4_GW="192.0.2.2"
CONFIG_DNS_SERVER1="192.0.2.2"
+# DHCP configuration. Until DHCP address is assigned,
+# static configuration above is used instead.
+CONFIG_NET_DHCPV4=y
+
# Diagnostics and debugging
# Required for zephyr.stack_analyze()