I am registering new devices using the pre-registered services and want to set the device name

I am using the pre-registered services method to make new devices on Remote.It. I have noticed that the device will register with its host name. I would like it to set the name so that it registers with its serial number or a name we define.

Use the following process to modify the device name when it registers with Remote.it

Make sure your modification works before putting this into production as it might have undesired consequences such as registration failure or bricking the device since you will be modifying a shell script
Open /usr/share/remoteit/oem.sh. By default the device name is generated by the function r3_get_name(), modify the function to call something other than uname -n.

The example below has been modified to read a file for the name (could be a serial number or specific network adapter MAC address)

r3_get_name() { 
# Modified to use the r3_get_serial() function 
# uname -n 
r3_get_serial() { 
# Modify this for the path to the serial number file below is an example 
cat /sys/firmware/devicetree/base/serial-number 

You can confirm the updated function works as expected from the shell command line function after modifying on your master device, given that you have written the serial-number file.

/usr/share/remoteit/oem.sh && r3_get_name
> 00000000f637bc7

Before cloning the device:

  • Ensure that the modified oem.sh is in place
  • Remove your serial number file
  • Update the registration file in /etc/remoteit/registration to be empty
  • Delete the /etc/remoteit/config.json file

After cloning and before starting up the new device.

  • Write your serial number file with value to the path that is in oem.sh when you have the serial number or identifier file in place
  • Update the /etc/remoteit/registration with your bulk registration ID

Then, Start up the device with network connection.

Please test this first before moving into full production.

1 Like