Open emcniece opened 8 years ago
Do you mean as in "What IP has my Oak been allocated on my wifi network?" If so, I've done that manually via the following code during setup(), which creates a Particle variable that is populated with the devices current IP address. The overall code is a bit more complicated than that... as I manually connect to particle to work around the 'variable must exist within first 1-2 seconds of particle connection' glitch, and also rather dumbly refreshes the IP address every 60 seconds just in case the DHCP lease lapses and a new IP is allocated. You can see an earlier version of the full code here if you wish.
IPAddress myIp;
char myIpString[24];
myIp = WiFi.localIP();
sprintf(myIpString, "%d.%d.%d.%d", myIp[0], myIp[1], myIp[2], myIp[3]);
Particle.variable("ipAddress", myIpString);
Do you mean as in "What IP has my Oak been allocated on my wifi network?"
Yes, that was what @emcniece had in mind. We weren't able to add this feature at the time because OakCore didn't support it, but I could imagine adding an IP address query based on your code similar to the mode query I wrote.
It would be useful to know the internal IP address assigned to a device. Can this be done through OakCore?