Error in my code

please give any solution

I moved your topic to an appropriate forum category @ardex01.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

1 Like

A picture of your screen is useless. We can't scroll it to see the rest of your code. It's barely readable.

Why don't you copy and paste the text here? Wouldn't that make more sense?

Be sure to put your code in code tags.

The error message says that you wrote a function that promised to return something but didn't have a return statement. Look at your functions. Does one of them match that description?

1 Like

Looks like you have an ESP8266 (NodeMCU - lower-right of IDE) using this code ( WiFi_Captive_Portal.ino) from the top-left of the IDE.

Look at the words near line 100... they should be this: String postedSSID() { ... and it is my guess you have misspelled that line...

yes

yes this is a WiFi_Captive_Portal.ino

WiFi_Captive_Portal.ino this is the code

According to the error message, you have a function that is suppose to return a String, but you have no return statement in the function.

you have any idea

Look in your code, around line 100... you will see this... postedSSID()... then look elsewhere in your code for a line that uses postedSSID() to return a value, something like something = postedSSID()

Q: "Did you just download this file and nothing else in the library?"
A: "I don't know."
Q: "Download and install the complete library from this link, click CODE >> DOWNLOAD ZIP then in your IDE, >> SKETCH >> INCLUDE LIBRARY >> ADD ZIP LIBRARY... reboot IDE and go to IDE >> FILE >> EXAMPLES >> this ESP example code.

See reply # 8

You have defined a function that is suppose to return a String.

You have no return statement within the function, so anything expecting a String when calling the function will get meaningless random data back.

[quote="xfpd, post:12, topic:1210986, full:true"]
Did you just download this file and nothing else in the library?

all steps are done

only code uploading error

I fixed it for you. Look at the postedSSID function between lines 100 and 107.

That library does not appear to have active support, the error was reported almost a year ago:
https://github.com/adamff-dev/ESP8266-Captive-Portal/issues/39


2nd error

See post #15.

Are you sure you have the correct COM port selected?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.