ChipID vs MAC for API

In the esp8266 based boards, the code for the API POST to AirGradient servers uses ESP.getChipId(), HEX to get a short version of the MAC as the Serial No. that is only 6 characters long.

In the more recent boards that use ESP32-C3 chips, it was changed to use the normalized MAC which is the full 12 character of the MAC without any : between them.

Is there any plan to allow the older boards to use the full MAC, or to switch the newer ones to using the ChipID that is 6 characters?

The inconsistency is causing some manageability issues with my ESPHome configuration as I can’t use the same REST POST methods between the two boards since the ID has changed and just wondering if there are plans to sync them up, one way or the other.

1 Like

I think going forward we would use the full mac address to avoid any duplicates. I will look into this in one of the next updates. Maybe we could update the old Arduino code for the ESP8266 boards to switch to the full Maxcaddress. Would that help?

I’m not sure the best plan.

ESPHome has some functionality to automatically add the MAC as a suffix to the name, but it only uses the last 6 characters, similar to the original AG code, so it was an easy add.

If the standard becomes the full MAC, then I can’t use that functionality and match the Arduino code, and would have to manually add the MAC to the name, or leave it off.

Then again, there is a built-in function of get_mac_address() that returns the same normalized MAC as the newer code and I was having to use substr to get only the last 6 characters, so I can just let that be the full MAC for the API POST.

So I think we can go either way, but if someone has one of the boards with earlier code connected to the AirGradient dashboard and then updates to newer code that switches to the full MAC, it wouldn’t be recognized on the dashboard side, which will cause confusion…