ESPAsyncWebServer code by ChatGPT

Hello all,

Thank you very much.

Why use a predicator of text more than example code provided with the library that you use?

Are you sure that "#include <ESP8266WiFi.h>" declare the Wifi object ?
Do you see the "Connecting to WiFi..." message on the serial monitor ?

I am sorry, but expecting members of this forum to correct code generated by ChatGPT is unreasonable and I suspect that you will not get much help

Don't rely upon AI writing the code for you. Learn coding yourself.

Did you ask ChatGPT to provide a solution?

what chatGPT might can do for you is finding links to human-written tutorials and demo-codes. Which of course can google do too.

With the messages that you got in the serial monitor: why don't you ask chatGPT by feeding in the messages? chatGPT should know best where its code is wrong.

Were I trying to improve an AI's coding nodes, I'd have loads of new accounts made to ask for generated code correction. Then, I'd run a new series on the returns that work.

Have you heard of the Pareto Principle? The 80-20 rule? Where the last 20% of the work takes you 80% of the effort? Chat GPT is really good at doing the first 20% of the effort, producing a bit of boilerplate that looks like it should work and compiles, but it doesn't get the last 80% of effort correct. And worse, it makes figuring out the last 80% of the problem harder by mixing it with working code. It's like fixing these images.

The more experienced coders will focus their efforts on the non-boilerplate part of the problem, and often recommend a complete rewrite, since once you've got the difficult part done, the rest is just the 20% boilerplate.

With my time budget, I would think your code is suspicious here:

So, what is this server supposed to do? And how are you going to spend your time?

Thank you every one for your kindly reply.
I did a lot of googling before try AI code, it's just a process of learning.
Thank you again for your advice and sorry for not understanding the policy about AI code before my posting.

There is no policy about AI on this site. Everything that has been said, focuses on practicality.

I guess you have learned how users react on chatGPT-based code.

Really ? a lot of googling?
https://www.google.com/search?q=ESP8266+async+webserver+demo+code&rlz=1C1PNBB_enDE961DE961&oq=ESP8266+async+webserver+demo+code&aqs=chrome..69i57j33i10i160.14855j1j7&sourceid=chrome&ie=UTF-8
found me these hits

another option would be to ask a question on the forum like

"Can somebody post a link to a ESP8266 async webserver-demo that explains what part of the code is doing what?"

Or if you have chosen one example to

  • writing a description of your knowledgelevel (beginner)
  • posting a link to the example-code / the tutorial
  • posting the code itself as a code-section
  • writing a description of what the code-behaviour is and writing a description of what behaviour you want to have

With these questions you would use the "CK" the collective knowledge of the community to support you

best regards Stefan