cancel
Showing results for 
Search instead for 
Did you mean: 

Discovery Kit STM32L4P5 - Addon wireless module w. sockets

RobertGrizilo
Associate II

Greetings,

I'm developing an RTOS app the should use QUIC protocol for communication.
There is ngtcp2 project and wolfSSL is available in STM32CubeIDE Device Configuration Tool as ngtcp2 supports many SSL libraries.
For this I need some network communication.
So I bought ESP-01 WIFI module and connected it over HLPUART1 port.
Now, I have serial communication with the WIFI using AT commands and communication is working fine (I wrote some simple classes to communicate with it) but it's not available as socket.
What is the simplest way to add network support via WIFI or Ethernet or even with Cellular Network on Discovery Kit STM32L4P5 so I can use sockets?

Any help would be appreciated, thanks.

3 REPLIES 3
RobertGrizilo
Associate II

I know that with AT commands I can do it and I'm already sending and receiving UDP packet to/from network with my simple test program (wifi connect: AT+CWJAP="SSID","PASS" |  udp connect: AT+CIPSTART="UDP","192.168.x.x",8888 | udp send: AT+CIPSEND=size then data... and so on)

By socket I mean C library socket (for example):

int clientSocket = socket(AF_INET, SOCK_STREAM, 0);
sockaddr_in serverAddress;
serverAddress.sin_family = AF_INET;
serverAddress.sin_port = htons(8888);
serverAddress.sin_addr.s_addr = INADDR_ANY;
connect(clientSocket, (struct sockaddr*)&serverAddress, sizeof(serverAddress));
const char* message = "Hello, server!";
send(clientSocket, message, strlen(message), 0);
close(clientSocket);

ngtcp2 uses C sockets to do all the magic and QUIC uses multiple UDP connections for one session, and all the library is written with C sockets in mind so to rewrite all the lib is not the right approach.
I have to use hardware and software that is network standard compliant.

So write implementations of socket(), connect(), send(), etc which use the underlying AT commands?

With ESP being such a common platform, I expect such must already exist?

 

https://www.gnu.org/software/libc/manual/html_node/Sockets.html