0

I've built a very simple WiFi thermometer out of an Adafruit ESP8266 HUZZAH breakout board and a TMP36 temperature sensor. I have it reporting the temperature over wifi to my computer which will be storing the data in a database for monitoring purposes. I'd like to make multiple of these devices and place them around the house. My question: I currently have the location of the board as a const char* on the board itself. Doing this for multiple devices is just a bad idea and a nightmare to manage. Is there some way of setting a location variable on the board that will persist across shutdowns? Or am I coming at the problem from completely the wrong direction?

2
  • Why not just use the (unique) IP address of each module to identify it and map that to a name on the PC?
    – Majenko
    Jun 24 '16 at 19:16
  • I was thinking that would solve the issue, but I'd rather have the resolution contained within this system rather than relying on configuring my router as well.
    – Taelsin
    Jun 24 '16 at 20:26
1

With a set of DIP switches or jumpers on some of the GPIO, you could encode a unique number for each one - 16 of them with 4 I/Os f/ex. The same code could run on all of them, sample the unique ID report it along with the temperature. Let the PC-side map IDs to locations.

5
  • I like this. Your answer gave me an idea though. I can get a MAC address from the breakout board. Would the MAC ever change? If not, I could send the MAC of the board along with the other data and do some server side mapping with the MAC.
    – Taelsin
    Jun 24 '16 at 20:25
  • I don't know how the Lua firmware works, but the AT+ interpreter firmware includes commands to set the chip's MAC address, so, yes, it can be changed, but that's a change you would have to make, not one that I could ever imagine would be programmed to happen without you taking explicit action.
    – JRobert
    Jun 24 '16 at 21:59
  • The MAC address comes from the ESP8266 chip, not from the breakout board Jun 26 '16 at 23:55
  • @JaromandaX: Yes, that's correct. And ?
    – JRobert
    Jun 27 '16 at 11:34
  • Just clearing up @Taelsin's misconception that the breakout board has something to do with the MAC address, if that's OK with you Jun 27 '16 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.