Nucleo L432KC + MOD-WIFI-ESP8266-DEV

Hi all

I’m new to Riot OS and doing a little activity with the Nucleo L432KC board and the MOD-WIFI-ESP8266-DEV connected to Nucleo L432KC. For now I can connect to the MOD-WIFI-ESP8266-DEV to a WIFI AP running a UART command from Nucleo L432KC, provide the credentials for the WIFI access point and connect to it successfully - wifi board is assigned with a correct IP address. It works great and I’m happy :slight_smile:

My question is: how can I send an HTTP request from the Nucleo L432KC in this configuration and then read the response?

I’m stuck with this and would appreciate your help.

I can’t seem to send HTTP requests over the UART - HTTP AT commands are not available for MOD-WIFI-ESP8266-DEV

Sample of UART data exchange


This is RIOT! (Version: 2022.07)

UART

result: 0

send UART command (len=8): AT+GMR

118 --> AT+GMR

AT version:1.3.0.0(Jul 14 2016 18:54:01)

SDK version:2.0.0(656edbf)

compile time:Jul 19 2016 18:44:22

OK

send UART command (len=13): AT+CWMODE=3

20 --> AT+CWMODE=3

OK

send UART command (len=38): AT+CWJAP="HIDDEN","HIDDEN"

91 --> AT+CWJAP="HIDDEN","HIDDEN"

WIFI DISCONNECT

WIFI CONNECTED

WIFI GOT IP

OK

send UART command (len=11): AT+CIPAP?

105 --> AT+CIPAP?

+CIPAP:ip:"192.168.4.1"

+CIPAP:gateway:"192.168.4.1"

+CIPAP:netmask:"255.255.255.0"

OK

send UART command (len=12): AT+CIPSTA?

113 --> AT+CIPSTA?

+CIPSTA:ip:"192.168.10.162"

+CIPSTA:gateway:"192.168.10.1"

+CIPSTA:netmask:"255.255.255.0"

OK

I assume you only flashed RIOT OS on the STM32, right? From that perspective, I guess you have to send the raw HTTP frames over UART to the module. You have to checkout the documentation of whatever library you are using for the ESP8266. Maybe it already implements some HTTP AT API as well. This is not part of RIOT OS though. So, you have to implement everything yourself.

This adds quite some complexity and you may want to consider using one of these options instead (which are all supported by RIOT OS by default)

I used some of those drivers before and they are quite simple to use. You just define a custom board and configure all the pins for the connected IC. Add some modules and simple config in your application makefile in order to load your needed network stack. (6LoWPAN, UDP or TLS, CoAP etc.) And that’s pretty much it. The rest is abstracted away for you.