Commit graph

2077 commits

Author SHA1 Message Date
Jukka Rissanen 8a4ef3e67a samples: net: sockets: echo: Convert to work both IPv6 and IPv4
The sample enables CONFIG_NET_IPV4_MAPPING_TO_IPV6 and then
turns off IPV6_V6ONLY option which allows it to support both
IPv6 and IPv4 using the same socket.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 09:57:22 -05:00
Alberto Escolar Piedras 201a48889c doc: samples net mqtt_sn_publisher fix west invokation
Fix the west invokation. "-t" is added automatically
to the run goal, otherwise we get a "-t -t" command.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-23 12:54:31 +02:00
Seppo Takalo 2df58f65ce samples: lwm2m: Add docker test script
Add test script that uses same configuration that the
interoperability test.

This is only checking that unsecure client registers and
responds to a GET query.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-10-20 15:07:34 +02:00
Alberto Escolar Piedras a12dff48ac samples net/posix: Rename old Makefiles and clarify READMEs
The old Makefiles which can be used to build this samples
directly as Linux apps and the description in the READMEs
could be quite missleading.

Building this apps in this way has nothing to do with the
Zephyr native_posix/sim targets. This is about building
them as actual Linux applications without Zephyr or any
HW models.

So let's rename the Makefiles and change the description
in the docs to avoid confusion.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-20 15:01:42 +02:00
Jukka Rissanen 7b40014504 samples: net: Remove eth_native_posix sample app
This application is no longer needed as we have removed
the automatic startup support which was used by this sample.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-20 15:00:41 +02:00
Seppo Takalo 8ffb64d46f net: lwm2m: Allow configuring update period
Add new configuration value CONFIG_LWM2M_UPDATE_PERIOD
that allows calculating update period from last update,
instead of calculating it from the lifetime.

In runtime, server is allowed to change the lifetime of the
registration which causes update perdiod to be effected.

When fixed update period is preferred, UPDATE_PERIOD
config is then used.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-10-20 14:57:38 +02:00
Flavio Ceolin e7bd10ae71 random: Rename random header
rand32.h does not make much sense, since the random subsystem
provides more APIs than just getting a random 32 bits value.

Rename it to random.h and get consistently with other
subsystems.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-10 14:23:50 +03:00
Jukka Rissanen a59b67c521 samples: net: socket: echo_server: conn mgmt header file missing
The conn_mgr_monitor.h was not included so the compilation
gave warning for missing conn_mgr_ignore_iface() function.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-09-29 18:57:07 +03:00
Juha Heiskanen 647fb4dc8f net: lwm2m: RD client Deregister event indicate
Added a new event for LWM2M_RD_CLIENT_EVENT_DEREGISTER for
indicate LwM2M client dereistartion.

Updated unit test and sample for new event type

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2023-09-29 16:53:55 +03:00
Robert Lubos 815e7a1e34 samples: net: sockets: socketpair: Replace integration platform
mps2_an385 was excluded from networking tests, therefore can no longer
be used as an integration platform. Replace it with qemu_x86.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-09-28 17:29:00 -04:00
Robert Lubos bcea9f7c92 samples: net: sockets: big_http_download: Align documentation
Update the TLS part of the big_http_download sample to reference the
currently used server used for file download.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-09-27 09:53:58 +02:00
Robert Lubos 36dec835c4 samples: net: sockets: big_http_download: Update root certificate
The download server that the origin server redirects to seems now to
use different certificate (signed by a different root CA). Therefore
add the additional root CA to the certificate list and refactor the
sample code a bit to allow to easily extend/replace certificates in the
future.

Bump the mbed TLS heap size a bit to accommodate the extra registered
certificate.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-09-27 09:53:58 +02:00
David Corbeil d732a8678b logging: runtime setting of syslog server ip address
Added functionality to change the syslog server's
ip address at runtime as well as sample for
syslog network backend

Signed-off-by: David Corbeil <david.corbeil@dynon.com>
2023-09-27 09:13:23 +02:00
YuLong Yao 3ebb8953e4 samples: net: wifi: support esp32s3_luatos_core
add overlay and conf for esp32s3_luatos_core board

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2023-09-22 15:58:11 +02:00
Benjamin Cabé d65d3046a5 samples: usb: wpanusb: fix bad code-sample id
The WPAN USB sample is referred to as wpan-usb,
not _wpansub.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-20 11:36:12 +01:00
Benjamin Cabé a4cabee9d8 samples: net: doc: fix bad code-sample id
The Echo server simple sample is referred to as sockets-echo,
not socket-echo.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-20 11:36:12 +01:00
Benjamin Cabé 994558ef8e samples: net: doc: Use new Sphinx extension to document networking samples
Use the new code-sample directive and roles to document the networking
samples so that they show up as "Related samples" when browsing the
various relevant networking APIs.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-19 15:22:59 +01:00
YuLong Yao 8704419126 Samples: net: wifi: add esp32c3_luatos_core board
add overlay and conf for esp32c3_luatos_core board

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2023-09-15 14:17:50 +02:00
Sylvio Alves a6756c36e9 samples: wifi: esp32s2_saola: reduce RAM usage
This modification frees up around ~10kB of RAM and make sample code
working again.

1) Reduced net packet size and count.
2) Increase Wi-Fi heap to avoid memory allocation failure.
3) Keep log as minimal.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-09-13 17:00:28 +02:00
Stanley Huang 73a87d14df boards: arm: add raytac_mdbt53v_db_40_nrf5340
Adds new raytac_mdbt53_db_40_nrf5340 board.

Signed-off-by: Stanley Huang <stanley@raytac.com>
2023-09-13 12:06:48 +02:00
Miika Karanki 7ae9a0b55d net: mqtt: change cipher and sec_tag lists to const
cipher_list and sec_tag_list are used only with zsock_setsockopt
in MQTT. For that use, they can be const (and potentially kept
in flash memory).

Signed-off-by: Miika Karanki <miika.karanki@vaisala.com>
2023-09-12 16:30:28 +02:00
Marc Desvaux 15c733a36e samples: net: zperf: add Ethernet twister test
add Ethernet twister test for stm32h573i_dk

Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
2023-09-11 11:18:20 +02:00
Benjamin Cabé c26679be42 samples: net: cloud: drop Google Cloud IoT Core
Google Cloud IoT Core has been retired on August 16, 2023.
Removed the sample and the link to it in a previous release note.
Added a redirect to other IoT cloud samples.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-08 11:04:25 +02:00
Bjarki Arge Andreasen c0c9d6f7d6 samples/net: Add cellular modem sample
This commit adds a sample application which demonstrates how
to use the new driver and modules. The sample uses power
management to turn on the modem, uses network management
to wait for L4 connected, then uses DNS to get the IP
of the server running the python script found in the
server folder, which echoes back data recevied to it.
A packet containing psudo random data is then sent to
the server, which the echoes it back. To validate the
capability of the driver to restart the modem, the
modem is restarted, and the packet is sent again.

The server is hosted by linode, and uses the domain
name test-endpoint.com

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-08-30 13:48:51 +02:00
Georges Oates_Larsen b25ea4742e net: conn_mgr: Rename connectivity monitor
The connectivity monitoring subfeature of conn_mgr is currently also
named conn_mgr, which is confusing.

This commit renames it to conn_mgr_monitor, or conn_mgr_mon for short,
for clarity.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-08-29 16:13:37 +02:00
Nick Ward 2d65acca3a drivers: gpio: use gpio_is_ready_dt helper function
Update `struct gpio_dt_spec` use with gpio_is_ready_dt()

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2023-08-28 08:48:35 -05:00
Alberto Escolar Piedras 9eeb78d86d COVERAGE: Fix COVERAGE_GCOV dependencies
CONFIG_COVERAGE has been incorrectly used to
change other kconfig options (stack sizes, etc)
code defaults, as well as some samples behaviour,
which should not have dependend on it.

Instead those should have depended on COVERAGE_GCOV,
which, being the one which adds special code and
temporary RAM storage for embedded targets,
require changes to many features.

When building for the native targets, all this was
unnecessary.

=> Fix the dependency.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-08-24 15:36:31 +02:00
Florian La Roche 572a23f3d6 samples/net/dhcpv4_client: remove unused var "iface" from sample
The var "iface" is unused in this sample code, so remove from source.

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
2023-08-23 14:43:56 +02:00
romain pelletant 4a49b1d867 sample: net: add tftp client sample
Add simple TFTP client code using TFTP client library
Initiate connection (IPv4) with optional DNS resolution
Operate get operation then put operation in octet mode
Tested on native_posix
Issue/Discussion #60985

Signed-off-by: romain pelletant <romain.pelletant@fullfreqs.com>
2023-08-23 10:05:19 +02:00
Daniel Leung 732fd2dd0d samples: net: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Grant Ramsay 3b7bcfa4ab samples: net: sockets: echo_server: Add QEMU A53 as a supported platform
Add qemu_cortex_a53 as a supported platform

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2023-08-18 10:13:12 +02:00
Julio Cesar 5e15e8cb48 boards: xtensa: Add support for YD-ESP32 board
Add `yd_esp32` board:

- Model name: YD-ESP32
- Manufacturer: VCC-GND® Studio
- Espressif module: ESP32-WROOM-32E

Signed-off-by: Julio Cesar <hi@jcsx.dev>
2023-08-15 11:15:39 +00:00
Benjamin Cabé fe8ced1e5a doc: lwm2m: samples: fix formatting issue
A sneaky whitespace was causing inconsistent rendering in the list of
available overlays.
Fixed by switching to a list table which is arguably now even easier to
read.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-11 19:48:08 +00:00
Manuel Argüelles 11b94f3155 boards: mr_canhubk3: enable EMAC
This board has a single instance of EMAC connected to a NXP TJA1103
Ethernet PHY. Currently, there is no driver for this PHY and its
pin strapping configuration allows to use it without software
configuration, so EMAC is configured as fixed link.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-08-03 10:28:20 +02:00
Seppo Takalo 838ab80bca net: coap: Use 64bit timestamps
Use 64bit timestamps from k_uptime_get() so they don't
roll over during the expected device lifetime.

Fixes #60826

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-08-01 15:40:04 +02:00
Seppo Takalo 1dfa711167 net: lwm2m: Create socketpair that can wake up zsock_poll()
Allow socket-loop to wake up immediately, if there are changes,
instead of waiting for zsock_poll() to timeout.
This change makes engine more reactive and removes
hard coded timeout from zsock_poll().

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-08-01 12:07:12 +02:00
Florian Grandel a4cd5cee40 drivers: ieee802154: consistent high res timestamps
The IEEE 802.15.4 API and networking subsystem were using several
inconsistent timestamp resolutions and types. This change defines all
timestamps with nanosecond resolution and reduces the number of
available types to represent timestamps to two:
* `struct net_ptp_time` for PTP timestamps
* `net_time_t` for all other high resolution timestamps

All timestamps (including PTP timestamps) are now referred to a
"virtual" local network subsystem clock source based on the well-defined
types above. It is the responsibility of network subsystem L2/driver
implementations (notably Ethernet and IEEE 802.15.4 L2 stacks) to ensure
consistency of all timestamps and radio timer values exposed by the
driver API to such a network subsystem uptime reference clock
independent of internal implementation details.

The "virtual" network clock source may be implemented based on arbitrary
hardware peripherals (e.g. a coarse low power RTC counter during sleep
time plus a high resolution/high precision radio timer while receiving
or sending). Such implementation details must be hidden from API
clients, as if the driver used a single high resolution clock source
instead.

For IEEE 802.15.4, whenever timestamps refer to packet send or receive
times, they are measured when the end of the IEEE 802.15.4 SFD (message
timestamp point) is present at the local antenna (reference plane).

Due to its limited range of ~290 years, net_time_t timestamps (and
therefore net_pkt timestamps and times) must not be used to represent
absolute points in time referred to an external epoch independent of
system uptime (e.g.  UTC, TAI, PTP, NTP, ...).

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-28 09:06:35 +00:00
Marc Desvaux ae72fa7bf6 samples: net: zperf: add Ethernet twister test
add one Ethernet twister test for nucleo_h563zi,
nucleo_h743zi, nucleo_f429zi, nucleo_f746zg.
remove the common: harnesses: net  that are not supported
leave harnesses: net for all other test execpt the one we use

Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
2023-07-27 16:24:54 +00:00
Johann Fischer 430818ecaa sample/tests: remove CONFIG_USB_COMPOSITE_DEVICE usage
This is no longer necessary, as this option is selected as a dependency
for class implementations where it is required.
Also remove redundant test cases.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-07-26 14:37:15 +02:00
Marek Matej 3776402f40 boards: xtensa: esp32 board split
Remove virtual esp32 board and replace it with the
real word boards:

- esp32_devkitc_wroom
- esp32_devkitc_wrover (with PSRAM option)

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2023-07-25 18:12:33 +02:00
Robert Lubos 9866a5229d samples: net: dns_resolve: Improve DHCPv4 handling
There is some ambiguity with the DHCPv4 handling in the dns_resolve
sample. On one hand, the sample uses net_config library, which does
initiate the DHCPv4 on the interface (if enabled) and may block the
initialization until the address is assigned (in case there is no other
statically assigned IPv4 addresses.) On the other hand, the sample
registers for NET_EVENT_IPV4_ADDR_ADD in case DHCPv4 is in use, delaying
the DNS queries until address is assigned.

In case net_config delayed the initialization however, this will not
work, as the event handler will be registered only after DHCPv4 address
is assigned, so the callback will not get executed.

Fix this, by checking if DHCPv4 assigned address already exists on an
interface - if so, schedule DNS queries immediately. Otherwise (for
example in case when net_config was not configured to wait for address)
register an event callback, and schedule queries from there.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-07-25 14:18:54 +02:00
Chaitanya Tata 631312334e samples: lwm2m: Fix default ID length check for DTLS
If the default which is set to CONFIG_BOARD is used, then the lwm2m
client fails to set the client identity as the default maximum length
allowed is only 16 and for some boards this exceeds.

So, increase the default length to accomodate almost all boards. Also
add a build assert for the length validation.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-07-18 11:08:23 +00:00
Robert Lubos 87ee12ae72 samples: net: echo_client: Fix build with UDP disabled
In case UDP is disabled, init_udp() is not compiled and the build
fails. Fix this, by providing dummy implementations for UDP functions,
in case UDP is disabled.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-07-17 17:21:33 -04:00
Robert Lubos 1f1f550ad6 samples: net: echo_client/server: Fix mbed TLS dependency
All application level TLS operations should be guarded with
"#if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS)" and not mbed TLS configs
only. Otherwise, in case mbed TLS is enabled, but the sample is not
configured to use TLS (hence TLS credential library is not available
for example), the build may fail or produce spurious warnings.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-07-17 17:21:33 -04:00
Jiaxuan Weng 33e3ddd4d5 boards: xtensa: Add support for xiao esp32s3
add board support and overlay for seeed xiao esp32s3.

Signed-off-by: Jiaxuan Weng <1391548050@qq.com>
2023-07-03 09:31:27 +02:00
Seppo Takalo 5c1228770e net: lwm2m: Add support for X509 certificates
Add support for using X509 certificates.
Default settings use ECDSA certificates with SHA256 hash.

When different settings are required clients should overwrite
struct lwm2m_ctx->load_credentials() and
struct lwm2m_ctx->set_socketoptions()

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-06-26 12:35:29 +00:00
Saravanan Sekar 026d476a84 samples: websocket_client: close tcp socket after websocket_disconnect
websocket_disconnect api does not closes user tcp socket, so tcp socket
must be closed after done.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
2023-06-19 09:18:45 +01:00
Florian Grandel 1ee4d3ed77 net: l2: ieee802154: document L1/L2 sep. of concerns
The method ieee802154_radio_handle_ack() does not belong to the
PHY/radio layer but to the L2 layer. It is a callback called from the
radio layer into the L2 layer and to be implemented by all L2 stacks.
This is the same pattern as is used for ieee802154_init(). The
'_radio_' infix in this function is therefore confusing and
conceptually wrong.

This change fixes the naming inconsistency and extensively documents
its rationale.

It is assumed that the change can be made without prior deprecation of the
existing method as in the rare cases where users have implemented custom
radio drivers these will break in obvious ways and can easily be fixed.

Nevertheless such a rename would not be justified on its own if it were
not for an important conceptual reason:

The renamed function represents a generic "inversion-of-control" pattern
which will become important in the TSCH context: It allows for clean
separation of concerns between the PHY/radio driver layer and the
MAC/L2 layer even in situations where the radio driver needs to be
involved for performance or deterministic timing reasons. This
"inversion-of-control" pattern can be applied to negotiate timing
sensitive reception and transmission windows, it let's the L2 layer
deterministically timestamp information elements just-in-time with
internal radio timer counter values, etc.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-06-17 16:20:21 -04:00
Bjarki Arge Andreasen 22152915ab drivers/gsm_ppp: Update existing modules to use PPP L2
This commit replaces the workarounds spread around the
drivers and subsystems with the updated PPP L2
interface.

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-06-17 07:46:21 -04:00
Andrei Hutanu be04e30a88 samples: net: mqtt_azure: hotfix stack overflow
running samples/net/cloud/mqtt_azure in QEMU with default
configuration crashes with exception. This PR change doubles
the default workqueue stack size in a attempt to fix the issue
reported in: GH#58930.

Signed-off-by: Andrei Hutanu <andrei.hutanu.i@gmail.com>
2023-06-14 09:12:08 -04:00