Arm Mbed OS support forum

DISCO_L475VG_IOT01 WIFI HTTP SERVER example

Hello,

I’m new to MED OS and I’m trying to get an example project running. My target is a DISCO_L475VG_IOT01. I am using Mbed Studio (latest version). I imported the DISCO_L475VG_IOT01 WIFI HTTP SERVER example and updated the mbed-os library to version 6.4.0. Finally, I updated the mbed_app.json file with the correct SSID and PASSWORD information.

The project compiles successfully. However, when I run the project I get the following console output when I attempt to connect to the HTTP server from a browser on my PC:


*** STM32 IoT Discovery kit for STM32L475 MCU ***
*** WIFI Web Server demonstration ***

*** Copy the IP address on another device connected ***
*** to the wifi network ***
*** Read the temperature and update the LED status ***


ES-WIFI Initialized.

es-wifi module MAC Address : C4:7F:51:7:58:F1
es-wifi module connected
es-wifi module got IP Address : 10.10.24.57
Start HTTP Server…
Wait for connection…
HTTP Server Started
ERROR : Cannot send web page

I believe the error is occurring on line 243 in main.cpp.

I apologize in advance if this is caused my a silly error on my part. Any suggestions would be greatly appreciated.

Regards,

Tom

Hello Tom,

Just for sure, it is good to test any example in its original state before you update MbedOS to its latest version. Always is a chance there are significant changes in the Mbed library or in HALs (what are included in the Mbed library).

First what I see is on the line 233

sprintf((char *)temp, "%f", temperature);

MbedOS6+ has float type disabled for print functions. However you can enabled it again, see - minimal_printf.

The code on the line 243 of main.cpp only evaluates status from method WIFI_SendData from line 241. So, if you not see any result in your web browser the issue can be with that medtod.

BR, Jan

Jan,

Thanks for taking the time to look at this issue. I did try to use the original state when I imported the project. However, there was an issue with python scripts not executing properly related to the print command. I believe it was an issue related to Python V2 versus Python V3. When I upgraded MBed-OS to the latest version, all compiled correctly except for one issue. The Serial object was not found (line 35 of main.cpp). I just commented out the object declaration and reference in the code so to use the default serial port settings. All compiled well once I did this.

The line of code where the error is occurring is as follows:

ret = WIFI_SendData(0, (uint8_t *)http, strlen((char *)http), &SentDataLength, WIFI_WRITE_TIMEOUT);

I apologize, this is line 241 (not 243) in the main.cpp file. For some reason, the the WIFI_SendData() is returning an error. I am having some difficulties with the debugger in getting into the details. I plan to look more at this issue tomorrow.

Again, thanks for your help and any suggestions you might have,

Regards,

Tom

Hi Tom,

ok, I tried to import it. The problem with the original state is the version of MbedOS. The example run on MbedOS 5.5 which is not supported by MbedStudio, it supports MbedOS5.12+.
So in the original state can be tested only with online compiler.

The serial object it was only for set baud rate of debug console probably.
Fo the MbedOS6+ you can do same with change from the Serial to BufferedSerial. Or you can change it in mbed_app.json file.

{
    "target_overrides": {
        "*": {
            "platform.stdio-baud-rate": 115200
        }
    }
}

The reason why the example was not updated can be, the Mbed has own implementation for the Wi-Fi.

BR, Jan

1 Like

Jan,

Thanks for your assistance with this issue. I am putting aside this matter as I am not able to get the MbedOS 6.4 WiFi example to run. I cannot find the necessary ISM43362-M3G-L44 drivers to support the MbedOS 6.4 WiFi library.

Regards,

Tom

Hello Tom,

some informations about setting and driver are on the github


BR, Jan