Yeah, But what is in between [image: image.png] and [image: image.png] ???
Do you have any API call to get the IP? Because I read that like "int a = 10; printf("%d", a);" If there is no API call to update "address" then you simply will print "INADDR_ANY" value. чт, 21 вер. 2023 р. о 14:42 MIGUEL ALEXANDRE WISINTAINER < tcpipc...@hotmail.com> пише: > I mean, ifconfig, and capture the ip… > > Enviado do meu iPhone > > Em 21 de set. de 2023, à(s) 08:24, Gustavo Soares < > gustavo.felipesoa...@hotmail.com> escreveu: > > > Hi, Petro! > > I use this struct: > > [image: image.png] > > and this where I use the inet_ntoa: > > [image: image.png] > ------------------------------ > *De:* Petro Karashchenko <petro.karashche...@gmail.com> > *Enviado:* quinta-feira, 21 de setembro de 2023 08:16 > *Para:* dev@nuttx.apache.org <dev@nuttx.apache.org> > *Assunto:* Re: different IP than expected > > Hi, > > But what do you pass to "inet_ntoa"? Maybe you get the IP of your PC or a > default router IP and try to print it? > > Best regards, > Petro > > чт, 21 вер. 2023 р. о 14:06 Gustavo Soares < > gustavo.felipesoa...@hotmail.com> пише: > > I don't know if I can reproduce this in another app, but my question is > why does the server listen to requests in one IP adress (ending with 15) > and when I retrieve its IP it shows a different one? About the ifconfig > command, this is the output: > > > > the server response to the GET request (the request was sent to the > configured IP using ifconfig): > > > the IP address the server returns with the inet_ntoa() method: > > > ------------------------------ > *From:* Petro Karashchenko <petro.karashche...@gmail.com> > *Sent:* Thursday, September 21, 2023 6:59:01 AM > *To:* dev@nuttx.apache.org <dev@nuttx.apache.org> > *Subject:* Re: different IP than expected > > Hi, > > "INADDR_ANY" definitely does not match "listens to the defined IP" > statement. I do not understand exactly what you are trying to do, but it > would be good to know what is the output of "ifconfig" running from NSH. > If you do not want to share code details, maybe you can check how your > application behaves on Linux and compare to what behavior you observe with > NuttX. > Can this somehow be reproduced with one of the apps available in the NuttX > repo? > > Best regards, > Petro > > чт, 21 вер. 2023 р. о 03:09 Gustavo Soares < > gustavo.felipesoa...@hotmail.com> пише: > > Hello everyone! > > I configured NuttX to a certain IP address and I have a webserver which > listens to the defined IP: > > > > > > The HTML file above has a variable that contains the server IP address, > but it is a different one: > > > > the server replaces the text SERVER_IP_ADDRESS to it's actual IP and then > sends the file to the client. This is the method I used to get the IP > address: > > > > Why is it a different IP? The server is listening to one but this method > returns another one. > > >