New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP8266 getIP() only returns station IP #722
Comments
In ArduinoESP, to distinguish both IPs, the functions are named localIP() and softAPIP(). |
Odd - I thought there had been some discussion about this before, but I can't find it now - I think rakeshpai mentioned moving to a I guess another option is to have one as the default, but to return both, so:
But to be honest the other solutions are good as well. I guess there could be a PS. In the Wiki where we discussed getIP's implementation, it used a callback so that it could be compatible with other network interface types. For instance with AT commands (GSM, ESP8266 module) you don't want to block while waiting for serial data to be returned. Same would apply for CC3000 too, if TI's drivers weren't so bad! :) |
If station and AP are working both there are 2 IPs and 2 MACs... hence it would be more clear to ask them with two different functions... see reaction on AT command AT+CIFSR... picture... |
Added a mac address to the returned data from getting the IP address. Added a second function called getAPIP() that gets the Access Point information. |
The documentation update for the new |
There appears to be a function called "networkPutAddressAsString" that formats a Mac address ... this looks like exactly what we need to reuse in this area ... see the following forum post for more details.... http://forum.espruino.com/conversations/278075/#comment12646517 This needs added. |
The docs were updated to include getAPIP. In addition, the construction of the mac address string has now been changed to use the Espruino supplied string constructor. |
#722 Updated to used improved MAC address string construction.
I think the Espruino WiFi docs are outdated? But getIP does give IP when not in AP mode. |
I'm not sure I understand - but you're commenting on the wrong bug again. These bugs are for Espruino running on ESP8266 itself, and I think you're talking about Espruino WiFi? Please could you ask on the Espruino forums? http://forum.espruino.com/microcosms/1083/ And maybe give a bit more information? Which docs? What does it return? The Espruino WiFi docs say:
|
Hey, sorry for posting in the wrong place.
Not only for access point mode (docs only mention getting the IP in access-point mode), but it seems to work also for when connecting to another WiFi access point (which doc doesn't mention). |
Just fixed with espruino/EspruinoDocs@de48161 |
The function called getIP() only returns the station IP address. This is a problem because the ESP8266 can also be an access point. The suggestions here is to provide an optional argument to the function which can either be "station" or "accesspoint" to determine which IP address to return. The default if not specified should be "station".
The text was updated successfully, but these errors were encountered: