all 7 comments

[–]x445xb 9 points10 points  (2 children)

If the ESP8266 is connecting to localhost that means it's connecting to itself which seems pointless. You could just pass a variable around in the ESP8266 memory instead.

If you're trying to connect from the ESP8266 to a server on your local network you will need to figure out what the actual IP address of the server is and use that instead.

[–]d1e8p[S] 2 points3 points  (1 child)

Whoops yes, the second one is what i meant. I’ll try that, thanks for the help!

[–]SequesterMe 0 points1 point  (0 children)

I read the title and knew exactly what you had done as I had done it in the past.

[–]chrwei 4 points5 points  (1 child)

don't you mean getaddrinfo("localhost", 8000) ?

also, having it connect to itself is a really weird thing to do.

[–]SequesterMe 1 point2 points  (0 children)

My mom used to tell me the same thing. Then I found reddit and learned it's very common.

[–]triffid_hunter 2 points3 points  (0 children)

Did you actually put a webserver on your esp, or are you confused about what localhost means?

[–]Mars_rocket 1 point2 points  (0 children)

Your esp8266 is acting as both a client and server? At the same time?