For each of my Photons, I would like to store a single string in firmware that describes its location. I could set up a database somewhere with device id / location, but that seems like overkill. I could also create a dictionary on the device, and when each Photon wakes up it consults that, but that seems inefficient (and when I get more Photons, I’d have to keep updating the firmware).
It would be great if there was a small amount of memory available, say through the console, that the Photon could get access to.
Does such a thing exist? Or is there any more efficient way to handle this?
You could use the GoogleMaps API that takes the IP of the WiFi network and looks up a latitude and longitude? The device then publishes the location (lat, lon) once after startup. The cloud then uses a webhook to your website OR a Google Doc OR you could expose via a Particle variable.
Or you could store the location as a c-string in EEPROM (to survive being repowered). You would then need a function to set/change the value and a Particle.variable to access via the console?
We (I’ve switched pronouns, because this is actually a student project) looked at the GoogleMaps API, but we’re thinking of devices inside a building, so we needed more precision (e.g., floor #). But the c-string in EEPROM idea looks like a great idea, thanks for suggesting it.