Upgrading Gateway Software and Firmware

Verifying the Current Version of RapidConnect Firmware Currently Running

Establishing a SSH terminal session to the MMB Gateway, you can view the currently running version of Firmware by running the following command:

cat /etc/os-release


This will display information about the current release running on the gateway. The version number is listed under "MMB_VERSION"

Upgrading the RapidConnect firmware

Latest RapidConnect firmware (v3.5.0) can be found here.

Once logged in to the gateway, you can access some helpful applications through a terminal.

You can use the simple_serial_upgrade application found at /home/mmb/simple_serial_upgrade application to upgrade the RapidConnect firmware by following these steps:

  • Establish a SSH terminal session to the MMB Gateway, and bring the Zigbee module out of reset by following the steps in the Basic Setup section
  • Copy the upgrade firmware to the gateway using scp or a file transfer from a USB stick (rapidha-1.7.8-prod.mbl is included as a sample on board)
  • Run the simple_serial_upgrade command as below:
simple_serial_upgrade invocation
/opt/simple_serial_upgrade -s /dev/ttyS1 -b 115200 -c xmodem -a /home/mmb/EFR32Condor-3.4.0-signed-external-prod.gbl -c version

The current Reference Image requires the use of the fully qualified paths.

  • A Sample output of the program is shown below:
Serial device name: "/dev/ttyS1"
cmd: xmodem /home/mmb/EFR32Condor-3.4.0-signed-external-prod.gbl
upgrade file size: 268896 bytes
upload complete
cmd: version
version[0]: 3.1.0.12
version[1]: 3.4.6.0
RapidConnect-Condor v3.4.6.0
done

Where "version[1]:" indicates the updated software version.


Please allow the firmware upgrade to complete once initiated. The update should not take very long (i.e. a few minutes), and we recommend not to abort it.

Upgrading the Root File System

The Gateway's Root File System (including its Kernel) and the customer Application can be upgraded independently. The MMB Reference Image contains a Java application and two bash script "/opt/swupdate_app.sh" and "/opt/swupdate_rfs.sh" that can be used to upgrade the Application Image or the Root File System using an upgrade image available on a remote HTTP server.

Serving the Upgrade Image from your PC

One way to serve the files is to use Python's built in Simple HTTP Server. On your local machine, in the folder with the {app_ubifs, rfs_ubifs}.swu upgrade files, run the following command to set up a simple HTTP server

python -m SimpleHTTPServer 9000

In your browser, navigate to <localhost>:9000 and copy the link address of the upgrade files.

SWUpdate Java Client

Using the jar file supplied in /home/mmb/

java -jar swupdate-java-client.jar [url to swupdate image]

Using the SWUpdate Socket Interface Programatically

The swupdate-java-client works by triggering a "DOWNLOADER" update through the SWUpdate Unix socket interface. The interface presents a socket at /tmp/sockinstctrl for controlling swupdate, and one at /tmp/swupdateprog to monitor the progress of the current update.

The packet structure for the control socket is as follows:

static class Packet {
		Integer magic;
		Integer type;
		Integer source;
		Integer cmd;
		Integer timeout;
		Integer len;
		String data; //max 2048 characters

		...
}

Control Field Descriptions:

  • magic: SWUpdate specific magic number, always 0x14052001
  • type: SWUpdate trigger type, the java client uses IPC_TRIGGER_DOWNLOAD constant of 6
  • source: source of the triggered update, the java client uses SOURCE_DOWNLOADER constant of 3
  • cmd: unused, 0
  • timeout: change default download timeout value, 0 for no timeout
  • len: length of data field that is valid input
  • data: Up to 2048 characters, the java client uses it to carry the URL of the update image

The packet structure for the progress socket is as follows:

static class ProgressPacket {
		Integer magic;
		Integer status;
		Integer dwl_percent;
		Integer nsteps;
		Integer cur_step;
		Integer cur_percent;
		String cur_image; //max 256 characters
		String hnd_name; //max 64 characters
		Integer source;
		Integer infolen;
		String info; //max 2048 characters

		...
}

Progress Field Descriptions:

  • magic: SWUpdate specific magic number, always 0x14052001
  • status: status of the currently running update, unused by the java client
  • dwl_percent: Percentage downloaded for current download operation, unused because we stream our updates
  • nsteps: Number of total steps in the update
  • cur_step: Current step index
  • cur_percent: Percentage completion of current step, displayed by java client
  • cur_image: Image currently being installed, displayed by java client, max 256 characters
  • hnd_name: name of handler that is installing the image, unused by java client, max 64 characters
  • source: Interface that triggered the update
  • infolen: length of info field that is valid input
  • data: Up to 2048 characters carrying additional information about the update, unused by java client

Java Client Control Logic

  • Open both sockets and prepare a control packet to be sent to SWUpdate
  • Send the control packet over the control socket
  • Listen for packets on the progress socket and print relevant information
  • Keep listening until the control socket is closed (Socket is closed when SWUpdate daemon is killed)

Java Client Source code

swupdate-java-client.zip

Upgrading Gateway API Library

Find The IP Address

To upgrade the GatewayAPI Library you must first find the IP Address of your gateway device.

On mac/linux, run arp-scan:

# arp-scan --localnet | grep <ethernet mac address>
sudo arp-scan --localnet | grep 00:24:26:05:10:8c

# results:
192.168.0.38	00:24:46:05:10:8c	MMB Research Inc.

Download The Latest Gateway API .jar

The downloads for the new GatewayAPI Library can be found in the Downloads page and store it somewhere on your local file system

Delete the old version of GatewayAPI.jar

ssh into the gateway device

username: mmb

password: networks

# ssh mmb@<gateway ip address>
ssh mmb@192.168.0.38

Then remove the old GatewayAPI jar

[mmb@Tripoli-05108C:~]$ rm gateway-api-2.0.12-SNAPSHOT-standalone.jar

Transfer the new GatewayAPI onto the Gateway Using SCP 

The GatewayAPI jar must be stored in the /home/mmb folder

# Transfer gatewayapi to remote gatewaydevice
scp gateway-api-2.0.13-standalone.jar mmb@192.168.0.38:/home/mmb/

Run The SimpleCli (optional)

The gateway API comes with a SimpleCli application that will allow you to run gateway commands from the console

java -cp gateway-api-2.0.13-standalone.jar com.mmbnetworks.gatewayapi.sample.SimpleCli /dev/ttyS1

Legal Notices

Copyright © 2020 MMB Networks, Inc. All rights reserved.
Confidential materials prepared and delivered by MMB Networks for receipt and review only by any partner subject to a valid and enforceable MMB Networks confidentiality agreement. Any receipt, review, or misuse of any of the content exchanged hereunder by any party not a party to this confidential exchange shall be subject to any and all rights available under the law. All rights, title and interest to the materials shall remain with MMB Networks.
Any suggestions provided to MMB Networks with respect to MMB Networks' products or services shall be collectively deemed “Feedback.” You, on behalf of yourself, or if you are providing Feedback on behalf of your employer or another entity, represent and warrant that you have full legal authority to bind such entity to these terms, agree to grant and hereby grant to MMB Networks a nonexclusive, perpetual, irrevocable, royalty free, worldwide license to use and otherwise exploit such Feedback within any MMB Networks products and services.