espressif / ESP8266_RTOS_SDK

Latest ESP8266 SDK based on FreeRTOS, esp-idf style.
http://bbs.espressif.com
Apache License 2.0
3.32k stars 1.56k forks source link

ip address from IP_EVENT_STA_GOT_IP is printed broken - but wifi works correctly (GIT8266O-776) #1199

Open marcinczeczko opened 2 years ago

marcinczeczko commented 2 years ago

Environment

Problem Description

Hi, I used the https://github.com/espressif/ESP8266_RTOS_SDK/blob/master/examples/wifi/getting_started/station example of wifi station. In general it works just fine. However, the event_handler that prints out obtain IP address shows weird results - instead of just IP it has appended also the mask and gateway piece.

I (1335) My ESP: got up:192.168.10.1338.10.133, mask: 255.255.255.0, gw: 192.168.10.1

The code printing it out is example as in the example project

ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data;
ESP_LOGI(TAG, "got up:%s", ip4addr_ntoa(&event->ip_info.ip));

Expected Behavior

Just obtained IP printed

Actual Behavior

Result:

I (1335) My ESP: got up:192.168.10.1338.10.133, mask: 255.255.255.0, gw: 192.168.10.1

Steps to repropduce

  1. Make flash monitor of https://github.com/espressif/ESP8266_RTOS_SDK/blob/master/examples/wifi/getting_started/station
  2. Observe result in monitor

Code to reproduce this issue

See above

Debug Logs

See above

Other items if possible

marcinczeczko commented 2 years ago

Looks like it's not the logging the ip, but the logger of tcpip_adapter that overlaps with my log entry, commeting out every ESP_LOGI after connect prints out just

I (1330) tcpip_adapter: sta ip: 192.168.10.133, mask: 255.255.255.0, gw: 192.168.10.1