we are looking for a robust way to register devices when they are installed in a facility. Background: We will deliver a batch of hardware with balenaOS installed to a customer and let the customer install the devices in different locations. When the device is installed each device will send sensor data to the cloud. We need to associate the data received in the cloud with the location of the device. Before the installation there is no safe way to assign a certain device with a installation location.
One idea would be to put serial numbers (not the uuid) on the devices as barcode stickers. Whoever installs the device in the facility needs to scan the barcode upon installation and add the location information manually (for example a facility id) using a smartphone and a webapp we provide.
The question here: How could we make the serial number available for the device so it can be used to label the data we send to the cloud? Entering it as a variable in balenaCloud after bootstrapping seems error-prone. Perhaps we could connect a barcode reader to the device when we bootstrap it and use it to scan the barcode but how would we implement that on the device?
Background: We are using hardware that is based on Raspberry CM3 modules.
Any ideas or best practices welcome.