Set name of device before API connection


#1

Hi,

How can I set the name of my devices before the first connection with Resin API ?
I have seen that there is RESIN_DEVICE_NAME_AT_INIT, but I don’t understand where and when I can set this variable.

Thanks


#4

@quentinb The RESIN_DEVICE_NAME_AT_INIT variable is set automatically by the supervisor and it will be set each time the app/service is restarted. The reason it has the _AT_INIT on the end is that this is at the time of initialisation of the container. This was done because most people didn’t want their containers to restart every time they changed the devices name. That being said, there was a resent bug introduced which meant that the changes to this variable were not being reflected. This has been fixed in supervisor v7.16.5 https://github.com/resin-io/resin-supervisor/blob/master/CHANGELOG.md#v7165---2018-08-13 , which will be released in the OS version 2.14.x


#5

@shaunmulligan Thanks for the reply, but I’m not sure to understand. The device’s name is set by the supervisor, correct? So if I want to give it a name (like a custom id) before the container has been mounted, how should I proceed?

From what I understand I could also rename the device later by changing the value of RESIN_DEVICE_NAME_AT_INIT, but only in OS > 2.14, am I correct?
Thanks