Updating a Brainstem Module via the Brainstem Network.

The new updater utility also has the ability to update devices via the BrainStem network. This can be very handy when you have multiple BrainStem products connected to a single host computer.

Transport vs Brainstem Network

Before digging in it is important to know the difference between a transport and the Brainstem network.

“Transport”

When we refer to transport we are speaking of the interface between devices and more specifically we are referring to the hardware. Acroname currently offers three transports mediums; TCPIP, USB and I2C. While all are capable of trafficking the Brainstem network only TCPIP and USB are directly available to the user. Although I2C is a technically a transport when it comes to the Brainstem network it is handled internally. This is not to be confused with the I2C Entity which allows communication to third party devices.

“Brainstem Network”

Keeping in mind that the transport is at the hardware level the Brainstem network is at the software level. It is what handles all communication between Brainstem devices. One thing that makes the Brainstem network particularly interesting and useful is the fact that it can transition between transports. Additionally, this transition is handled internally. For more information see BrainStem networking located in the appendix of our support documentation. There it will explain the details of how it works and how to configure your devices.

In this example we will be using the TCPIP transport to communicate via the Brainstem network from our host machine, through our local network, to an MTM-EtherStem where it will then be converted to the I2C transport and sent to a MTM-PM1 module.

Before we begin lets make sure your device is connected and has power. Refer to the Getting Started page for additional information.

Discovery

Since we will be updating a device through another device we will need to know the serial number of the device we will be communicating through. To find the serial number we can simply use the ‘-D’ discover command.

$> ./Updater -D
Updater [Version 0.2 Dec 28 2015 13:54:37] [Copyright (C) 1994-2015, Acroname Inc.]

Discovering Devices [USB]:
    Device    Module   Router  Model               Firmware Version

Discovering Devices [TCPIP]:
    Device    Module   Router  Model               Firmware Version   [IP address]
    D272031D  04       04      0F [MTMEtherStem]   2.2.0 (0)          [10.128.38.159]
    856C1C03  02       02      05 [EtherStem   ]   2.1.4 (99528558)   [10.128.38.122]

Completed processing: Updater [Version 0.2 Dec 28 2015 13:54:37] [Copyright (C) 1994-2015,
Acroname Inc.]

Brainstem Network Discovery

From the discovery we found a MTM-EtherStem with serial number D272031D. We will need this number in order to preform an Brainstem network discovery. To preform the indirect discovery we will need to use the ‘-r’ parameter. The ‘-r’ is for router and this tells Updater to look for anything at that devices router level and below.

$> ./Updater -D -r 0xD272031D

Updater [Version: 1.0 Dec 30 2015 15:59:07] [BrainStem Release:2.1.5] [Copyright (C)
1994-2015, Acroname Inc.]

Discovering Network Devices from [D272031D] via [TCPIP]:
    Device    Module   Router  Model               Firmware Version   [IP address]
    D272031D  04       04      0F [MTMEtherStem]   2.2.0 (0)          [10.128.38.159]
    2181F0EE  06       04      0E [MTMPM       ]   2.1.4 (239384838)  [10.128.38.159]
    CA6A1B05  08       04      0D [MTMIOSerial ]   2.2.0 (0)          [10.128.38.159]

Completed processing: Updater [Version: 1.0 Dec 30 2015 15:59:07] [BrainStem Release:2.1.5]
[Copyright (C) 1994-2015, Acroname Inc.]

As you can see Updater returned 3 devices, One of which being the router device that we specified in the discovery. In other words Updater has returned all of the devices on the MTM-EtherStem’s I2C BrainStem network.

Updating via the Brainstem Network.

Now that we have the serial number of the Brainstem network device we can form our final command to update the device. The command is very similar to the pervious one with the exception of swapping out ‘-D’ (discovery) for ‘-GU’ (get and update). Additionally, we will need to add the ‘-d’ (device) parameter so that it knows which device to update.

$> ./Updater -G -U -r 0xD272031D -d 0x2181F0EE
Updater [Version: 1.0 Dec 30 2015 15:59:07] [BrainStem Release:2.1.5] [Copyright
(C) 1994-2015, Acroname Inc.]

Latest firmware for [2181F0EE][aMTMPM1] is build [264993366].
Getting firmware build [264993366] for [2181F0EE][aMTMPM1].
Downloaded firmware into local file [/Users/Mitch/.acroname/updater/2181F0EE/264993366
.bird] VERIFIED.
Network Update of device [2181F0EE] via [D272031D][00]
Discovering Module # of Network Device [2181F0EE] thru [D272031D]
Using Module #[06] for Network Device
Update using firmware file [/Users/Mitch/.acroname/updater/2181F0EE/264993366.bird].
Transferring loader to device
Transferring loader block 0, 8800 bytes
Transferred 1 blocks, 8800 total bytes
Transferring firmware to device [/Users/Mitch/.acroname/updater/2181F0EE/264993366.bird]
Transferring firmware block 0, 772 bytes

(4 of 772 bytes (0%) of firmware block transferred.
(772 of 772 bytes (100%) of firmware block transferred.
Transferring firmware block 1, 33528 bytes

(4 of 33528 bytes (0%) of firmware block transferred.
(1028 of 33528 bytes (3%) of firmware block transferred.
(2052 of 33528 bytes (6%) of firmware block transferred.
(3076 of 33528 bytes (9%) of firmware block transferred.
(4100 of 33528 bytes (12%) of firmware block transferred.
(5124 of 33528 bytes (15%) of firmware block transferred.
(6148 of 33528 bytes (18%) of firmware block transferred.
(7172 of 33528 bytes (21%) of firmware block transferred.
(8196 of 33528 bytes (24%) of firmware block transferred.
(9220 of 33528 bytes (27%) of firmware block transferred.
(10244 of 33528 bytes (30%) of firmware block transferred.
(11268 of 33528 bytes (33%) of firmware block transferred.
(12292 of 33528 bytes (36%) of firmware block transferred.
(13316 of 33528 bytes (39%) of firmware block transferred.
(14340 of 33528 bytes (42%) of firmware block transferred.
(15364 of 33528 bytes (45%) of firmware block transferred.
(16388 of 33528 bytes (48%) of firmware block transferred.
(17412 of 33528 bytes (51%) of firmware block transferred.
(18436 of 33528 bytes (54%) of firmware block transferred.
(19460 of 33528 bytes (58%) of firmware block transferred.
(20484 of 33528 bytes (61%) of firmware block transferred.
(21508 of 33528 bytes (64%) of firmware block transferred.
(22532 of 33528 bytes (67%) of firmware block transferred.
(23556 of 33528 bytes (70%) of firmware block transferred.
(24580 of 33528 bytes (73%) of firmware block transferred.
(25604 of 33528 bytes (76%) of firmware block transferred.
(26628 of 33528 bytes (79%) of firmware block transferred.
(27652 of 33528 bytes (82%) of firmware block transferred.
(28676 of 33528 bytes (85%) of firmware block transferred.
(29700 of 33528 bytes (88%) of firmware block transferred.
(30724 of 33528 bytes (91%) of firmware block transferred.
(31748 of 33528 bytes (94%) of firmware block transferred.
(32772 of 33528 bytes (97%) of firmware block transferred.
(33528 of 33528 bytes (100%) of firmware block transferred.
Transferred 2 blocks, 34300 total bytes
Resetting router number of device:[04:2181f0ee] with module# of router[D272031D]
Device [2181F0EE] may need a physical reset before router number can be reset.
Completed updating firmware on device [2181F0EE]
Sending Reset to device [2181F0EE]

Completed processing: Updater [Version: 1.0 Dec 30 2015 15:59:07] [BrainStem Release:2.1.5]
[Copyright (C) 1994-2015, Acroname Inc.]

Please note that the Updater utility may appear to hang after it has transferred the firmware. This is because the device is waiting for the device to reset so that it can try and return all the previous BrainStem network settings (ie router and module addresses) for a seamless update process; however, with some updates a hard reset will be required. Simply press the reset button on the development board or power cycle the device.