Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNTP doesn't work on v2.4.0 on eswifi #29826

Closed
micholek opened this issue Nov 5, 2020 · 2 comments
Closed

SNTP doesn't work on v2.4.0 on eswifi #29826

micholek opened this issue Nov 5, 2020 · 2 comments
Assignees
Labels
area: Networking area: Wi-Fi Wi-Fi bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug Stale

Comments

@micholek
Copy link

micholek commented Nov 5, 2020

Describe the bug
Calling sntp_simple() results in error:

[00:00:08.670,000] <err> net_sntp: Error in poll:116

To Reproduce
Use the following code on disco_l475_iot1, compile with west (west build -b disco_l475_iot1 .):

struct sntp_time time;
const uint32_t timeout_ms = 5000;
if (sntp_simple("time.nist.gov", timeout_ms, &time)) {
    printf("Failed to get current time");
}

Expected behavior
time should be set to the current timestamp.

Impact
The bug forces the application to use older version of zephyr (v2.3.0).

Environment (please complete the following information):

  • OS: Linux
  • Toolchain: Zephyr SDK
  • Version: v2.4.0

Additional context
I think the problem originates somewhere from eswifi_socket_ioctl function:

#0  eswifi_socket_ioctl (obj=0x2, request=260, args=...) at /home/michal/zephyrproject/zephyr/drivers/wifi/eswifi/eswifi_socket_offload.c:522
#1  0x08047128 in z_fdtable_call_ioctl (vtable=vtable@entry=0x805bbb8 <eswifi_socket_fd_op_vtable>, obj=obj@entry=0x2, request=260) at /home/michal/zephyrproject/zephyr/include/sys/fdtable.h:123
#2  0x08007786 in z_impl_zsock_poll (fds=fds@entry=0x20009a24 <z_main_stack+15916>, nfds=1, poll_timeout=poll_timeout@entry=400) at /home/michal/zephyrproject/zephyr/subsys/net/lib/sockets/sockets.c:1325
#3  0x08001c1e in zsock_poll (timeout=400, nfds=<optimized out>, fds=0x20009a24 <z_main_stack+15916>) at zephyr/include/generated/syscalls/socket.h:202
#4  poll (timeout=400, nfds=<optimized out>, fds=0x20009a24 <z_main_stack+15916>) at /home/michal/zephyrproject/zephyr/include/posix/poll.h:25
#5  sntp_recv_response (time=0x20009a58 <z_main_stack+15968>, timeout=400, sntp=0x20009a24 <z_main_stack+15916>) at /home/michal/zephyrproject/zephyr/subsys/net/lib/sntp/sntp.c:109
#6  sntp_query (ctx=ctx@entry=0x20009a24 <z_main_stack+15916>, timeout=timeout@entry=400, time=time@entry=0x20009a58 <z_main_stack+15968>) at /home/michal/zephyrproject/zephyr/subsys/net/lib/sntp/sntp.c:205
#7  0x080072f8 in sntp_simple (server=server@entry=0x8060110 "time.nist.gov", timeout=timeout@entry=5000, time=time@entry=0x20009a58 <z_main_stack+15968>) at /home/michal/zephyrproject/zephyr/subsys/net/lib/sntp/sntp_simple.c:49
@micholek micholek added the bug The issue is a bug, or the PR is fixing a bug label Nov 5, 2020
@jukkar jukkar changed the title SNTP doesn't work on v2.4.0 SNTP doesn't work on v2.4.0 on eswifi Nov 6, 2020
@nandojve
Copy link
Member

nandojve commented Nov 6, 2020

CC: @erwango

@nashif nashif added the priority: medium Medium impact/importance bug label Nov 10, 2020
@github-actions
Copy link

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking area: Wi-Fi Wi-Fi bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug Stale
Projects
None yet
Development

No branches or pull requests

5 participants