Custom Device Naming


#1

What would be the easiest way to have a device name itself or rename itself? We want to name the device after the {product}_{serial} values stored in the bios, intel board.


#3

I’m just looking at this one. I don’t think it’s directly possible, there’s reasons why the application doesn’t have routes to the higher levels of the stack, but I’d also consider the resin-cli documentation to see if there’s something fairly easily scriptable with resin ssh and resin rename, either in the provisioning process or the container initialisation, depending on where you sit along the security vs ease-of-use spectrum.


#4

Where does the name first get generated? Is it in ResinOS or serverside?


#5

You know what, I don’t know the answer to that question, let me ask around.


#8

Hey @annymsMthd

The device is named when the it first makes contact with the resin api, though you can change it at any point. One thing to note is that renaming the device via the api will NOT restart application. When the application does restart it’ll have the new name as an environment variable RESIN_DEVICE_NAME_AT_INIT. Also setting this environment variable will not automatically update the api, it must be done using our api/sdk/cli.

If you want to rename the device from the device itself, you should install our sdk in your app and use the RESIN_API_KEY + RESIN_DEVICE_UUID environment variables to update it on application start.

Does that all make sense?


#9

Thank you Craig, I have learnt something today.


#10

Makes sense. I’ll give that a try. Thank you