Wireless FreeRTOS IP stack


I would like to know if there is an implementation of the FreeRTOS IP stack running on a Wireless interface.
I am looking for an alternative to the ESP32 running lwIP stack on its wireless interface.

Can you tell in which demo board this has been implemented?


Hi @EduardoGoncalves1966
Thanks for reaching out to the FreeRTOS Forum community!

FreeRTOS, by design, uses the vendor specific WiFi APIs directly with a TCP/IP and network transport layer in between.
FreeRTOS+TCP has a network interface implemented for ESP32 board here
You can use it to replace the default Lwip , ESP IDF currently implements.
The best place to look at for these will be the ESP IDF at GitHub - espressif/esp-aws-iot: AWS IoT SDK for ESP32 based chipsets. This has some good examples which can be referred in the folder “examples”.
Apart from ESP32, FreeRTOS+TCP has also been implemented on the wireless interface in the Pic32 board
FreeRTOS-Plus-TCP/NetworkInterface_wifi.c at main · FreeRTOS/FreeRTOS-Plus-TCP · GitHub

Thanks for the fast answer and the links.

I am more interested in implementing an Application that will communicate using UDP broadcasts (without Access Points. Just like if it was running on Ethernet). And also creating a TCP connection to communicate between 2 systems.

Is there a simple project for this? I inspected the directory and it seems there are implementations for complex protocols like MQTT, HTTP, etc.

I am looking for something as simple as possible that allows to use TCP connections and UDP broadcasts.


Did you look at this one - FreeRTOS/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator/DemoTasks at main · FreeRTOS/FreeRTOS · GitHub


Does that example run on a WiFi interface?

One thing that I don’t understand is on hopw to choose the interface that the TCP/IP stack should use:


When a socket is created how does one associate this stream with Ethernet or WiFi?


Hi @EduardoGoncalves1966,
It depends on what port you’re using for the platform.
Take esp32 as example, the xNetworkInterfaceOutput is the interface for FreeRTOS-Plus-TCP to transmit output packet through the network interface. And esp_wifi_internal_tx() is esp32’s wifi API!
You can also try this Networking Demo Project. It uses libpcap as network interface on top of Linux, support on any available network interfaces on your machine.


Thanks for the answers.

Although I am looking for an example project where a TCP connection is being made between two ESP32 boards, ideally ESP32-WROOM.
Also a UDP broadcast example would be nice but I think when I have a the TCP project I can make this one.

Any help? Thanks.

You can refer to the demo FreeRTOS/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_IPv6_Demo/IPv6_Multi_WinSim_demo at devIPv6 · FreeRTOS/FreeRTOS · GitHub. This creates multiple endpoints. For ESP32, you will will have to use the ESP32 portable layer(FreeRTOS-Plus-TCP/source/portable/NetworkInterface/esp32 at main · FreeRTOS/FreeRTOS-Plus-TCP · GitHub) instead of the libpcap portable layer.