A place users can post their projects. If you have a small project and would like your own dedicated place to post and have others chat about it then this is your spot.

User avatar
By MVRP
#89326 Hi

I am trying to connect an ESP8266 as a TCP client to an android device's wifi hotspot. The connection sets up and android hotsppt server provides the ESP with an IP number but NO port number. Thus i cant send data from my app to the ESP. And i tried everything. Please help.
User avatar
By schufti
#89348 Geting an ip assigned andbopening a port t0 listen are two separate things. Getting assigned an ip address via dhcp does not open any port per se (except you arevtalking about AT-firmware). This is something you have to do in your sketch. See exaples for http server for a start.
User avatar
By quackmore
#89350 clear your mind and google for "TCP/IP model and layers"

you'll find out that your phone hotspot is just managing the network and the IP layers (as you already noticed)

above those two layers you (I mean your APP and your ESP) have to take care of the transport and the application

examples are TCP for transport and HTTP or MQTT for application

whatever you'll choose, your ESP (or your APP) will have to act as a server and will state the port while the APP (or the ESP) will have to act as a client and will have to know the port to connect to the server