Flashing the disk, and installing the agent again creates a new device on the dashboard

Hi,

While testing our environmental data capturing devices, we flash them frequently to test with upgraded firmwares. After that once we install the agent, every time a new instance of the device is created on the portal. Is there a way around for this? May be a mac binding or something else?

Hi Siddharth,

Unfortunately no. However, you can create(and retain) device name by adding an attribute as given in thread Can I send some device attributes to console?

If your script returns device_name = b8:27:eb:c4:99:fe this will used as the name of the device.

So if you create a file $AIKAAN_AGENT_INSTALL_DIR/opt/aikaan/bin/support/inventory/mender-inventory-devicename.sh with content as follows

#!/bin/sh
echo device_name=cat /sys/class/net/eth0/address

Replace eth0 with your device name. You device name will always be mac address.

Hello I tried to do the same but still it is creating new random device name on the portal . can you guide us if there is anything we can do .

Hi Kishan,

It might take upto 30 minutes, This is the timer by which the controller polls the devices.

Thanks
C

so after creating random device. will it rename it self to desired device_name ?

Hi Kishan,

Yes, let us assume you have created an executable file $AIKAAN_AGENT_INSTALL_DIR/opt/aikaan/bin/support/inventory/mender-inventory-devicename.sh

And on executing this file, it returns

device_name=Device007

Once the device is created it gets a random name. By the next 30 minutes, the device name will automatically change to Device007

Thanks
C