Skip to content

ufConf.conf - The Update Factory configuration file for Android

Overview

The ufConf.conf file determines how your devices communicate with the Update Factory platform. Below, we define the various parameters and provide examples to ensure proper syntax.

Note

The essential parameters will be provided to you after your registration with Update Factory.

Parameters

tenant

The tenant is essentially your customer account. It is provided to you upon registration with Update Factory. You can define the tenant parameter like this:

tenant=tesla

url

The url defines which service on Update Factory that your devices will be connecting to.

url=https://personal.updatefactory.io/

controllerId

The controllerId is a unique identifier for each device. This Id will be how you differentiate between more than one device on Update Factory.

A best practice is to include an unique device identifier, like a MAC address or a serial number, as part of the controllerId. However the controller id string format has no particular requirement and including a substitutions is not mandatory.

The following example shows how to include the eth0 MAC address in the controller id:

controllerId=device-${file:///sys/class/net/eth0/address}

The following example shows how to include the Android ID in the controller id:

controllerId=device-${property:ANDROID_ID}

Substitutions

Substitutions are a way of referring to device information (substitutions works only on controllerId parameter).

The syntax is ${<scheme>:<scheme-specific-part>}. Two <scheme> are supported:

  • file -> the expression ${file:<path-to-file>} is replaced with the first line of the file (<path-to-file> indicate the file to use);
  • property -> the expression ${property:ANDROID_ID} is replaced with the device's Android IDAndroid ID.

Warning

It is possible that UfFactoryClient doesn't have the permission to read some device's files because of SELinux. For more information about SELinux on Android see the official documentation

Note

The ANDROID_ID value is used as fallback value for invalid substitutions (invalid scheme, file not found, empty file, app doesn't have the permissions to read the file...).

gatewayToken

The gatewayToken is a common/shared 32 alphanumeric character security-token that can be used as a layer of security for all of your devices. Also, with Update Factory, you use the gatewayToken as a first authentication for your device, see also: targetToken.

gatewayToken=ebeazfivzx74a2u4soltp134d4Wkkv33m

Warning

If you intend to use only the gatewayToken for authentication, this scenario should only be used for development purposes.

Note

You can enable the use of, and generate the gatewayToken in the System Config section on Update Factory. Check the option: Allow a gateway to authenticate and manage multiple targets through a gateway security token

targetToken

The targetToken is a unique 32 alphanumeric character security-token that is generated for each unique device.

targetToken=aupsoltp6f4d4Wkkvf2me3eaxfivzx78a2

There are 3 different options to generate targetTokens for devices in Update Factory:

(1) Under: Deployment > Targets > choose the + icon. Once you complete the form, you can look in the target container at the bottom, and retrieve the Security Token for the device that you just created.

(2) Under: Deployment > Targets > choose the bulk upload icon, next to the + icon, and then immediately choose: "Bulk Upload".

The Bulk Upload feature requires that a file in csv format be prepared in this manner:

Controller_id_1,targetName1
Controller_id_2,targetName2
...
...

(3) Update Factory has implemented a slightly more secure and efficient procedure for authentication which incorporates also the gatewayToken to be used as a first authentication.

Note

Requires the following to be enabled under System Config:
Allow targets to authenticate directly with their target security token
Allow a gateway to authenticate and manage multiple targets through a gateway security token

Requires that: updateFactoryServer is set to: true.

Simply define the gatewayToken in your ufConf.conf and connect your device(s). Once you can see the device(s) under Deployments > Targets, it now has retrieved it's unique targetToken. At this point, you can then disable under System Config: Allow a gateway to authenticate and manage multiple targets through a gateway security token.

Now, the device(s) will authenticate using only the targetToken.

apiMode

apiMode allows for third party apps provide dialogue messages between Update Factory and the Android device. For example, this could be used in the case where an update requires user intervention at the device. If you don't have any need for this (especially if you are not using an app in the UI, and only the UF client service, it is recommended to set apiMode to false.

Note

If you are using the Update Factory ui app as noted here, you will set this to true.

apiMode=false

enable

The enable parameter defines whether the Update Factory client service is active or inactive. Typically, this is set to true.

enable=true

updateFactoryServer

The Update Factory server uses a different procedure (with respect to hawkBit), to provide the targetToken back to the client. Setting this to true, enables the function in the client to retrieve the targetToken from the Update Factory server. If set to false, then the client will communicate as expected by a hawkBit server.

Typically, this will be set to true.

updateFactoryServer=true

ANDROID_ID

Android id is an unique id of the device generated by the Android system. To see the Android ID of an Android device you can use the adb utility like this:

adb shell getprop net.hostname

Note

For more information about Android ID see the official documentation.

ufConf.conf examples

ufConf.conf with all parameters

tenant=tesla
url=https://personal.updatefactory.io/
controllerId=device-${file:///sys/class/net/eth0/address}
gatewayToken=ebeazfivzx74a2u4soltp134d4Wkkv33m
targetToken=9szDyU26EDarhjzSZZvl9szDyU26EDarh
apiMode=true
enable=true
updateFactoryServer=true

Note

If the file /sys/class/net/eth0/address exist (file that contains the mac address of eth0) the controllerId used by the android service will be something like device-21:8f:43:04:53:ab otherwise the controllerId used by the android service will be device-32c173321a2a2e31

For more information about Substitutions feature see the Substitutions section

ufConf.conf with minimal parameters

tenant=tesla
url=https://personal.updatefactory.io/
controllerId=device-${file:///sys/class/net/eth0/address}
gatewayToken=ebeazfivzx74a2u4soltp134d4Wkkv33m

Note

gatewayToken can be replaced with the targetToken

ufConf.conf file location

The ufConf.conf must be loaded in your Android device here: /sdcard/UpdateFactoryConfiguration/. You can use the adb utility like this:

adb push ufConf.conf /sdcard/UpdateFactoryConfiguration/ufConf.conf

Events and Machine States

Be sure to take a look at our documentation on the various machine states or events when your device(s) are in communication with Update Factory. This information can be helpful for debugging or troubleshooting.

References

Kynetics - Update Factory

Kynetics Technical note on Update Factory

Kynetics Slideshare