-->
Page 1 of 2

Android device hotspot does not assign port number

PostPosted: Fri Nov 06, 2020 10:20 pm
by MVRP
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.

Re: Android device hotspot does not assign port number

PostPosted: Sun Nov 08, 2020 1:03 pm
by schufti
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.

Re: Android device hotspot does not assign port number

PostPosted: Sun Nov 08, 2020 2:43 pm
by quackmore
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

Re: Android device hotspot does not assign port number

PostPosted: Mon Nov 09, 2020 12:54 am
by JurajA
why do you asked this again?
viewtopic.php?f=163&t=22081