Problem saving the IP address for later use. #622
Replies: 4 comments
-
Posted at 2016-09-26 by @gfwilliams I think that's as expected. ... if we could get the IP address immediately, |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-09-26 by ClearMemory041063 The assignment MyIP=ip; is done in the callback. That's what's puzzling. The console.log(ip) is also done in the callback before the assignment and displays the IP address. It's likely a timing issue but still puzzling. I've got UDP working (not this example code). I broadcast using IP=255.255.255.255 and send a keyword and local IP address. If the keyword matches, the other end broadcasts using a keyword and it's local IP address. So I need the local IP address from the getIP function to finish this. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-09-26 by ClearMemory041063 I found a solution:
And the output:
And the Billy Bob device
I expect to post the UDP in a few days after some code cleanup. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-09-26 by @gfwilliams
I don't see this is puzzling: You're logging You could always do what you want from the |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-09-26 by ClearMemory041063
PICO shimmed to ESP8266.
I use wifi.getIP() and print the resulting IP address, then assign it to a global variable.
Printing the global variable MyIP doesn’t work.
Later typing MyIP; into the left pane I get the IP address.
So what’s going on and is there a solution?
The output:
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions