Wifi on Zephyr + TCP socket primitives - #394
Merged
Merged
Conversation
Seems to cause a connection to return -22?
Credentials will be part of the wasm module in WARDuino
Seems to work, mostly just have to add three primitives now!
By actually disconnecting, re-connecting later becomes much easier since the wifi network knows that the device is gone and doesn't wait for some timeout.
This way there is no garbage in this fields which can confuse the driver.
TODO: Reading from a socket
This now makes it possible to for example create an echo server, among many other possibilities!
MaartenS11
force-pushed
the
feat/zephyr-wifi
branch
from
July 14, 2026 16:11
124389f to
794ebb2
Compare
If you want retry you can always just run the socket function in a loop yourself.
MaartenS11
force-pushed
the
feat/zephyr-wifi
branch
from
July 15, 2026 12:27
b3f4b3a to
22288a9
Compare
MaartenS11
marked this pull request as ready for review
July 15, 2026 12:42
We also don't use any Zephyr code in this file so technically we could also use it in the emulator to have real socket support!
MaartenS11
force-pushed
the
feat/zephyr-wifi
branch
2 times, most recently
from
July 16, 2026 08:24
1cf6055 to
6050518
Compare
MaartenS11
force-pushed
the
feat/zephyr-wifi
branch
2 times, most recently
from
July 16, 2026 09:38
5266676 to
50c338d
Compare
Also fixed stm32 overlay not working
MaartenS11
force-pushed
the
feat/zephyr-wifi
branch
from
July 16, 2026 09:43
50c338d to
30c5f6c
Compare
…g primitives This way you don't have to configure a bunch of Kconfig options to turn it on or off but just one!
… as the other platforms Returning the actual size is a useful thing. The second argument is not really that useful, it seems like all platforms ignore it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds primitives to connect and disconnect from wifi networks + tcp socket primitives.
The following primitives have been added.
wifi_connect(ssid, ssid_len, password, password_lenwifi_disconnect()wifi_localip(buf_ptr)socket_create(ip_addr, ip_len, portsocket_create_server(port)socket_accept(socket)socket_send(socket, msg_addr, msg_len)socket_receive(socket, buf_addr, buf_len)socket_close(socket)Tested on both the Raspberry Pi Pico W and ESP 32 C3 Super Mini.
Is on by default but can be configured with KConfig:
