Use Devicetree to describe the UART UPIPE IEEE 802.15.4 driver. This
allows to remove usage of IEEE802154_UPIPE_DRV_NAME in preparation for
the removal of NET_CONFIG_IEEE802154_DEV_NAME.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
samples should not use CONFIG_TEST_EXTRA_STACK_SIZE, instead, they
should set the recommended stack size directly.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
For further details about interoperability testing please see
* https://lwm2m.openmobilealliance.org/ - Test V1.1 12-Sep-2019
Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
Make sure that the network interface is up before running the sample.
Otherwise, the sample could stop rightaway due to send failure.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
First off, fix the FD check when closing a socket - currently not all
sockets were closed on exit (0 is also a valid file descriptor).
Second issue is the use of k_thread_abort() on tx/rx threads. The
receving thread was blocked in recv(), and aborting its thread prevented
it from ending gracefully (i. e. the socket mutex allocated in recv()
was not released as the function did not exit properly). This resulted
on a consecutive `close()` call lock. Fix this by setting a timeout on a
receiving socket, and instead of aborting threads allowing them to exit
gracefully.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Sample code uses GPIO api's but wasn't enabling CONFIG_GPIO. So
on native_posix this would cause the sample to not build. Add
CONFIG_GPIO=y to prj.conf to fix this.
Fixes#48306
Signed-off-by: Kumar Gala <galak@kernel.org>
Add support for running the SocketCAN sample on
native_posix/native_posix_64 using the CAN loopback interface.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Created the variable CONFIG_LWM2M_SERVER_DEFAULT_SSID to be
the default ssid when not using bootstrap. Needed for access control.
Signed-off-by: Ola Tangen Kulseng <ola.kulseng@nordicsemi.no>
Move the CAN bus network driver from drivers/can to drivers/net as it
implements a network driver, not a CAN controller driver.
Use a separate Kconfig for enabling the CAN bus network driver instead of
piggybacking on the SocketCAN Kconfig. This allows for other
(e.g. out-of-tree) SocketCAN transports.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.
Signed-off-by: Kumar Gala <galak@kernel.org>
The use of DT_BUS_LABEL in a logging call can easily be replaced
with uart_dev->name. This moves us slowly forward to removing
use of devicetree `label` property.
Signed-off-by: Kumar Gala <galak@kernel.org>
We don't have anything that build tests the win1500 driver, so
enable reel_board to provide coverage on the driver.
Signed-off-by: Kumar Gala <galak@kernel.org>
In the Zephyr implementation, `sem_timedwait()` uses a
potentially wildly different timebase for comparison via
`k_uptime_get()` (uptime in ms).
The standard specifies `CLOCK_REALTIME`. However, the real-time
clock can be modified to an arbitrary value via clock_settime()
and there is no guarantee that it will always reflect uptime.
This change ensures that `sem_timedwait()` uses a more
consistent timebase for comparison.
Fixes#46807
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Logging v1 has been removed and log_strdup wrapper function is no
longer needed. Removing the function and its use in the tree.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Cocinelle complains about "shell" being used as a parameter name:
"Violation to rule 5.7 (Tag name should be unique) tag: shell"
Therefore rename the parameter throughout the sample to "sh".
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Rewrite the TCP/UDP download part of the zperf sample to use socket API.
For UDP, performance impact is negligible (< 1 Mbps), for TCP it's
noticable, but still throughputs can be considered satisfactory (up to
~75 Mbps).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Rewrite TCP/UDP upload part of the zperf sample to use socket API
instead of net_context. This has a negligible impact on the upload
throughputs (< 1 Mbps).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This code has gone unmaintained and bugs continue to be reported
against it. We do not have the resources as a project to maintain this
in "odd fixes" mode, and nobody has stepped up to maintain it [1], so
sadly this must be removed for now.
If anyone would like to see civetweb supported in upstream Zephyr
again, they are welcome to add it back, as long as they promise to
maintain it going forward.
Many thanks to everyone who has contributed to civetweb support in
Zephyr while it was here. So long and thanks for all the fish.
Fixes: #45807Fixes: #43910Fixes: #34226Fixes: #46743
[1] https://lists.zephyrproject.org/g/devel/message/8466
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Remove v1 implementation from log_core and all references in the tree.
Remove modules used by v1: log_list and log_msg.
Remove Kconfig v1 specific options.
Remove Kconfig flags used for distinction between v1 and v2.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
...v1.1 overlay
Shows the dependencies which makes it easier to enable the content
format when necessary
Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
This sample app uses a stack buffer to hold the interface name which is
generated at runtime using sprintk. The buffer is only sized for the
expected range of values, not the full possible range of the datatype
(int).
To mitigate this, increase the size of the buffer to hold the full range of
an int value.
Signed-off-by: Keith Packard <keithp@keithp.com>
By default, any string or opaque data that LwM2M engine initializes
sets data lenght to same value as given buffer length for that
resource.
However, on run time, engine keeps track how much data is written
to each resource, so when reading from any resource, should only
return data that has been written there. But uninitialized resources
return the content of the whole buffer.
Fixed the problem by introducing macros INIT_OBJ_RES_LEN(),
INIT_OBJ_RES_MULTI_DATA_LEN() and INIT_OBJ_RES_DATA_LEN() that
allows you to give the amount of data existing in buffer when
the resource is initialized. This sets the data_len and max_data_len
variables correctly.
Also introduced new functions lwm2m_engine_get_res_buf() and
lwm2m_engine_set_res_buf() that distinct between data size and
buffer size. Deprecated the previous functions
lwm2m_engine_get_res_data() and lwm2m_engine_set_res_data()
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
This dependency it is not required since majoprity of platforms are
working with new pinctrl API. This drops the pinmux dependency.
Fixes#46091
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Since the recent OpenThread update, OT needs more stack to initialize,
therefore bump the stack size in samples using OpenThread.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Convert the can_mode enum to a bit field to prepare for future extensions
(CAN-FD mode, transmitter delay compensation, one-shot mode, 3-samples
mode, ...).
Rename the existing modes:
- CAN_NORMAL_MODE -> CAN_MODE_NORMAL
- CAN_SILENT_MODE -> CAN_MODE_LISTENONLY
- CAN_LOOPBACK_MODE -> CAN_MODE_LOOPBACK
These mode names align with the Linux naming for CAN control modes.
The old CAN_SILENT_LOOPBACK_MODE can be set with the bitmask
(CAN_MODE_LISTENONLY | CAN_MODE_LOOPBACK).
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Remove ESP32 and ESP32S2 from not working samples
and tests. Reason for not working is not enough memory
space in RAM to execute it. This can be worked out as next steps.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
In order to bring consistency in-tree, migrate all samples to the use
the new prefix <zephyr/...>. Note that the conversion has been scripted:
```python
from pathlib import Path
import re
EXTENSIONS = ("c", "h", "cpp", "rst")
for p in Path(".").glob("samples/**/*"):
if not p.is_file() or p.suffix and p.suffix[1:] not in EXTENSIONS:
continue
content = ""
with open(p) as f:
for line in f:
m = re.match(r"^(.*)#include <(.*)>(.*)$", line)
if (m and
not m.group(2).startswith("zephyr/") and
(Path(".") / "include" / "zephyr" / m.group(2)).exists()):
content += (
m.group(1) +
"#include <zephyr/" + m.group(2) +">" +
m.group(3) + "\n"
)
else:
content += line
with open(p, "w") as f:
f.write(content)
```
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
With LwM2M v1.1 SenML CBOR is preferred over SenML JSON.
TLV is on by default only with v1.0.
Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
Makes possible to enable LwM2M protocol v1.1 features. Uses SenML JSON
as default content format.
Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
Changes console blocks in hello_world and magic_wand tflite-micro
samples to Kconfig blocks to match content. Fixes typos in
some networking samples so that code blocks display instead
of being hidden. Fixes path to litex-vexriscv-tflite.resc.
Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
Add loopback mode config to the sample so that the code
can be tested without an actual CAN network, but wit a
single board.
Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
Until now the whole USB device stack code is located
in the top subsys/usb directory. Move it to own directory
in preparation for upcoming extension and rework of USB support.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Some names of the test cases are duplicated within the project.
This commit contains the proposed names of the test scenarios.
Signed-off-by: Katarzyna Giadla <katarzyna.giadla@nordicsemi.no>
- strtoll() and strtoull() are copies of strtol() and strtoul() with
types changed to long long instead of long.
- added tests
- added documentation
- removed stubs from civetweb sample
Signed-off-by: Gerhard Jörges <joerges@metratec.com>
The gsm modem should be able to be started or stopped freely,
independent from the networking state.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
The `starting` flag causes the sample to work only if
GSM_PPP_AUTOSTART is enabled, its initial value should be
dependent on GSM_PPP_AUTOSTART.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
As the receive window is now decreased at the TCP module level, other
direct net_context users are also responsible for acknowledging the
received data with net_context_update_recv_wnd() - otherwise, the
communication will stall.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Kconfig options now belong to the Kconfig domain, therefore, the
:kconfig:option: role needs to be used.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
- Filter out the remaining CAN tests if no zephyr,canbus chosen node is
enabled in the devicetree.
- Rename the tests to shorten the name a bit.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Register modem power callbacks to show how it can be
used to provide e.g modem power on and off sequences.
Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
In applications where timing is critical it seems like enabling
deferred log mode could be desirable.
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
Co-authored-by: Seb Laveze <sebastien.laveze@nxp.com>
Signed-off-by: Xabier Marquiegui <xmarquiegui@ainguraiiot.com>
A common pattern here was to take the work item as the subfield of a
containing object. But the contained field is not a k_work, it's a
k_work_delayable.
Things were working only because the work field was first, so the
pointers had the same value. Do things right and fix things to
produce correct code if/when that field ever moves within delayable.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Disable Ethernet on SocketCAN sample because some Ethernet
drivers cannot operate on such small buffers.
Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
It is documented as unsigned in
samples/net/sockets/big_http_download/Kconfig
Signed overflow is undefined behavior, unsigned is not. This fixes the
following warning:
-Wstrict-overflow=1
samples/net/sockets/big_http_download/src/big_http_download.c:346:2:
In function 'main':
error: iteration 2147483648 invokes undefined behavior
[-Werror=aggressive-loop-optimizations]
346 | } while (--num_iterations != 0);
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Avoid endless loop in `case MQTT_EVT_PUBLISH`
Fail on any error for mqtt_read_publish_payload_blocking, inc. -EAGAIN.
Fixes zephyrproject-rtos#40965
Signed-off-by: Jeffrey Urban <jeffrey@jeffreyurban.com>
The sample did not specify any tests in its sample.yaml file, causing CI
failures.
Additionally, the sample requires to generate secure key before building
the sample, otherwise the build fails. For the CI needs, specify a dummy
test key, which is only included if the build was triggered by Twister.
For this, specify a USE_DUMMY_KEY variable in the sample.yaml file.
Finally, fix some minor build issues in the sample itself - remove
unused variable, and remove deleted (and also unneeded) mbed TLS header
inclusion.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Many documents relied on single quotes to create references, e.g.
`my_reference`. This is possible because `default_role = "any"` is
enabled in Sphinx conf.py. However, this method comes with its problems:
- It mixes all domains together, so it's not clear to what are you
referencing: a document? a Kconfig option? a C function?...
- It creates inconsistencies: in some places explicit roles are used
(e.g. :ref:`my_page`) while in some others not.
- _Conflictis_ with markdown. Single quotes are used for literals in
Markdown, so people tend to use the same syntax in Sphinx, even though
it has a different purpose.
Usages have been found using `git grep ' `[^`]*` ' -- **/*.rst`.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Replace deprecated macro USBD_CFG_DATA_DEFINE by
USBD_DEFINE_CFG_DATA which places usb_cfg_data structures
in specific iterable section.
Replace __usb_data_start, __usb_data_end usage patterns
size_t size = (__usb_data_end - __usb_data_start);
for (size_t i = 0; i < size; i++) {...}
by
STRUCT_SECTION_FOREACH(usb_cfg_data, ...) {...}
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The gsm_ppp.h is currently in include/drivers/modem directory
so change the path accordingly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The sample oversimplified the observe mechanism a bit - instead of
making use of CoAP APIs to verify the packets received (if they are
actually notifications for the observe) it blindly assumed that any
received packet was a notification. This could be misleading for
potential users of the CoAP library, as the sample had little use as
a reference for the Observer functionality.
Fix this by making use of `coap_reply` structure and a corresponding
`coap_response_received()` function.
Additionally, make the observe cancellation compliant with the CoAP
specification - it should be either an empty Reset message, or a GET
request with Observe option set to 1. The sample used invalid
construct of a Reset message with Observe option. For the purpose of
the sample, use the latter option.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The sample intended to send an empty ACK for the notification message
(response code equal to 0), yet it included a token in the ACK reply
(which is not correct for an empty ACK).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add support for both Observe cancellation methods - empty Reset reply
(in place of ACK) and GET message with Observe option set to 1.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The documentation of the sample refers IPv6 instead of IPv4.
Additionally, the coexisting coap_client sample also uses IPv6 by
default. Therefore, switch the sample default configuration to use IPv6
instead of IPv4.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Arduino compatible boards should have a working UART on pin 0 & 1.
On frdm_k64f this is handled by uart3
Unfortunately pinmuxing of uart3 was destroyed when enabling NETWORKING,
because the uart3 RX/TX pins was reconfigured for 1588 timers.
1588 timers are enabled by the enet child node, ptp which by some reason
is enabled by default.
1588 timers aren't needed in most cases when ethernet is being used,
so this fix ensures ptp is by default disabled. Likewise pinmuxing of
the 1588 timer functionality is now dependant of ptp being active
Signed-off-by: Kim Bøndergaard <kim.boendergaard@escoglobal.com>
The supported protocol must be delivered to the firmware update object
as optional, then configured in the application.
This information is device/server dependent so does not can be fixed
in library.
Signed-off-by: Jair Jack <jack@icatorze.com.br>
Replace unpacked in6_addr structures with raw buffers in net_ipv6_hdr
struct, to prevent compiler warnings about unaligned access.
Remove __packed parameter from `struct net_6lo_context` since the
structure isn't really serialized.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Replace unpacked in_addr structures with raw buffers in net_ipv4_hdr
struct, to prevent compiler warnings about unaligned access.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Added an observe callback so that the application can register to
receive events like observer added/deleted, and notification acked/
timed out. The notifications can be traced back to the exact data
contained within them by use of the user_data pointer.
Fixes#38531.
Signed-off-by: Maik Vermeulen <maik.vermeulen@innotractor.com>
In the current USB device support, the sizes of bulk endpoint
are mostly configure through Kconfig and do not care if a device
is high-speed capable. The information if a USB device controller
supports high-speed comes from devicetree. Add a Kconfig option to
map this information and configure bulk endpoint sizes
accordingly.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This changes k_mem_domain_init() to return error values
instead of asserting when errors are encountered.
This gives applications a chance to recover if needed.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Not handling telnet commands may lead to some unexpected behaviour, like
telnet client locking when it does not receive a response for DO TIMING
MARK command.
Therefore enable it by default in the sample to improve user exprience.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
TCP2 is no longer needed as it is the unique implementation since the
legacy one has been removed.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
- Add a `log_strdup` to the role text output for logging V1
compatibility
- Fix style issues
- Change where the documentation refers to an OpenThread device as
"himself" to "itself"
Signed-off-by: Chris Pearson <ctpearson@gmail.com>
If CONFIG_NET_LOG=y is set, OpenThread will output the current OT
role whenever the state changes.
To simplify understanding of the log output, this change replaces
the numerical role ID with the text name of the role. This also
required a change to a documentation file to replace an instance
of a numerical ID.
NOTE: This is potentially a breaking change should anyone be using
test scripts that monitor the OpenThread state changes and look
for the numerical ID. This does not seem to be the case for the
Zephyr tests, however.
Signed-off-by: Chris Pearson <ctpearson@gmail.com>
The root CA used so far (GlobalSign R2) is about to expire soon
(December 2021) and Google have switched to a new certificate, signed by
GlobalSign R1 (valid until 2028). Therefore we need to replace the
root CA used by the sample to the new one, in order to establish secure
connection to with google.com.
Additionally, the new certificate chain sent by Google is larger again,
so it's needed to increase mbed TLS max content length parameter in
order to process it correctly. This also implies an increase in heap
usage, so increase the heap size as well.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
After commit eeb15aa393 ("timer: hpet: enable 64 bit mode for
better usages") was applied, main thread stack usage on qemu_x86
platform increased from 984 to 1040 bytes.
Default stack size, which is 1024, is no longer enough. Change that to
1536 to make sure this sample runs correctly on qemu_x86.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Replace the custom float32_value_t LwM2M type with native double, to
facilitate LwM2M API and improve floating point precission.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit allows let build echo_server sample with
overlay-netusb.conf.
USB subsystem must be enabled by the application.
Signed-off-by: Stephan Linz <linz@li-pro.net>
Fixes: #38403
Adding NET_DRIVERS menuconfig so that network drivers are grouped
together in its own menu entry under drivers, similar to most other
drivers.
This further has the advantages that `CONFIG_NET_DRIVERS` can be used
for testing to determine if network drivers has been selected.
This changed revealed a dependency loop where both `select` (for SLIP)
and `depends` (for PPP) which both depends on NET_DRIVERS` where in use
in the dependency tree for Qemu networking, especially NET_SLIP_TAP.
This is handled by defaulting `NET_DRIVERS` to `y` when building for a
Qemu target.
`SLIP` had a dependency to `!QEMU_TARGET || NET_QEMU_SLIP`. This is
changed so that SLIP prompt depends on `!QEMU_TARGET` which provides
full user control in hardware but makes the symbol promptless on Qemu
targets.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Finetune coap_server sample parameters for better user experience.
Reduce the maximum retransmission count to release resources earilier in
case client is unreachable and no longer responds. Increase the maximum
number of pending retransmissions, along with the heap size (the buffers
for messages are allocated on a heap), to improve sample responsiveness,
in case multiple unreplied messages are pending retransmission.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
In case no reply is received for notification message, remove the
corresponsding observer since it's no longer reachable, freeing slot for
another one.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The retransmission handler only increased the retransmission count, w/o
sending the actual message again. Additionally, the next retransmission
time calculation was broken - it did not take into consideration the
time that has already passed since before retransmission, and re-applied
the entire timeout value.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
When using the IEEE802154 radio interface in CONFIG_IEEE802154_RAW_MODE,
there is no way to handle ack frames because of the dummy implementation
of ieee802154_radio_handle_ack() in the ieee802154_radio header file.
Removed the dummy implementation from the header so you can/need to
implement it in the application.
samples: added implementation of ieee802154_radio_handle_ack() to
wpan_serial and wpanusb sample
Signed-off-by: Gerhard Jörges <joerges@metratec.com>
From 2.4 to 2.7 the net samples pair echo-server/client increase the
SRAM requirements. This adjusts example features to free necessary SRAM
to run example.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
These are getting build failures due to some kind of devicetree
console definition missing. These devices don't do networking, and
strictly don't even have a proper console device (logging is done via
a host mechanism). Probably fixable. Not worth the trouble. Filter.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Rework NCP interface configuration and NCP sample. Remove
CONFIG_OPENTHREAD_COPROCESSOR_SPINEL_ON_UART_DEV_NAME and
CONFIG_OPENTHREAD_COPROCESSOR_SPINEL_ON_UART_ACM Kconfig
options in favor of chosen node zephyr,ot-uart usage.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add app.overlay which contains cdc-acm-uart node.
Rework sample to get CDC ACM UART device from devicetree.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Move to CMake 3.20.0.
At the Toolchain WG it was decided to move to CMake 3.20.0.
The main reason for increasing CMake version is better toolchain
support.
Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Regular OpenThread upmerge to bring in a fix for a possible
infinite loop and support for DNS service subtypes.
Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
CONFIG_DEBUG_OPTIMIZATIONS should not be enabled by default in
prj.conf for tests or samples. Remove it from a few places that it
is.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Configure a timeout for send/recv operations so that the sample can
recover in case the connection stalls (for instance due to IP address
change on an interface).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The Google server that the sample connects to sends a larger certificate
since recently. As the overall size of the message conveying the
ceritificate is ~4700 bytes now, current mbedTLS configuration did not
allow to reassemble the message and thus caused failure during the
handshake.
Fix this by increasing MBEDTLS_SSL_MAX_CONTENT_LEN parameter (with some
extra space for any future changes).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The Let's Encrypt X3 certificate is no longer in use, replace it with an
up-to-date certificate.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
When a WIFI driver is slow to get interface up the system not connect
to WIFI access point. This add some tries to let driver be proper
initialize to allow accept connection request.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
The sockaddr address length was not initialized properly
when receiving packets.
Coverity-CID: 232698
Fixes#35159
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
In Mbed TLS:
commit eccd88871767e2fba5f3a079cfdfcb77c376cf20
Author: Gilles Peskine <Gilles.Peskine@arm.com>
Date: Tue Mar 10 12:19:08 2020 +0100
Rename identifiers containing double-underscore
changes the name of a symbol we use. As part of upgrading to newer
versions of Mbed TLS, change the name of the symbol we use.
A better fix would be to not use this symbol at all, and perhaps define
our own symbol the same way this internal symbol is defined within the
library.
Signed-off-by: David Brown <david.brown@linaro.org>
Refactor and simplify the bluetooth buffer configurations to improve the
easy of configurations and eliminate invalid ones.
By moving configurations out of host and controller specific
configurations and into a common one it becomes easier to configure
the host and controller separately as the same configurations can be
used as would be for a combined build.
All HCI configurations are now given exluding the matching HCI header,
which eases the configuration as the application don't have to know the
different header sizes.
The BT_RX_BUF_LEN is split into ACL and Event, as well as the suprising
use of Command size.
BT_L2CAP_RX_MTU is removed as the stack does not support reassembling of
HCI ACL data to larger L2CAP PDUs. The application will have to set
ACL RX size and account for the L2CAP PDU header itself.
BT_EATT_RX_MTU was removed as it is only used for setting a different
default value for another option which leads to the stuck kconfig symbol
problem.
The configurations can be updated according to the table below:
** New configuration | ** Old configuration
All configurations
BT_BUF_ACL_RX_SIZE | BT_L2CAP_RX_MTU + 4
BT_BUF_ACL_RX_SIZE | BT_RX_BUF_LEN - 4
BT_BUF_EVT_RX_SIZE | BT_RX_BUF_LEN - 2
BT_BUF_CMD_TX_SIZE | BT_RX_BUF_LEN - 3
BT_BUF_CMD_TX_COUNT | BT_HCI_CMD_COUNT
BT_BUF_EVT_RX_COUNT | BT_RX_BUF_COUNT
BT_BUF_ACL_RX_COUNT | BT_RX_BUF_COUNT
BT_BUF_ACL_RX_COUNT | BT_ACL_RX_COUNT
BT_BUF_EVT_DISCARDABLE_SIZE | BT_DISCARDABLE_BUF_SIZE - 2
BT_BUF_EVT_DISCARDABLE_COUNT | BT_DISCARDABLE_BUF_COUNT
Controller-build
BT_BUF_ACL_TX_SIZE | BT_CTLR_TX_BUFFERS_SIZE
BT_BUF_ACL_TX_COUNT | BT_CTLR_TX_BUFFER
HCI-bridge
BT_BUF_ACL_TX_SIZE | BT_HCI_ACL_DATA_SIZE
BT_BUF_ACL_TX_COUNT | 6
Fixed invalid configurations setting either BT_L2CAP_RX_MTU or
BT_CTLR_DATA_LENGTH_MAX larger than BT_RX_BUF_LEN could lead to buffer
overruns.
Fix advertising report max data length calculation.
This always used the BT_DISCARDABLE_BUF_SIZE macro but this feature
can be turned off and advertising reports will be allocated from the RX
buffer in that case. Also controller-build does not have this buffer
(in hci_raw.c). Also the wrong HCI header was used in the calculation,
HCI event header should have been used instead of HCI ACL header.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Coprocessor sample was lacked of test configuration which makes
buildkite/zephyr to fail. This commit fixes it by providing test
configuration for this sample.
Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
The device has sent RESET_POWER_UP message before the communication
with the host hadn't been established. It could be observed with
pyspinel which displayed `Framing error`.
This commit fixes the bug by initializing NCP after the host stated
is ready to communicate.
This commit reverts initialization the USB stack into function
otPlatUartEnable to be consistent with others OpenThread platforms.
OpenThread co-processor samples are not affected by #27071 as they use
USB for SPINEL communication with host and not for UART console.
Note:
When co-processor communicates by USB CDC ACM and it is hard reset
(what is happening in current Zephyr OpenThread platform)
the connection needs to be properly handled by the host.
For posix platform used together with RCP it was implemented in:
https://github.com/openthread/openthread/pull/6454
and for NCP:
https://github.com/openthread/wpantund/pull/492 .
Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
This application shows how to use SO_TXTIME option, which can be
used to specify the time when the network packet should be sent
out by the network device driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This option was only able to collect statistics of transmitted
data. The same functionality is available if one sets the
CONFIG_NET_PKT_RXTIME_STATS and/or CONFIG_NET_PKT_TXTIME_STATS
options.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The conn_raw_input() in connection.c will clone the incoming
packet so that it is possible to receive socket data in
multiple packet sockets. This is all fine except that if the
socket is never calling recv(), then the cloned net_pkt is never
processed and we will have a memory leak.
What this all means in practice, is that we should call recv()
for every packet socket in order to flush the socket for any
incoming data even if the socket is just sending data.
Fixes#34462
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The sample uses generate_inc_file_for_target for some "webpages" that
get included. However, the directory that the generated files are
put into: ${ZEPHYR_BINARY_DIR}/include/generated/web_page isn't
created and thus the build fails.
Add a simple 'file(MAKE_DIRECTORY ..)' to create the dir.
Fixes#34345
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Remove board code and a few associated samples/tests that explicitly
call pinmux_pin_set() to set a given pin as GPIO. This is handled as
part of gpio_mcux_configure() so we don't need to do it again.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Replace all existing deprecated API with the recommended alternative.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add an overlay-capture.conf file that can be used to allow network
packet capturing in this sample app.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
A simple application that allows you to use net-shell to
configure network packet capturing. The captured packets are
sent to external systems for processing. This can be used
for debugging network protocols.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Remove legacy TCP stack as it is replaced by the new TCP2 stack.
The TCP2 stack has been the default stack since 2.4 release.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Civetweb does not work properly with mbedtls if Posix APIs
are enabled. For example time function prototypes are not found
by the mbedtls module if we enable mbedtls in the sample.
Disable TCP ISN RFC6528 support because of this for civetweb
samples, as setting that option will pull in mbedtls and
we get a compilation warning because time() is not declared
by any header file that mbedtls is including.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Remove SPI_[0-8] and SPI_[0-8]_OP_MODES Kconfig symbols as no driver
uses them anymore. We also cleanup board and sample code to remove
use of these symbols.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Currently there is no way to distinguish between a caller
explicitly asking for a semaphore with a limit that
happens to be `UINT_MAX` and a semaphore that just
has a limit "as large as possible".
Add `K_SEM_MAX_LIMIT`, currently defined to `UINT_MAX`, and akin
to `K_FOREVER` versus just passing some very large wait time.
In addition, the `k_sem_*` APIs were type-confused, where
the internal data structure was `uint32_t`, but the APIs took
and returned `unsigned int`. This changes the underlying data
structure to also use `unsigned int`, as changing the APIs
would be a (potentially) breaking change.
These changes are backwards-compatible, but it is strongly suggested
to take a quick scan for `k_sem_init` and `K_SEM_DEFINE` calls with
`UINT_MAX` (or `UINT32_MAX`) and replace them with `K_SEM_MAX_LIMIT`
where appropriate.
Signed-off-by: James Harris <james.harris@intel.com>
We need to set a proper IPv4 netmask to each VLAN interface
so that IPv4 source address selection will work properly.
If we do not do this, then the network interface could be
selected incorrectly for the VLAN interfaces which could then
mean that the packet might get dropped by the target device.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Switch to use DEVICE_DT_GET instead of device_get_binding for pinmux
device. As part of this change drop the "label" property from
the pinmux devicetree node and update the binding and dts files to
reflect that.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
socket_can_generic.h makes some assumptions that are not always valid
for various drivers with regards to numbering. To clean this up we
add defines for SOCKET_CAN_NAME_0 and SOCKET_CAN_NAME_2 in addition to
SOCKET_CAN_NAME_1.
We also move struct socket_can_context into the drivers themselves
since they know best how many CAN interfaces are getting supported and
what naming/number convention they'd have.
Additionally, this also exposes a few other build issues with the
can_mcux_flexcan driver that get fixed.
Finally, we remove the platform_allow from samples/net/sockets/can
since it is no longer needed.
Fixes#31733
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This patch replaces magic numbers with COAP_TOKEN_MAX_LEN value and
removes unnecessary castings of token buffer type.
Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
RFC 7252 (CoAP) specifies value of the Version (Ver) field in the
protocol header to value 1. This patch defines value of the Version
field to make packet initialization easier. All samples and tests
are updated to use the new COAP_VERSION_1 field when initializing
a CoAP packet.
Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
After the latest upmerge, OpenThread requires explicit configuration
of the Master Key. This commit adds a Kconfig symbol that can be
used to setup its value. By default no Master Key is configured and
OpenThread generates a random one.
The Sockets Echo samples are configured with a fixed key with this
commit.
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
If CONFIG_LOG_BACKEND_NET_AUTOSTART is disabled, then the syslog
network backend is not started automatically. This option is
enabled by default but it might be that application needs to
start the backend manually if the network is slow to start or
some special routes needs to be set by the application.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This patch introduces COAP_TOKEN_MAX_LEN definition in coap.h file.
This definition replaces magic number across CoAP protocol
implementation and CoAP samples.
Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
Clean up logging menuconfig by grouping configuration into
sections like: mode, processing configuration, backends.
Additionlly, removed LOG_ENABLE_FANCY_OUTPUT_FORMATTING which is no
longer in use.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Due to the routing, the ip_k66f board can only use RTT to export
console. With this change the SHELL is enabled to get access
to network commands (like ping).
To use it with RTT from Segger:
-------------------------------
On HOST (terminal 1):
./JLink_V664/JLinkRTTLogger -Device MK66FN2M0XXX18 -RTTChannel 1 \
-if SWD -Speed 4000 ~/rtt.log
On HOST (terminal 2):
nc localhost 19021
(19021 is the port number for the Segger RTT server)
Signed-off-by: Lukasz Majewski <lukma@denx.de>
The 'local-mac-address' nodes are helpful for assessing if the LLDP like
example of DSA switch works correctly.
As those are used only for testing (or when user explicitly needs them),
those are added as DTS overlay to DSA example.
The 'local-mac-address' properties will be visible when one assess the
LLDP response from ip_k66f board (each LAN port has different IP
assigned).
Example output from 'tcpdump -v -i eth0':
-----------------------------------------
Chassis ID TLV (1), length 7
Subtype MAC address (4): 00:00:12:13:00:37 (oui Unknown)
Port ID TLV (2), length 7
Subtype MAC address (3): 00:00:12:13:00:37 (oui Unknown)
Time to Live TLV (3), length 2: TTL 120s
System Name TLV (5), length 13: ip_k66f LAN:3
End TLV (0), length 0
Signed-off-by: Lukasz Majewski <lukma@denx.de>
This patch brings simple example on per DSA port LLDP filtering based on
MAC address of received packet.
Each lan1, lan2 and lan3 ports handle separately LLDP packets going into
them.
Nonetheless, the K66F ENET handles correctly all other packets types -
to be more specific - ICMP, TCP/IP.
Setup -> ON HOST:
Configure/start the lldpd daemon (debian 10) on host to use
MAC 01:80:c2:00:00:03:
(lldpd -ddd & ) && sleep 2 && \
lldpcli configure lldp agent-type nearest-non-tpmr-bridge
Signed-off-by: Lukasz Majewski <lukma@denx.de>
CoAP protocol defines registry of Content-Format option values.
This patch adds this enumeration to coap header file to make it
available to all applications using CoAP protocol. It modifies
code using CoAP service to use new enumeration.
Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
Introduce retransmission counter to the coap_pending structure. This
allows to simplify the retransmission logic and allows to keep track of
the number of remaining retranmissions.
Additionally, extend the `coap_pending_init()` function with `retries`
parameter, which allows to set the retransmission count individually for
each confirmable transaction.
Fixes#28117
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Since the additional objects are only added for compilation, enable
them in sample.yaml instead, so that they get built by the CI. Remove
them from the actual sample, as they obfuscate the sample purpose and
the objects visible from the server perspective.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
BLE and LwM2M grew in terms of RAM usage so that the sample does not
fit into nRF52832 anymore in the default configuration. This cause
twister to report an error when overflows errors are enabled.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This fixes an incorrect error message log statement for IPv4 vs.
IPv6 in several net samples.
The error message is in a portion of the files dealing with IPv4
bring-up. If the address is invalid, it logs the invalid address;
however, the IPv4 statement incorrectly refers to ipv6_addr. This
PR corrects it to output ipv4_addr as expected.
Signed-off-by: Steve Winslow <steve@swinslow.net>
This commit replaces the 'select SHELL' statement with
'depends on SHELL' in OPENTHREAD_SHELL config option.
This ensures, that shell will not be implicitly enabled
when OpenThread stack is built.
Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
Reordering of the struct elements to match the Linux format.
The __packed() is not necessary anymore.
std_id and ext_id is merged to id in the frame and filter.
Additionally, the frames are ready for CAN-FD.
Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
some tests configured with CONFIG_NEWLIB_LIBC=y,
it's better to add a filter filter: TOOLCHAIN_HAS_NEWLIB == 1
in those tests yaml file.
Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
A dedicated LwM2M execute callback type has been implemented which
supports execute arguments. The lwm2m engine, lwm2m_client sample and
lwm2m objects have been updated accordingly. Also the API change has
been documented, and the lwm2m engine reference has been updated.
Fixes#30551.
Signed-off-by: Maik Vermeulen <maik.vermeulen@innotractor.com>
- Remove SYS_ prefix
- shorten POWER_MANAGEMENT to just PM
- DEVICE_POWER_MANAGEMENT -> PM_DEVICE
and use PM_ as the prefix for all PM related Kconfigs
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Use the core k_heap API pervasively within our tree instead of the
z_mem_pool wrapper that provided compatibility with the older mempool
implementation.
Almost all of this is straightforward swapping of one alloc/free call
for another. In a few cases where code was holding onto an old-style
"mem_block" a local compatibility struct with a single field has been
swapped in to keep the invasiveness of the changes down.
Note that not all the relevant changes in this patch have in-tree test
coverage, though I validated that it all builds.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The k_mem_pool allocator is no more, and the z_mem_pool compatibility
API is going away. The internal allocator should be a k_heap always.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Mark all k_mem_pool APIs deprecated for future code. Remaining
internal usage now uses equivalent "z_mem_pool" symbols instead.
Fixes#24358
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The immediate logging option cannot be used with network logging
support CONFIG_LOG_BACKEND_NET as that would cause the generated
rsyslog messages to be malformed. The UDP packets would only have
one byte payloads which is not correct. So make sure that user is
not able to select a configuration with immediate mode and network
logging.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If user has enabled DHCPv4, then allow to use its address instead
of giving error if static address cannot be set. Similar fix for
IPv6, so allow user to manually set an IPv6 address.
Because DHCPv4 has already set the IPv4 address to the network
interface, then zperf might not be able to add the pre-configured
address to it. So instead of returning immediately, try to use the
IP address that is already in the network interface. This way we
avoid this error print.
uart:~$ zperf udp download 5001
Setting IP address 2001:db8::1
Setting destination IP address 2001:db8::2
Cannot set IPv4 address 192.0.2.1
Unable to set IP
Setting destination IP address 192.0.2.2
Cannot set IPv4 address 192.0.2.1
Unable to set IPv4
Binding to 192.0.2.1
Cannot bind IPv4 UDP port 5001 (-2)
In this example, the network interface already had a proper and working
IPv4 address 192.168.0.2 in it.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Currently the code uses hw cycles and tries to convert them
to usec. I noticed some failures with this, for example the test
duration was sometimes missed meaning that instead of testing 5
seconds, we bailed out after 2 sec etc. After the kernel k_timeout_t
changes, which added APIs to support usec accuracy, we can use usec
and ticks here. This simplifies the code a bit.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
In native_posix, the code calls k_busy_wait() but with wrong
value (k_timeout_t instead of int).
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The current name Socket TagoIO HTTP Client still refering to directory
samples/net/sockets. Rename to TagoIO IoT Cloud HTTP Sample to reflect
better the application sample intention.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
There are some hardware combinations (board/shields) that report the
error undefined initialization levels used at link phase. Add pinmux
Kconfig at project configuration to fix the issue.
Fixes#30029.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
move all CivetWeb samples to one directory
add directory with CivetWeb common includes
update cmake files
move civetweb sample folder to samples/net
Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
The test script http-get-file-test.sh will send a POST to inform
whether the test was ok or not. This is needed so that we can
test the TLS functionality properly, earlier use of netcat would
not do TLS handshakes.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The pass/fail return code was not returned to the caller in
Docker based testing so the runner script did not know if the
sample test passed or not.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The pass/fail return code was not returned to the caller in
Docker based testing so the runner script did not know if the
sample test passed or not.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Move actual test cases from the run-sample-tests.sh script to
the network samples directory that are supported by Docker based
testing. Each network sample directory that supports Docker testing,
will contain docker-test.sh script that is sourced by the runner
script. The docker-test.sh script will run the test as needed and
then return return value to the runner script.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If networking pre-emptive thread priorities are enabled,
then use the proper macro to enable them.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
* Add RCP library.
* Conditionally remove non required libraries not required for RCP.
* Drop :option: marker for CONFIG_OPENTHREAD_NCP_SPINEL_ON_UART_ACM
Signed-off-by: Markus Becker <markus.becker@tridonic.com>
Samples that include floating-point format specifications may need
cbprintf FP support. Make sure it's available.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Start the listeners after the "connected" event from connection
manager has been received.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the client sends OK or FAIL, then it means that we are run
under a test system and we should stop running and exit so that
the test runner (scripts/net/run-sample-tests.sh) can report
success or failure.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If user sets CONFIG_NET_SAMPLE_SERVE_LARGE_FILE then the sample
will return 100KB file. By default 2KB file is returned.
This is used by the Docker based testing.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This feature is used by scripts/net/run-sample-tests.sh script
which connects the Zephyr gPTP sample to Linux gPTP daemon running
on a Docker container.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add support for CONFIG_NET_SAMPLE_SEND_ITERATIONS option so that
this sample can be run multiple times against HTTP(s) server
that is running inside a Docker container.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This change enables support for DNS service discovery
(RFC 6763) in the mdns_responder service and sample app.
Fixes#29429
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
This change adds IEEE 802.15.4g (Sub GHz) support for the
cc1352r.
The 2.4 GHz radio and the Sub GHz radio are capable of
operating simultaneously.
Fixes#26315
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Add a simple backoff mechanism between consecutive registration attempts
in case of registration failures. Finally, notify the application in
case the registration failed several times.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Introduce TagoIO IoT Cloud HTTP post client example. This explorer
Zephyr network resources to demonstrate an end to end application.
The TagoIO allows that any user can test on a easy way Ethernet, WIFI
and Modem (PPP) with BSD sockets. The example provides overlays to
configure WIFI and Modem.
The application consists an a pseudo temperature sensor that sends
periodically data to TagoIO IoT Cloud platform. The data can be
visualized on a web browser dashboard, cellphone or tablet. The
steps to configure TagoIO are described on the example documentation.
Special Variables:
- CONFIG_TAGOIO_DEVICE_TOKEN DEVID token generated by TagoIO
- CONFIG_TAGOIO_HTTP_WIFI_SSID SSID when using WIFI
- CONFIG_TAGOIO_HTTP_WIFI_PSK PASSWD when using WIFI
- CONFIG_MODEM_GSM_UART_NAME UART label when using MODEM
- CONFIG_MODEM_GSM_APN APN when using MODEM
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
The sample was producing quite a few `<log_strdup alloc failed>`
warnings when running in default configuration on qemu_x86. Increase the
log_strdup buffer count to prevent that.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add bootstrap section to the documentation, explaining how to configure
the Leshan Demo Bootstrap Server locally and run the sample.
Update the download link for the Leshan Demo Server, according to the
upstream Leshan documentation.
Fix bullet list with Leshan security parameters.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add overlay-bootstrap.conf which allows to easily configure the sample
to use the bootstrap server.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The es-WIFI driver is used by Inventek's es-WIFI shields. This enables
wifi sample to build all variations to ensures that dependencies are
meet.
Signed-off-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
using CONFIG_NET_BUF_POOL_USAGE monitor avail_count,
this variable should be protect.
Protecting it by using atomic variable
Signed-off-by: Ehud Naim <ehudn@marvell.com>
It is useful to see the name of the handler thread for debugging
purposes so set it when starting the handler thread.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add commands to suspend or resume the GSM modem. These commands
might not be enough as at least the SIMCOM 808 modem requires
that the modem is reset when it is resumed, and this application
does not do any reset atm.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Testing the sample with Zephyr SDK 1.14 (vs 1.13) with qemu_x86
showed that it consistently crashes on 2th-4th iteration. Avoid
bite-sized increase this time, and dump stack considerably to
avoid constant need to update it.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Currently, after `CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP` is enabled,
the LwM2M engine will initiate bootstrap procedure on each run. This
approach limits the flexibility of the application, as it's not always
necessary to go over the bootstrap procedure (for instance, the
application may decide to store the security object obtained during the
bootstrap in flash, and restore it on boot).
Fix this by introducing an additional `flags` parameter to the
`lwm2m_rd_client_start()` function, which provides information whether
to run bootstrap in the current session or not.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Replace all calls to the assert macro that comes from libc by calls to
__ASSERT_NO_MSG(). This is usefull as the former might be different
depending on the libc used and the later can be customized to reduce
flash footprint.
Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
It's copy of openthread conf from samples/net/sockets/echo_client,
but requires increasing of main stack size to avoid crash.
Also fixes building if CONFIG_LWM2M_DTLS_SUPPORT is enabled #28787.
Signed-off-by: Kiril Petrov <retfie@gmail.com>
Remove obsolete include of the shell_uart.h file.
It is sufficient to include the shell.h file.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordisemi.no>
From 2.3 to 2.4 the net samples pair echo-server/client increase the
SRAM requirements. Since CI doesn't build all combinations, (even for
a release like 2.4.0-rc1) the problem was detected only now. Decrease
buffers for atsamr21_xpro on both echo_server/client sample pair.
Fixes#28341.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
After adding 'Multicast group filtering' (commit b7b73d0) server should
join CoAP IPv6 multicast group to accept multicast CoAP messages.
Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com>
Increase stack size to 1200 for echo and echo_async sample apps
(following a similar increase done to echo_async_select previously).
With default stack size, the apps no longer run (crash QEMU) with
Zephyr 2.4-pre.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
The default timeout used (500 ms) turns out to be too small for certain
servers (test.mosquitto.org), rendering it impossible to connect (the
TCP connection was closed before the actual Connect ACK response
arrived). Increase the connect timeout to cover this case.
Fixes#28181
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
APP_TX_RX_TIMEOUT and APP_NET_INIT_TIMEOUT were not used in any way
in the sample and test apps.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add the supported features section to serpente.yaml and overlay files
to the corresponding tests and samples.
Signed-off-by: Alexander Falb <fal3xx@gmail.com>
Given that TLS/DTLS socket now creates an underlying TCP/UDP socket, the
FD consumption is increased in echo_client and echo_server.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.
A coccinelle rule is used for this:
@r_const_dev_1
disable optional_qualifier
@
@@
-struct device *
+const struct device *
@r_const_dev_2
disable optional_qualifier
@
@@
-struct device * const
+const struct device *
Fixes#27399
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
If user has enabled SOCK_DGRAM support for AF_PACKET type, then
use that in the packet sample application instead of SOCK_RAW.
This simplifies the application as we do not need to handle
the Ethernet frame when sending or receiving the packets.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
-Wimplicit-fallthrough=2 requires a fallthrough comment or a compiler
to tells gcc that this happens intentionally.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Instead of unknown clock accuracy, set it to 1ms for native_posix
boards. This looks better in TSN monitor.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add gPTP multiport support to native_posix Ethernet driver.
This means that the driver is able to create more than one
network interface and enable gPTP to each of them. This requires
that net-tools is updated as it contains configuration file
for network interfaces in host side.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Create two threads, one for receiving packet socket data and
the other for sending raw Ethernet frames.
Add flood option where it is possible to stress test the IP
stack. Flooding is disabled by default.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit allows let build zperf sample with overlay-netusb.conf.
USB subsystem must be enabled by the application.
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
Remove dependency on CONFIG_BT_ACL_FLOW_CONTROL and use
CONFIG_BT_L2CAP_RX_MTU always to set L2CAP RX MTU.
The ATT MTU is set from two different KConfig options depending
on if CONFIG_BT_ACL_FLOW_CONTROL is enabled, which makes it
a confusing option and hard to provide a conf file that
supports multiple board configurations.
This changes the behavior when CONFIG_BT_ACL_FLOW_CONTROL and
CONFIG_BT_BUF_RX_LEN was used to set the L2CAP RX MTU, and by
extension the ATT MTU.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
A proper way to match a Security object instance with a Server object
instance is via Short Server ID resource. Both coupled object instances
should carry the same value of this resource in order to me considered
matched.
This was not implemented in the LwM2M library and it was incorrectly
assumed that the Security object instance index corresponds to the
Server object instance index. While such apporach works is simple
scenario, it might yield incorrect results when bootstrap is used.
Fix this, by verifyng the Short Server ID resource in the Secuirty
instance used, and finding a matching Server instance. The server object
instance is stored for future use in the engine.
Additionally, remove an extra Server object instance that was created
when the bootstrap procedure was used. Since the boostrap Security
object instance does not have the corresponding Server object, it's
enough to have a single Server instance.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Zephyr introduced subsys/mgmt folder for MCU management. Move UpdateHub
sample to its correspondent folder at sample/subsys/mgmt folder.
Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
It was already using uart_irq_callback_user_data_set below, now it also
uses uart_irq_callback_user_data_t as callback type, so let's normalize
the callbacks.
Fixes#26923
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
TI CC32xx does not support binding the same port to multiple sockets,
but instead uses the IPv6 socket to handle both IPv4 and IPv6
connections. This commit modifies the sample to reflect this.
In addition, Kconfig options are overridden in order for the sample
to take advantage of wifi and socket offloading on this platform.
Signed-off-by: Vincent Wan <vwan@ti.com>
On TI CC32xx, the same port number cannot be bound to different
sockets. Instead, when an IPv6 socket is bound it can handle both IPv4
and IPv6 connections.
Signed-off-by: Vincent Wan <vwan@ti.com>
Fix compilation error when the DIAG module is enabled.
All core functionalities are provided.
Signed-off-by: Piotr Szkotak <piotr.szkotak@nordicsemi.no>
The current shield version shows different configuration, including
disabling default ethernet and wifi interfaces. To allow easy
connection from standard headers, this add two new shield designations.
The existing boards overlays and defconfig were updated.
The documentation was update to reflect changes. A new supported
variations section helps to understand what shield variation user need
select to build their own system.
This changes requires changes on esp32 offload tests to reflect new
esp_8266 shield designations. Sam4e_xpro was keeped as the only one
with dedicated overlay and both frdm_k64f and disco_l475_iot1 were
moved to use standard arduino r3 header using extra args.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
After Zephyr 2.3.0 release system uses more RAM. This update
samr21_xpro configuration to allow echo_client be equal to
echo_server configs and remove unnecessary definitions.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
After Zephyr 2.3.0 release system uses more RAM. This update
samr21_xpro configuration to allow echo_server run again and
remove unnecessary definitions.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
The sam4e_xpro and sam_v71_xult configs are unnecessary. Now
atmel_rf2xx shield will complement all necessary configuration.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
The sam4s_xplained and sam_v71_xult configs are unnecessary. Now
atmel_rf2xx shield will complement all necessary configuration.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
extended download progress metrics to Bytes, KiB and MiB
separate number of download iterations for INF and numeric case
Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
The generic SPI GPIO chip select support now respects devicetree flags
for signal active level. Update all cs-gpios properties to specify
active low.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Unit tests were failing to build because random header was included by
kernel_includes.h. The problem is that rand32.h includes a generated
file that is either not generated or not included when building unit
tests. Also, it is better to limit the scope of this file to where it is
used.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Some of the settings are no longer needed in the sample as OpenThread
configuration manages it by itself.
Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
Simplify overall scenario using sntp_simple to keep main MQTT logic more
clear. Also, remove related code which was used only by the old SNTP
code, e.g. show_addrinfo().
Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
Callback used mqtt_publish_qos1_ack but mqtt_subscribe called with
default 0 value (MQTT_QOS_0_AT_MOST_ONCE)
Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
New config file to build an OpenThread NCP for the NRF52840-DK
via CDC-ACM USB on the connector J3 (labelled 'nRF USB').
Signed-off-by: Markus Becker <markus.becker@tridonic.com>
zperf takes a potentially unaligned netowrk packet, casts it to a
struct, and then dereferences the fields. This causes a crash on
cores that don't support unaligned access such as the Cortex-M0+.
Use the UNALIGNED_GET helper instead.
Signed-off-by: Michael Hope <mlhx@google.com>
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming multiple projects
"NONE" defeats this functionality.
This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names, small, manual adjustments
have been done.
See also 7eabab2f5d ("samples, tests: Use semi-accurate project names")
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
Move to using PRIu64/PRId64 instead of %llu/%lld since on
native_posix_64 the uint64_t/int64_t type is defined in terms of 'long
int' and not 'long long int'.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Support for the socketpair(2) system call was recently
added for 2.3.0 .
This change adds a sample application that demonstrates
how it can be used.
Fixes#25527
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
If build with full POSIX API, use read()/write() instead of
recv()/send() calls for sockets.
We have read()/write() support for a while, but no samples/tests
actually performed at least a build test for it (so it will be
done now).
Fixes: #25407
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>