Weird behaviour of prinft(\n)

wogoos
Posts: 1
Joined: Tue Jan 30, 2018 9:32 pm

Weird behaviour of prinft(\n)

Postby wogoos » Tue Jan 30, 2018 11:51 pm

Dear readers
I'm using printf() in my code for ESP8266 and found a weird phenomenon. In the setup printf(\n) generates me a CRLF but ones entered in the Loop() in one of the function calls it doesn't work any more. In this function call I have a
printf("Connected to: SSID: \t %-20s\n",WiFi.SSID(wifi.netindex).c_str() ); which works fine but ones i add a \n to the beginning and change it to printf("\nConnected to: SSID: \t %-20s\n",WiFi.SSID(wifi.netindex).c_str() ); it doesn't display anything at all :o
Does any one can give me and idea what going on.

An other strange behavior I saw with printf() in combination with Serial.print(). if you mix them than the screen output is not generated in the sequence the functions are used in the code. Print lines later in the code are earlier displayed. Are the printf() streams and Serial.print() streams independent processed by the RTOS of the ESP? and is this the cause of the problem?
I hope one of you can help me.
Thanks Oscar Goos

User avatar
iot-bits.com
Posts: 23
Joined: Tue Dec 05, 2017 2:53 pm
Location: Pune, India
Contact:

Re: Weird behaviour of prinft(\n)

Postby iot-bits.com » Thu Feb 01, 2018 4:04 pm

I don't recall seeing this.
Which SDK version is it?
- Pratik Panda
Nerd and Embedded Design Consultant
www.iot-bits.com

Jared Thomas

Re: Weird behaviour of prinft(\n)

Postby Jared Thomas » Wed Jul 10, 2019 4:12 pm

Experiencing the same problem, nothing displayed.. Strange phenomenon I must say.

Who is online

Users browsing this forum: No registered users and 7 guests