Using Updater via CLI¶
BrainStem firmware can be modified using the Updater CLI utility. This method is often very useful in remote installations and large scale automation systems as it is easily invoked with a simple script. Using your computer’s operating systems terminal interface, navigate to the “Bin” folder located in the Brainstem Dev Kit download. Downloads for all of Acroname’s products can be found at Download Center under the Support tab.
Parameters and commands available for the Updater may be found by running the utility without any commands or arguments (When running Updater on a Mac or Linux you will need to use “./”. Windows does not require this).
Note: The following examples will be preformed from a Mac.
If you would like additional help information, including examples you can use the -H command.
$> ./Updater -H
Application:Updater Version:Version: 1.0 Dec 31 2015 11:00:34 BrainStem 2.1.5 Copyright (C) 1994-2015, Acroname Inc. Updater [options] BrainStem Update and Maintenance Application Parameters to commands: -b <build number> - Build version of the firmware to transfer. [Default: latest version available]. -d <device> - Device serial number of the device to access. -t <transport type> - communications method [USB,TCP,RECOVER]. -f <bird file> - Firmware file to be transferred to device. -r <router serial#> - indirect connection through router device -s <serial port> - name of serial port to use for recovery -l 'log message' - message to place in device history log -a <mode> - set log file access mode [A, X]. Override the default append mode [A] with overwrite mode [X]. -k <filename> - log messages written into given filename Default:[APP.log] Commands: -B - list the Builds available for given device. -D - Discover devices that are currently connected. -G - Get build file from the Acroname server and store on local machine for download to device. Must specify a specific device ["-d" option]. Default is to obtain the latest build for the given device, override with "-b" option. -H or -h - Display extended usage information. -I - View stored device information. Must either use DISCOVER command ["-D"] or specify a specific device ["-d" option]. -L - Log the session output into a log file. Use the "-k" option to override the default filename [APP.log]. -U - Update the firmware on device specified. Must specify a specific device ["-d" option]. Default is to download the latest build for the given device, override with "-b" option or specify specific BIRD file using "-f" option. -R - Send RESET to device Must specify a specific device ["-d" option]. -V - View stored history for device. Must either use DISCOVER command ["-D"] or specify a specific device ["-d" option]. -X <BIT_MASK> - Bitmask for Logging DEBUG_Updater 0x00000001 DEBUG_History 0x00000002 DEBUG_Attributes 0x00000004 DEBUG_BirdFile 0x00000008 DEBUG_Network 0x00000010 DEBUG_ServerComm 0x00000020 DEBUG_Network 0x00000100 DEBUG_Network_SR 0x00000200 DEBUG_Network_FIRM 0x00000400 DEBUG_NXPSerial 0x00001000 DEBUG_NXPSerial_E 0x00002000 DEBUG_NXPSerial_SR 0x00004000 DEBUG_APP 0x00010000 -Y - change router address of an network device to given router. Requires: -d <mod:device> and -r <device> options. Sample usage: -D Discover all devices connected by either USB or TCPIP. Records the device information into the settings for that device. -D -t USB Discover all the devices connected by USB. Records the device information into the settings for that device. -D -t USB -d 0x40F5849A Discover settings of the specific device (serial number 0x40F5849A) -G -d 0x40F5849A Get the latest firmware for the given device. Downloads the firmware file into the updater specific device directory. -U -d 0x40F5849A Update the firmware on the specific device. Without other options, this command will try to locate the latest firmware version to be used for updating the device. -G -d 0x40F5849A -b 99528558 Get the specified build’s firmware for the given device. Downloads the firmware file into the updater’s specific device directory with the build number as the filename. -G -U -d 0x40F5849A Get the latest firmware for the given device. Downloads the firmware file into the updater specific device directory. After download, update the firmware using the latest release. -U -d 0x40F5849A -X 0x0010 Update the firmware as described above, but turns on the display of networking messages used in the transfer. -U -t RECOVER -s /dev/serial Update the firmware as described above, but uses the serial interface in communicating with the device to install the latest firmware. Sample usage for network discovery and updates: -D -r 0xD272031D Discover all devices connected to the I2C BrainStem network of the given routing device 0xD272031D. -G -U -d 0x2181F0EE -r 0xD272031D Get and Update to the latest firmware for device 0x2181F0EE indirectly through routing device 0xD272031D. Updater [Version: 1.0 Dec 31 2015 11:00:34] [BrainStem Release:2.1.5] [Copyright (C) 1994-2015, Acroname Inc.] NO COMMANDS GIVEN Completed processing: Updater [Version: 1.0 Dec 31 2015 11:00:34] [BrainStem Release:2.1.5] [Copyright (C) 1994-2015, Acroname Inc.]
As you can see there are a lot of options for customizing the Updater utility to meet your needs; however, there are just a few basic command that will fit the needs of most users.
Next we will look at a few examples of how to use the updater.