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

eswifi recvfrom() not properly implemented on disco_l475_iot1 #29538

Closed
panekk opened this issue Oct 26, 2020 · 7 comments
Closed

eswifi recvfrom() not properly implemented on disco_l475_iot1 #29538

panekk opened this issue Oct 26, 2020 · 7 comments
Assignees
Labels
area: Wi-Fi Wi-Fi bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug Stale

Comments

@panekk
Copy link
Contributor

panekk commented Oct 26, 2020

Describe the bug
Zephyr's LwM2M client uses recvfrom function with non-NULL from and fromlen arguments, but eswifi_socket_recvfrom() doesn't support them. Is there any chance to run the LwM2M client on B-L475E-IOT01A board?

To Reproduce
Run LwM2M client on B-L475E-IOT01A and try to register to the LwM2M Server.

Expected behavior
Successful registration to the server.

Impact
LwM2M client is unusable when eswifi modem is used.

Logs and console output

[00:00:04.848,000] <inf> net_lwm2m_rd_client: RD Client started with endpoint 'zephyr-test' with client lifetime 30
[00:00:05.412,000] <err> net_lwm2m_engine: Error reading response: 134

Environment (please complete the following information):

  • OS: Ubuntu 20.04
  • Toolchain: Zephyr SDK
  • Version used: Zephyr OS build zephyr-v2.3.0-599-g1105aa521c29
@panekk panekk added the bug The issue is a bug, or the PR is fixing a bug label Oct 26, 2020
@jukkar
Copy link
Member

jukkar commented Oct 26, 2020

Hmm, I wonder why eswifi does not support this.

cc: @rlubos & @loicpoulain

@jukkar jukkar added the area: Wi-Fi Wi-Fi label Oct 26, 2020
@rlubos
Copy link
Contributor

rlubos commented Oct 26, 2020

Well I'm a bit confused with this driver in general, since it seems to implement both, net offloading and socket offloading. Which one is used in this case?

As for socket offloading approach, it's clear that the recvfrom() implementation is incomplete:
https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/wifi/eswifi/eswifi_socket_offload.c#L349

@panekk
Copy link
Contributor Author

panekk commented Oct 26, 2020

CONFIG_WIFI_ESWIFI selects NET_SOCKETS_OFFLOAD by default, so I wonder if it's even possible to disable the offloading. Setting CONFIG_NET_SOCKETS_OFFLOAD, CONFIG_NET_OFFLOAD and CONFIG_WIFI_OFFLOAD to n doesn't help anyway, with warnings printed for the second two ((...) was assigned the value 'n' but got the value 'y'). It isn't possible to disable the offloading using menuconfig too.

@nashif nashif added area: LWM2M priority: low Low impact/importance bug labels Oct 27, 2020
@rlubos
Copy link
Contributor

rlubos commented Oct 28, 2020

@nashif I'm not the one who should work on this one, It's not an LwM2M issue but a faulty/incomplete wifi driver implementation.

@panekk If eswifi does select NET_SOCKETS_OFFLOAD it means it uses socket offloading, hence the above answer explains the behaviour (the recvfrom implementation is incomplete). Unfortunately it seems the original author is not reachable through github anymore, I'm not sure who should be notified about this.
BTW, if some module uses select on certain symbol in Kconfig, it's not possible to "deselect" it.

@rlubos rlubos removed their assignment Oct 28, 2020
@jukkar jukkar changed the title LwM2M client doesn't work on disco_l475_iot1 eswifi recvfrom() not properly implemented on disco_l475_iot1 Oct 28, 2020
@loicpoulain
Copy link
Collaborator

loicpoulain commented Nov 2, 2020

@jukkar, @rlubos, I'm going to have a look at this by the end of the week

@loicpoulain
Copy link
Collaborator

loicpoulain commented Nov 9, 2020

So, looking at eswifi behavior, to support that we need to handle 'UDP SVR' events which are on the below form:
[UDP SVR] Accepted 192.168.1.23:4242[EOMA]

We need to save ip/port so that it can be passed back in recvfrom. Seems only one UDP client can be handled at a time, we need to stop/restart UDP 'accept' after each client... will try to implement something.

I've started #29898 to address UDP server issue(s).

@github-actions
Copy link

github-actions bot commented Jan 9, 2021

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: Wi-Fi Wi-Fi bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug Stale
Projects
None yet
Development

No branches or pull requests

5 participants